[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: disassembling machine code



On Wed, Mar 19, 2008 at 12:26:19PM -0700, PETER EASTHOPE wrote:
> I have these 5 bytes of machine code to 
> disassemble.
> 
>     b8 12 00 cd 10
> 
> I've looked at gdb and objdump.  Appears they 
> need a complete object file.  Someone please 
> give a clue.

Write the machine code to a file:
$ perl -e 'print pack "H*", "b81200cd10";' > /tmp/binfile
$ hd /tmp/binfile
00000000  b8 12 00 cd 10                                    |¸..Í.|
00000005

Then use objdump, specifying the object file format as raw.
Because the raw file has no metadata, you need to give the CPU
architecture as well.

$ objdump -m i386 -b binary -D /tmp/binfile

int 10h is a VESA BIOS call - you should be able to figure out the rest
yourself.

Regards,
MIrko


Reply to: