1974 shaares
6 private links
6 private links
2 results
tagged
contest
7 bytes
0000000: 6641 2521 2173 21 fA%!!s!
As 32 bit
00000000 6641 inc cx
00000002 2521217321 and eax,0x21732121
As 64 bit
00000000 6641252121 and ax,0x2121
00000005 7321 jnc 0x28
and clears the carry flag so the 64 bit version always jumps. For 64-bit the 6641 is the operand size override followed by rex.b so the operand size for the and comes out as 16 bit. On 32-bit the 6641 is a complete instruction so the and has no prefix and has a 32-bit operand size. This changes the number of immediate bytes consumed by the and giving two bytes of instructions that are only executed in 64-bit mode.