I'm attempting to dissect/disassemble a windows PE file under Linux using objdump. On surface analysis, the .code section was disassembled to :
tmp.exe: file format pei-i386
Disassembly of section CODE:
00401000 <CODE>:
401000: 04 10 add $0x10,%al
401002: 40 inc %eax
401003: 00 03 add %al,(%ebx)
401005: 07 pop %es
401006: 42 inc %edx
401007: 6f outsl %ds:(%esi),(%dx)
401008: 6f outsl %ds:(%esi),(%dx)
401009: 6c insb (%dx),%es:(%edi)
40100a: 65 gs
40100b: 61 popa
40100c: 6e outsb %ds:(%esi),(%dx)
40100d: 01 00 add %eax,(%eax)
40100f: 00 00 add %al,(%eax)
401011: 00 01 add %al,(%ecx)
401013: 00 00 add %al,(%eax)
401015: 00 00 add %al,(%eax)
...
Then I looked at the entry point which was 0x45e534, which ended up within an opcode:
45e52f: 00 dc add %bl,%ah
45e531: e2 45 loop 0x45e578
45e533: 00 55 8b add %dl,-0x75(%ebp)
45e536: ec in (%dx),%al
45e537: 83 c4 f0 add $0xfffffff0,%esp
45e53a: b8 04 e3 45 00 mov $0x45e304,%eax
45e53f: e8 e0 84 fa ff call 0x406a24
Which, I feel is very wrong; but since my understanding of assembly is lacking, I could be wrong.
So having read [1] and the chapter on Disassembly in "Practical Malware Analysis", I realized that there could be data in the .text (or in this case, CODE) section. So I took a gander at the hex dump on the file and came across at the beginning of the code section:
0000400: 0410 4000 0307 426f 6f6c 6561 6e01 0000 [email protected]...
0000410: 0000 0100 0000 0010 4000 0546 616c 7365 [email protected]
0000420: 0454 7275 658d 4000 2c10 4000 0204 4368 .True.@.,[email protected]
0000430: 6172 0100 0000 00ff 0000 0090 4010 4000 ar..........@.@.
0000440: 0107 496e 7465 6765 7204 0000 0080 ffff ..Integer.......
0000450: ff7f 8bc0 5810 4000 0104 4279 7465 0100 [email protected]..
0000460: 0000 00ff 0000 0090 6c10 4000 0104 576f [email protected]
0000470: 7264 0300 0000 00ff ff00 0090 8010 4000 rd............@.
0000480: 0108 4361 7264 696e 616c 0500 0000 00ff ..Cardinal......
0000490: ffff ff90 9810 4000 0a06 5374 7269 6e67 [email protected]
...
This lead me to believe that there is definitely DATA in the code section [but, again, I could be wrong].
My question is (even given [1]), is it possible to figure out what the format of the DATA is in that part of the binary?
With my limited understanding, I'm guessing it's a structure of some sort or possibly a long list of DB/DW but (again, I could be wrong).
For instance, the very first set:
0410 4000 0307 426f 6f6c 6561 6e01 00 00..
Could the above be translated to something like (in assembly)
DB 0x00401004
DB 0x0703
DB "Boolean"
...
I tried to look for the opcode DB in [2] but couldn't find it, so I'm wondering if I'm barking up the wrong tree.
Any help/pointers appreciated
:ewong
[1] - How do reverse engineers commonly detect the format of binary data?