how to use the command line to generate the byte file using IDA? I know how to get the .asm but not the byte file
-
What do you mean by “byte file”?– Igor Skochinsky ♦Oct 16, 2018 at 21:50
-
I meant the hexadecimal representation of the file's binary content e.g.: 00401000 56 8D 44 24 08 50 8B F1 E8 1C 1B 00 00 C7 06 08 00401010 BB 42 00 8B C6 5E C2 04 00 CC CC CC CC CC CC CC 00401020 C7 01 08 BB 42 00 E9 26 1C 00 00 CC CC CC CC CC 00401030 56 8B F1 C7 06 08 BB 42 00 E8 13 1C 00 00 F6 44 00401040 24 08 01 74 09 56 E8 6C 1E 00 00 83 C4 04 8B C6 00401050 5E C2 04 00 CC CC CC CC CC CC CC CC CC CC CC CC 00401060 8B 44 24 08 8A 08 8B 54 24 04 88 0A C3 CC CC CC 00401070 8B 44 24 04 8D 50 01 8A 08 40 84 C9 75 F9 2B C2 00401080 C3 CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC– Zhong Ben DifficileOct 17, 2018 at 7:02
-
please update the question with this info (use "edit" link).– Igor Skochinsky ♦Oct 17, 2018 at 13:36
1 Answer
You have to use some IDAPython script (example below - it dumps the file in a form you probably need)
and run it as {ida executable} -c -A -S{script file full name} {your idb file}
from the command line.
import idautils
import idc
def hexdump(f, start, end):
while start < end:
if start & 0xf == 0:
f.write("\n0x%08x "%start)
f.write (" %02x"%Byte(start))
start += 1
f = open("your_output_file_name", "w)
for seg in Segments():
start = SegStart(seg)
end = SegEnd(seg)
hexdump(f, start, end)
f.close()
The script is not debugged, beware errors.