I'm trying to get around some input character restrictions by encrypting some data. However, when i try and XOR rbx back to my desired value I get an error stating operand mismatch. Am i missing something here?
xor esi, esi movabs rbx, 0x4a510d0d4c4b400d xor rbx, 0x2222222222222222
movl
to move a 32-bit immediate to a 64-bit register, usemovq
instead to sign-extend andmovabsq
for full 64-bit immediates.0xffffffffa2222222
. The choice appears arbitrary here, since this is just obscuring constants and avoiding00
bytes in shellcode. In this case it's the constant is0x68732f2f6e69622f
which looks like an ASCII string. So in NASM you could writemov rbx, `hello w\n` ^ 0xffffffffa2222222
/xor rbx, 0xffffffffa2222222
. It's annoying when people obscure their ASCII in shellcode source by manually encoding it in hex. Just use an assembler that doesn't suck to make your machine code.