Is there some tool to disassemble a raw hex into assembly instructions? for example: lets say we have \xeb\x1d that disassemble into jmp 0x1f according to this online disassembler. So is there some offline tool? I have tried ndisasm its not giving me the right output.
ndisam -b32
foo gives me:
OUTPUT:
00000000 5C pop esp<br>
00000001 7833 js 0x36<br>
00000003 315C7865 xor [eax+edi*2+0x65],ebx<br>
00000007 620A bound ecx,[edx]
It should be jmp 0x1f. I have also tried objdump like:
objdump -D -b binary -mi386 -M intel foo
OUTPUT:
00000000 <.data>:<br>
0: 5c pop esp <br>
1: 78 33 js 0x36 <br>
3: 31 5c 78 65 xor DWORD PTR [eax+edi*2+0x65],ebx<br>
7: 62 0a bound ecx,QWORD PTR [edx]<br>
SO can you tell me some tool that will disassemble raw hex codes into assembly language.
I have also tried gdb but I want something more flexible.
\xeb\x1d
(terminated with a newline) which is what you get when you typeecho '\xeb\x1d' >foo
. You want to disassemble the bytes eb 1d, seems like you misunderstood what"\xeb\x1d"
means. – Rendezvouseb 1d
isjmp .+0x1f
, i.e. the address jumped to is relative to the address where the jump instruction is. Depending on where this instruction is disassembled, the absolute jump target changes! – RendezvousMOV AX, BX
, then no matter which one is found in the hex dump, it would be disassembled toMOV AX, BX
, which is the original instruction! – Bonnette