Search code examples
disassemblyida

disassembly of small hexa fragment in IDA pro


I want to disassembly small hex fragment, for example "6a2958996a" in IDA pro in 64 bit mode? Is there an easy way to do it? Or i should create ELF file first and disassembly it?


Solution

  • IDA can also load 'flat' binary file.

    Open an empty file with an hex editor and input the required bytes in it.

    I prefer to go directly with python 3.x :

    >>> with open("c:\\tmp\\tmp_file.bin", "wb") as f:
        f.write(bytearray.fromhex("6a2958996a"))
    

    Open IDA (64-bit version) and open the binary file with it.

    1. Keep the default options (or choose the right processor, e.g. '686p'):

    enter image description here

    1. Make sure you select 64-bit mode:

    enter image description here

    1. By default the code is not disassembled:

    enter image description here

    1. Put the cursor on the first byte (0x6a; address 0x00) and then press 'c' to make it code rather than undefined byte:

    enter image description here

    Well, the example is not a completely valid code (0x6a is awaiting for another byte) but you get the whole idea...