elf-parser: file format elf32-i386
Disassembly of section .init:
080484a4 :
80484a4: 53 push %ebx
80484a5: 83 ec 08 sub $0x8,%esp
80484a8: e8 00 00 00 00 call 80484ad
80484ad: 5b pop %ebx
80484ae: 81 c3 47 3b 00 00 add $0x3b47,%ebx
80484b4: 8b 83 fc ff ff ff mov -0x4(%ebx),%eax
80484ba: 85 c0 test %eax,%eax
80484bc: 74 05 je 80484c3
80484be: e8 ad 00 00 00 call 8048570
80484c3: e8 c8 01 00 00 call 8048690
80484c8: e8 e3 16 00 00 call 8049bb0
80484cd: 83 c4 08 add $0x8,%esp
80484d0: 5b pop %ebx
80484d1: c3 ret
Disassembly of section .plt:
080484e0 :
80484e0: ff 35 f8 bf 04 08 pushl 0x804bff8
80484e6: ff 25 fc bf 04 08 jmp *0x804bffc
80484ec: 00 00 add %al,(%eax)
...
080484f0 :
80484f0: ff 25 00 c0 04 08 jmp *0x804c000
80484f6: 68 00 00 00 00 push $0x0
80484fb: e9 e0 ff ff ff jmp 80484e0
08048500 :
8048500: ff 25 04 c0 04 08 jmp *0x804c004
8048506: 68 08 00 00 00 push $0x8
804850b: e9 d0 ff ff ff jmp 80484e0
08048510 :
8048510: ff 25 08 c0 04 08 jmp *0x804c008
8048516: 68 10 00 00 00 push $0x10
804851b: e9 c0 ff ff ff jmp 80484e0
08048520 :
8048520: ff 25 0c c0 04 08 jmp *0x804c00c
8048526: 68 18 00 00 00 push $0x18
804852b: e9 b0 ff ff ff jmp 80484e0
08048530 :
8048530: ff 25 10 c0 04 08 jmp *0x804c010
8048536: 68 20 00 00 00 push $0x20
804853b: e9 a0 ff ff ff jmp 80484e0
08048540 :
8048540: ff 25 14 c0 04 08 jmp *0x804c014
8048546: 68 28 00 00 00 push $0x28
804854b: e9 90 ff ff ff jmp 80484e0
08048550 :
8048550: ff 25 18 c0 04 08 jmp *0x804c018
8048556: 68 30 00 00 00 push $0x30
804855b: e9 80 ff ff ff jmp 80484e0
08048560 :
8048560: ff 25 1c c0 04 08 jmp *0x804c01c
8048566: 68 38 00 00 00 push $0x38
804856b: e9 70 ff ff ff jmp 80484e0
08048570 :
8048570: ff 25 20 c0 04 08 jmp *0x804c020
8048576: 68 40 00 00 00 push $0x40
804857b: e9 60 ff ff ff jmp 80484e0
08048580 :
8048580: ff 25 24 c0 04 08 jmp *0x804c024
8048586: 68 48 00 00 00 push $0x48
804858b: e9 50 ff ff ff jmp 80484e0
08048590 :
8048590: ff 25 28 c0 04 08 jmp *0x804c028
8048596: 68 50 00 00 00 push $0x50
804859b: e9 40 ff ff ff jmp 80484e0
080485a0 :
80485a0: ff 25 2c c0 04 08 jmp *0x804c02c
80485a6: 68 58 00 00 00 push $0x58
80485ab: e9 30 ff ff ff jmp 80484e0
080485b0 :
80485b0: ff 25 30 c0 04 08 jmp *0x804c030
80485b6: 68 60 00 00 00 push $0x60
80485bb: e9 20 ff ff ff jmp 80484e0
080485c0 :
80485c0: ff 25 34 c0 04 08 jmp *0x804c034
80485c6: 68 68 00 00 00 push $0x68
80485cb: e9 10 ff ff ff jmp 80484e0
080485d0 :
80485d0: ff 25 38 c0 04 08 jmp *0x804c038
80485d6: 68 70 00 00 00 push $0x70
80485db: e9 00 ff ff ff jmp 80484e0
080485e0 :
80485e0: ff 25 3c c0 04 08 jmp *0x804c03c
80485e6: 68 78 00 00 00 push $0x78
80485eb: e9 f0 fe ff ff jmp 80484e0
080485f0 :
80485f0: ff 25 40 c0 04 08 jmp *0x804c040
80485f6: 68 80 00 00 00 push $0x80
80485fb: e9 e0 fe ff ff jmp 80484e0
Disassembly of section .text:
08048600 :
8048600: 31 ed xor %ebp,%ebp
8048602: 5e pop %esi
8048603: 89 e1 mov %esp,%ecx
8048605: 83 e4 f0 and $0xfffffff0,%esp
8048608: 50 push %eax
8048609: 54 push %esp
804860a: 52 push %edx
804860b: 68 a0 9b 04 08 push $0x8049ba0
8048610: 68 30 9b 04 08 push $0x8049b30
8048615: 51 push %ecx
8048616: 56 push %esi
8048617: 68 08 97 04 08 push $0x8049708
804861c: e8 8f ff ff ff call 80485b0
8048621: f4 hlt
8048622: 90 nop
8048623: 90 nop
8048624: 90 nop
8048625: 90 nop
8048626: 90 nop
8048627: 90 nop
8048628: 90 nop
8048629: 90 nop
804862a: 90 nop
804862b: 90 nop
804862c: 90 nop
804862d: 90 nop
804862e: 90 nop
804862f: 90 nop
08048630 :
8048630: 55 push %ebp
8048631: 89 e5 mov %esp,%ebp
8048633: 53 push %ebx
8048634: 83 ec 04 sub $0x4,%esp
8048637: 80 3d 4c c0 04 08 00 cmpb $0x0,0x804c04c
804863e: 75 3f jne 804867f
8048640: a1 50 c0 04 08 mov 0x804c050,%eax
8048645: bb 20 bf 04 08 mov $0x804bf20,%ebx
804864a: 81 eb 1c bf 04 08 sub $0x804bf1c,%ebx
8048650: c1 fb 02 sar $0x2,%ebx
8048653: 83 eb 01 sub $0x1,%ebx
8048656: 39 d8 cmp %ebx,%eax
8048658: 73 1e jae 8048678
804865a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
8048660: 83 c0 01 add $0x1,%eax
8048663: a3 50 c0 04 08 mov %eax,0x804c050
8048668: ff 14 85 1c bf 04 08 call *0x804bf1c(,%eax,4)
804866f: a1 50 c0 04 08 mov 0x804c050,%eax
8048674: 39 d8 cmp %ebx,%eax
8048676: 72 e8 jb 8048660
8048678: c6 05 4c c0 04 08 01 movb $0x1,0x804c04c
804867f: 83 c4 04 add $0x4,%esp
8048682: 5b pop %ebx
8048683: 5d pop %ebp
8048684: c3 ret
8048685: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
8048689: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
08048690 :
8048690: 55 push %ebp
8048691: 89 e5 mov %esp,%ebp
8048693: 83 ec 18 sub $0x18,%esp
8048696: a1 24 bf 04 08 mov 0x804bf24,%eax
804869b: 85 c0 test %eax,%eax
804869d: 74 12 je 80486b1
804869f: b8 00 00 00 00 mov $0x0,%eax
80486a4: 85 c0 test %eax,%eax
80486a6: 74 09 je 80486b1
80486a8: c7 04 24 24 bf 04 08 movl $0x804bf24,(%esp)
80486af: ff d0 call *%eax
80486b1: c9 leave
80486b2: c3 ret
80486b3: 90 nop
080486b4 :
#define debug(...) \
do { if (DEBUG) printf(":"__VA_ARGS__); } while (0)
void read_elf_header(int32_t fd, Elf32_Ehdr *elf_header)
{
80486b4: 55 push %ebp
80486b5: 89 e5 mov %esp,%ebp
80486b7: 83 ec 18 sub $0x18,%esp
assert(elf_header != NULL);
80486ba: 83 7d 0c 00 cmpl $0x0,0xc(%ebp)
80486be: 75 24 jne 80486e4
80486c0: c7 44 24 0c 64 a3 04 movl $0x804a364,0xc(%esp)
80486c7: 08
80486c8: c7 44 24 08 13 00 00 movl $0x13,0x8(%esp)
80486cf: 00
80486d0: c7 44 24 04 00 9c 04 movl $0x8049c00,0x4(%esp)
80486d7: 08
80486d8: c7 04 24 0d 9c 04 08 movl $0x8049c0d,(%esp)
80486df: e8 0c ff ff ff call 80485f0
assert(lseek(fd, (off_t)0, SEEK_SET) == (off_t)0);
80486e4: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp)
80486eb: 00
80486ec: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
80486f3: 00
80486f4: 8b 45 08 mov 0x8(%ebp),%eax
80486f7: 89 04 24 mov %eax,(%esp)
80486fa: e8 21 fe ff ff call 8048520
80486ff: 85 c0 test %eax,%eax
8048701: 74 24 je 8048727
8048703: c7 44 24 0c 64 a3 04 movl $0x804a364,0xc(%esp)
804870a: 08
804870b: c7 44 24 08 14 00 00 movl $0x14,0x8(%esp)
8048712: 00
8048713: c7 44 24 04 00 9c 04 movl $0x8049c00,0x4(%esp)
804871a: 08
804871b: c7 04 24 28 9c 04 08 movl $0x8049c28,(%esp)
8048722: e8 c9 fe ff ff call 80485f0
assert(read(fd, (void *)elf_header, sizeof(Elf32_Ehdr)) == sizeof(Elf32_Ehdr));
8048727: c7 44 24 08 34 00 00 movl $0x34,0x8(%esp)
804872e: 00
804872f: 8b 45 0c mov 0xc(%ebp),%eax
8048732: 89 44 24 04 mov %eax,0x4(%esp)
8048736: 8b 45 08 mov 0x8(%ebp),%eax
8048739: 89 04 24 mov %eax,(%esp)
804873c: e8 af fd ff ff call 80484f0
8048741: 83 f8 34 cmp $0x34,%eax
8048744: 74 24 je 804876a
8048746: c7 44 24 0c 64 a3 04 movl $0x804a364,0xc(%esp)
804874d: 08
804874e: c7 44 24 08 15 00 00 movl $0x15,0x8(%esp)
8048755: 00
8048756: c7 44 24 04 00 9c 04 movl $0x8049c00,0x4(%esp)
804875d: 08
804875e: c7 04 24 4c 9c 04 08 movl $0x8049c4c,(%esp)
8048765: e8 86 fe ff ff call 80485f0
}
804876a: c9 leave
804876b: c3 ret
0804876c :
bool is_ELF(Elf32_Ehdr eh)
{
804876c: 55 push %ebp
804876d: 89 e5 mov %esp,%ebp
804876f: 57 push %edi
8048770: 56 push %esi
8048771: 83 ec 10 sub $0x10,%esp
/* ELF magic bytes are 0x7f,'E','L','F'
* Using octal escape sequence to represent 0x7f
*/
if(!strncmp((char*)eh.e_ident, "\177ELF", 4)) {
8048774: 8d 55 08 lea 0x8(%ebp),%edx
8048777: b8 93 9c 04 08 mov $0x8049c93,%eax
804877c: b9 04 00 00 00 mov $0x4,%ecx
8048781: 89 d6 mov %edx,%esi
8048783: 89 c7 mov %eax,%edi
8048785: f3 a6 repz cmpsb %es:(%edi),%ds:(%esi)
8048787: 0f 97 c2 seta %dl
804878a: 0f 92 c0 setb %al
804878d: 89 d1 mov %edx,%ecx
804878f: 28 c1 sub %al,%cl
8048791: 89 c8 mov %ecx,%eax
8048793: 0f be c0 movsbl %al,%eax
8048796: 85 c0 test %eax,%eax
8048798: 75 13 jne 80487ad
printf("ELFMAGIC \t= ELF\n");
804879a: c7 04 24 98 9c 04 08 movl $0x8049c98,(%esp)
80487a1: e8 ba fd ff ff call 8048560
/* IS a ELF file */
return 1;
80487a6: b8 01 00 00 00 mov $0x1,%eax
80487ab: eb 11 jmp 80487be
} else {
printf("ELFMAGIC mismatch!\n");
80487ad: c7 04 24 a8 9c 04 08 movl $0x8049ca8,(%esp)
80487b4: e8 a7 fd ff ff call 8048560
/* Not ELF file */
return 0;
80487b9: b8 00 00 00 00 mov $0x0,%eax
}
}
80487be: 83 c4 10 add $0x10,%esp
80487c1: 5e pop %esi
80487c2: 5f pop %edi
80487c3: 5d pop %ebp
80487c4: c3 ret
080487c5 :
void print_elf_header(Elf32_Ehdr elf_header)
{
80487c5: 55 push %ebp
80487c6: 89 e5 mov %esp,%ebp
80487c8: 83 ec 28 sub $0x28,%esp
/* Storage capacity class */
printf("Storage class\t= ");
80487cb: b8 bb 9c 04 08 mov $0x8049cbb,%eax
80487d0: 89 04 24 mov %eax,(%esp)
80487d3: e8 28 fd ff ff call 8048500
switch(elf_header.e_ident[EI_CLASS])
80487d8: 0f b6 45 0c movzbl 0xc(%ebp),%eax
80487dc: 0f b6 c0 movzbl %al,%eax
80487df: 83 f8 01 cmp $0x1,%eax
80487e2: 74 07 je 80487eb
80487e4: 83 f8 02 cmp $0x2,%eax
80487e7: 74 10 je 80487f9
80487e9: eb 1c jmp 8048807
{
case ELFCLASS32:
printf("32-bit objects\n");
80487eb: c7 04 24 cc 9c 04 08 movl $0x8049ccc,(%esp)
80487f2: e8 69 fd ff ff call 8048560
break;
80487f7: eb 1b jmp 8048814
case ELFCLASS64:
printf("64-bit objects\n");
80487f9: c7 04 24 db 9c 04 08 movl $0x8049cdb,(%esp)
8048800: e8 5b fd ff ff call 8048560
break;
8048805: eb 0d jmp 8048814
default:
printf("INVALID CLASS\n");
8048807: c7 04 24 ea 9c 04 08 movl $0x8049cea,(%esp)
804880e: e8 4d fd ff ff call 8048560
break;
8048813: 90 nop
}
/* Data Format */
printf("Data format\t= ");
8048814: b8 f8 9c 04 08 mov $0x8049cf8,%eax
8048819: 89 04 24 mov %eax,(%esp)
804881c: e8 df fc ff ff call 8048500
switch(elf_header.e_ident[EI_DATA])
8048821: 0f b6 45 0d movzbl 0xd(%ebp),%eax
8048825: 0f b6 c0 movzbl %al,%eax
8048828: 83 f8 01 cmp $0x1,%eax
804882b: 74 07 je 8048834
804882d: 83 f8 02 cmp $0x2,%eax
8048830: 74 10 je 8048842
8048832: eb 1c jmp 8048850
{
case ELFDATA2LSB:
printf("2's complement, little endian\n");
8048834: c7 04 24 07 9d 04 08 movl $0x8049d07,(%esp)
804883b: e8 20 fd ff ff call 8048560
break;
8048840: eb 1b jmp 804885d
case ELFDATA2MSB:
printf("2's complement, big endian\n");
8048842: c7 04 24 25 9d 04 08 movl $0x8049d25,(%esp)
8048849: e8 12 fd ff ff call 8048560
break;
804884e: eb 0d jmp 804885d
default:
printf("INVALID Format\n");
8048850: c7 04 24 40 9d 04 08 movl $0x8049d40,(%esp)
8048857: e8 04 fd ff ff call 8048560
break;
804885c: 90 nop
}
/* OS ABI */
printf("OS ABI\t\t= ");
804885d: b8 4f 9d 04 08 mov $0x8049d4f,%eax
8048862: 89 04 24 mov %eax,(%esp)
8048865: e8 96 fc ff ff call 8048500
switch(elf_header.e_ident[EI_OSABI])
804886a: 0f b6 45 0f movzbl 0xf(%ebp),%eax
804886e: 0f b6 c0 movzbl %al,%eax
8048871: 83 f8 08 cmp $0x8,%eax
8048874: 0f 84 ea 00 00 00 je 8048964
804887a: 83 f8 08 cmp $0x8,%eax
804887d: 7f 38 jg 80488b7
804887f: 83 f8 02 cmp $0x2,%eax
8048882: 0f 84 98 00 00 00 je 8048920
8048888: 83 f8 02 cmp $0x2,%eax
804888b: 7f 0e jg 804889b
804888d: 85 c0 test %eax,%eax
804888f: 74 6d je 80488fe
8048891: 83 f8 01 cmp $0x1,%eax
8048894: 74 79 je 804890f
8048896: e9 39 01 00 00 jmp 80489d4
804889b: 83 f8 06 cmp $0x6,%eax
804889e: 0f 84 9e 00 00 00 je 8048942
80488a4: 83 f8 06 cmp $0x6,%eax
80488a7: 0f 8f a6 00 00 00 jg 8048953
80488ad: 83 f8 03 cmp $0x3,%eax
80488b0: 74 7f je 8048931
80488b2: e9 1d 01 00 00 jmp 80489d4
80488b7: 83 f8 0c cmp $0xc,%eax
80488ba: 0f 84 dc 00 00 00 je 804899c
80488c0: 83 f8 0c cmp $0xc,%eax
80488c3: 7f 17 jg 80488dc
80488c5: 83 f8 0a cmp $0xa,%eax
80488c8: 0f 84 b2 00 00 00 je 8048980
80488ce: 83 f8 0a cmp $0xa,%eax
80488d1: 0f 8f b7 00 00 00 jg 804898e
80488d7: e9 96 00 00 00 jmp 8048972
80488dc: 83 f8 61 cmp $0x61,%eax
80488df: 0f 84 d3 00 00 00 je 80489b8
80488e5: 3d ff 00 00 00 cmp $0xff,%eax
80488ea: 0f 84 d6 00 00 00 je 80489c6
80488f0: 83 f8 40 cmp $0x40,%eax
80488f3: 0f 84 b1 00 00 00 je 80489aa
80488f9: e9 d6 00 00 00 jmp 80489d4
{
case ELFOSABI_SYSV:
printf("UNIX System V ABI\n");
80488fe: c7 04 24 5a 9d 04 08 movl $0x8049d5a,(%esp)
8048905: e8 56 fc ff ff call 8048560
break;
804890a: e9 de 00 00 00 jmp 80489ed
case ELFOSABI_HPUX:
printf("HP-UX\n");
804890f: c7 04 24 6c 9d 04 08 movl $0x8049d6c,(%esp)
8048916: e8 45 fc ff ff call 8048560
break;
804891b: e9 cd 00 00 00 jmp 80489ed
case ELFOSABI_NETBSD:
printf("NetBSD\n");
8048920: c7 04 24 72 9d 04 08 movl $0x8049d72,(%esp)
8048927: e8 34 fc ff ff call 8048560
break;
804892c: e9 bc 00 00 00 jmp 80489ed
case ELFOSABI_LINUX:
printf("Linux\n");
8048931: c7 04 24 79 9d 04 08 movl $0x8049d79,(%esp)
8048938: e8 23 fc ff ff call 8048560
break;
804893d: e9 ab 00 00 00 jmp 80489ed
case ELFOSABI_SOLARIS:
printf("Sun Solaris\n");
8048942: c7 04 24 7f 9d 04 08 movl $0x8049d7f,(%esp)
8048949: e8 12 fc ff ff call 8048560
break;
804894e: e9 9a 00 00 00 jmp 80489ed
case ELFOSABI_AIX:
printf("IBM AIX\n");
8048953: c7 04 24 8b 9d 04 08 movl $0x8049d8b,(%esp)
804895a: e8 01 fc ff ff call 8048560
break;
804895f: e9 89 00 00 00 jmp 80489ed
case ELFOSABI_IRIX:
printf("SGI Irix\n");
8048964: c7 04 24 93 9d 04 08 movl $0x8049d93,(%esp)
804896b: e8 f0 fb ff ff call 8048560
break;
8048970: eb 7b jmp 80489ed
case ELFOSABI_FREEBSD:
printf("FreeBSD\n");
8048972: c7 04 24 9c 9d 04 08 movl $0x8049d9c,(%esp)
8048979: e8 e2 fb ff ff call 8048560
break;
804897e: eb 6d jmp 80489ed
case ELFOSABI_TRU64:
printf("Compaq TRU64 UNIX\n");
8048980: c7 04 24 a4 9d 04 08 movl $0x8049da4,(%esp)
8048987: e8 d4 fb ff ff call 8048560
break;
804898c: eb 5f jmp 80489ed
case ELFOSABI_MODESTO:
printf("Novell Modesto\n");
804898e: c7 04 24 b6 9d 04 08 movl $0x8049db6,(%esp)
8048995: e8 c6 fb ff ff call 8048560
break;
804899a: eb 51 jmp 80489ed
case ELFOSABI_OPENBSD:
printf("OpenBSD\n");
804899c: c7 04 24 c5 9d 04 08 movl $0x8049dc5,(%esp)
80489a3: e8 b8 fb ff ff call 8048560
break;
80489a8: eb 43 jmp 80489ed
case ELFOSABI_ARM_AEABI:
printf("ARM EABI\n");
80489aa: c7 04 24 cd 9d 04 08 movl $0x8049dcd,(%esp)
80489b1: e8 aa fb ff ff call 8048560
break;
80489b6: eb 35 jmp 80489ed
case ELFOSABI_ARM:
printf("ARM\n");
80489b8: c7 04 24 d6 9d 04 08 movl $0x8049dd6,(%esp)
80489bf: e8 9c fb ff ff call 8048560
break;
80489c4: eb 27 jmp 80489ed
case ELFOSABI_STANDALONE:
printf("Standalone (embedded) app\n");
80489c6: c7 04 24 da 9d 04 08 movl $0x8049dda,(%esp)
80489cd: e8 8e fb ff ff call 8048560
break;
80489d2: eb 19 jmp 80489ed
default:
printf("Unknown (0x%x)\n", elf_header.e_ident[EI_OSABI]);
80489d4: 0f b6 45 0f movzbl 0xf(%ebp),%eax
80489d8: 0f b6 d0 movzbl %al,%edx
80489db: b8 f4 9d 04 08 mov $0x8049df4,%eax
80489e0: 89 54 24 04 mov %edx,0x4(%esp)
80489e4: 89 04 24 mov %eax,(%esp)
80489e7: e8 14 fb ff ff call 8048500
break;
80489ec: 90 nop
}
/* ELF filetype */
printf("Filetype \t= ");
80489ed: b8 04 9e 04 08 mov $0x8049e04,%eax
80489f2: 89 04 24 mov %eax,(%esp)
80489f5: e8 06 fb ff ff call 8048500
switch(elf_header.e_type)
80489fa: 0f b7 45 18 movzwl 0x18(%ebp),%eax
80489fe: 0f b7 c0 movzwl %ax,%eax
8048a01: 83 f8 01 cmp $0x1,%eax
8048a04: 74 25 je 8048a2b
8048a06: 83 f8 01 cmp $0x1,%eax
8048a09: 7f 06 jg 8048a11
8048a0b: 85 c0 test %eax,%eax
8048a0d: 74 0e je 8048a1d
8048a0f: eb 44 jmp 8048a55
8048a11: 83 f8 02 cmp $0x2,%eax
8048a14: 74 23 je 8048a39
8048a16: 83 f8 03 cmp $0x3,%eax
8048a19: 74 2c je 8048a47
8048a1b: eb 38 jmp 8048a55
{
case ET_NONE:
printf("N/A (0x0)\n");
8048a1d: c7 04 24 11 9e 04 08 movl $0x8049e11,(%esp)
8048a24: e8 37 fb ff ff call 8048560
break;
8048a29: eb 43 jmp 8048a6e
case ET_REL:
printf("Relocatable\n");
8048a2b: c7 04 24 1b 9e 04 08 movl $0x8049e1b,(%esp)
8048a32: e8 29 fb ff ff call 8048560
break;
8048a37: eb 35 jmp 8048a6e
case ET_EXEC:
printf("Executable\n");
8048a39: c7 04 24 27 9e 04 08 movl $0x8049e27,(%esp)
8048a40: e8 1b fb ff ff call 8048560
break;
8048a45: eb 27 jmp 8048a6e
case ET_DYN:
printf("Shared Object\n");
8048a47: c7 04 24 32 9e 04 08 movl $0x8049e32,(%esp)
8048a4e: e8 0d fb ff ff call 8048560
break;
8048a53: eb 19 jmp 8048a6e
default:
printf("Unknown (0x%x)\n", elf_header.e_type);
8048a55: 0f b7 45 18 movzwl 0x18(%ebp),%eax
8048a59: 0f b7 d0 movzwl %ax,%edx
8048a5c: b8 f4 9d 04 08 mov $0x8049df4,%eax
8048a61: 89 54 24 04 mov %edx,0x4(%esp)
8048a65: 89 04 24 mov %eax,(%esp)
8048a68: e8 93 fa ff ff call 8048500
break;
8048a6d: 90 nop
}
/* ELF Machine-id */
printf("Machine\t\t= ");
8048a6e: b8 40 9e 04 08 mov $0x8049e40,%eax
8048a73: 89 04 24 mov %eax,(%esp)
8048a76: e8 85 fa ff ff call 8048500
switch(elf_header.e_machine)
8048a7b: 0f b7 45 1a movzwl 0x1a(%ebp),%eax
8048a7f: 0f b7 c0 movzwl %ax,%eax
8048a82: 83 f8 03 cmp $0x3,%eax
8048a85: 74 17 je 8048a9e
8048a87: 83 f8 28 cmp $0x28,%eax
8048a8a: 74 29 je 8048ab5
8048a8c: 85 c0 test %eax,%eax
8048a8e: 75 3c jne 8048acc
{
case EM_NONE:
printf("None (0x0)\n");
8048a90: c7 04 24 4c 9e 04 08 movl $0x8049e4c,(%esp)
8048a97: e8 c4 fa ff ff call 8048560
break;
8048a9c: eb 47 jmp 8048ae5
case EM_386:
printf("INTEL x86 (0x%x)\n", EM_386);
8048a9e: b8 57 9e 04 08 mov $0x8049e57,%eax
8048aa3: c7 44 24 04 03 00 00 movl $0x3,0x4(%esp)
8048aaa: 00
8048aab: 89 04 24 mov %eax,(%esp)
8048aae: e8 4d fa ff ff call 8048500
break;
8048ab3: eb 30 jmp 8048ae5
case EM_ARM:
printf("ARM (0x%x)\n", EM_ARM);
8048ab5: b8 69 9e 04 08 mov $0x8049e69,%eax
8048aba: c7 44 24 04 28 00 00 movl $0x28,0x4(%esp)
8048ac1: 00
8048ac2: 89 04 24 mov %eax,(%esp)
8048ac5: e8 36 fa ff ff call 8048500
break;
8048aca: eb 19 jmp 8048ae5
default:
printf("Machine\t= 0x%x\n", elf_header.e_machine);
8048acc: 0f b7 45 1a movzwl 0x1a(%ebp),%eax
8048ad0: 0f b7 d0 movzwl %ax,%edx
8048ad3: b8 75 9e 04 08 mov $0x8049e75,%eax
8048ad8: 89 54 24 04 mov %edx,0x4(%esp)
8048adc: 89 04 24 mov %eax,(%esp)
8048adf: e8 1c fa ff ff call 8048500
break;
8048ae4: 90 nop
}
/* Entry point */
printf("Entry point\t= 0x%08x\n", elf_header.e_entry);
8048ae5: 8b 55 20 mov 0x20(%ebp),%edx
8048ae8: b8 85 9e 04 08 mov $0x8049e85,%eax
8048aed: 89 54 24 04 mov %edx,0x4(%esp)
8048af1: 89 04 24 mov %eax,(%esp)
8048af4: e8 07 fa ff ff call 8048500
/* ELF header size in bytes */
printf("ELF header size\t= 0x%08x\n", elf_header.e_ehsize);
8048af9: 0f b7 45 30 movzwl 0x30(%ebp),%eax
8048afd: 0f b7 d0 movzwl %ax,%edx
8048b00: b8 9b 9e 04 08 mov $0x8049e9b,%eax
8048b05: 89 54 24 04 mov %edx,0x4(%esp)
8048b09: 89 04 24 mov %eax,(%esp)
8048b0c: e8 ef f9 ff ff call 8048500
/* Program Header */
printf("\nProgram Header\t= ");
8048b11: b8 b5 9e 04 08 mov $0x8049eb5,%eax
8048b16: 89 04 24 mov %eax,(%esp)
8048b19: e8 e2 f9 ff ff call 8048500
printf("0x%08x\n", elf_header.e_phoff); /* start */
8048b1e: 8b 55 24 mov 0x24(%ebp),%edx
8048b21: b8 c8 9e 04 08 mov $0x8049ec8,%eax
8048b26: 89 54 24 04 mov %edx,0x4(%esp)
8048b2a: 89 04 24 mov %eax,(%esp)
8048b2d: e8 ce f9 ff ff call 8048500
printf("\t\t %d entries\n", elf_header.e_phnum); /* num entry */
8048b32: 0f b7 45 34 movzwl 0x34(%ebp),%eax
8048b36: 0f b7 d0 movzwl %ax,%edx
8048b39: b8 d0 9e 04 08 mov $0x8049ed0,%eax
8048b3e: 89 54 24 04 mov %edx,0x4(%esp)
8048b42: 89 04 24 mov %eax,(%esp)
8048b45: e8 b6 f9 ff ff call 8048500
printf("\t\t %d bytes\n", elf_header.e_phentsize); /* size/entry */
8048b4a: 0f b7 45 32 movzwl 0x32(%ebp),%eax
8048b4e: 0f b7 d0 movzwl %ax,%edx
8048b51: b8 e0 9e 04 08 mov $0x8049ee0,%eax
8048b56: 89 54 24 04 mov %edx,0x4(%esp)
8048b5a: 89 04 24 mov %eax,(%esp)
8048b5d: e8 9e f9 ff ff call 8048500
/* Section header starts at */
printf("\nSection Header\t= ");
8048b62: b8 ee 9e 04 08 mov $0x8049eee,%eax
8048b67: 89 04 24 mov %eax,(%esp)
8048b6a: e8 91 f9 ff ff call 8048500
printf("0x%08x\n", elf_header.e_shoff); /* start */
8048b6f: 8b 55 28 mov 0x28(%ebp),%edx
8048b72: b8 c8 9e 04 08 mov $0x8049ec8,%eax
8048b77: 89 54 24 04 mov %edx,0x4(%esp)
8048b7b: 89 04 24 mov %eax,(%esp)
8048b7e: e8 7d f9 ff ff call 8048500
printf("\t\t %d entries\n", elf_header.e_shnum); /* num entry */
8048b83: 0f b7 45 38 movzwl 0x38(%ebp),%eax
8048b87: 0f b7 d0 movzwl %ax,%edx
8048b8a: b8 d0 9e 04 08 mov $0x8049ed0,%eax
8048b8f: 89 54 24 04 mov %edx,0x4(%esp)
8048b93: 89 04 24 mov %eax,(%esp)
8048b96: e8 65 f9 ff ff call 8048500
printf("\t\t %d bytes\n", elf_header.e_shentsize); /* size/entry */
8048b9b: 0f b7 45 36 movzwl 0x36(%ebp),%eax
8048b9f: 0f b7 d0 movzwl %ax,%edx
8048ba2: b8 e0 9e 04 08 mov $0x8049ee0,%eax
8048ba7: 89 54 24 04 mov %edx,0x4(%esp)
8048bab: 89 04 24 mov %eax,(%esp)
8048bae: e8 4d f9 ff ff call 8048500
printf("\t\t 0x%08x (string table offset)\n", elf_header.e_shstrndx);
8048bb3: 0f b7 45 3a movzwl 0x3a(%ebp),%eax
8048bb7: 0f b7 d0 movzwl %ax,%edx
8048bba: b8 04 9f 04 08 mov $0x8049f04,%eax
8048bbf: 89 54 24 04 mov %edx,0x4(%esp)
8048bc3: 89 04 24 mov %eax,(%esp)
8048bc6: e8 35 f9 ff ff call 8048500
/* File flags (Machine specific)*/
printf("\nFile flags \t= 0x%08x\n", elf_header.e_flags);
8048bcb: 8b 55 2c mov 0x2c(%ebp),%edx
8048bce: b8 26 9f 04 08 mov $0x8049f26,%eax
8048bd3: 89 54 24 04 mov %edx,0x4(%esp)
8048bd7: 89 04 24 mov %eax,(%esp)
8048bda: e8 21 f9 ff ff call 8048500
/* ELF file flags are machine specific.
* INTEL implements NO flags.
* ARM implements a few.
* Add support below to parse ELF file flags on ARM
*/
int32_t ef = elf_header.e_flags;
8048bdf: 8b 45 2c mov 0x2c(%ebp),%eax
8048be2: 89 45 f4 mov %eax,-0xc(%ebp)
printf("\t\t ");
8048be5: b8 3d 9f 04 08 mov $0x8049f3d,%eax
8048bea: 89 04 24 mov %eax,(%esp)
8048bed: e8 0e f9 ff ff call 8048500
if(ef & EF_ARM_RELEXEC)
8048bf2: 8b 45 f4 mov -0xc(%ebp),%eax
8048bf5: 83 e0 01 and $0x1,%eax
8048bf8: 84 c0 test %al,%al
8048bfa: 74 0d je 8048c09
printf(",RELEXEC ");
8048bfc: b8 42 9f 04 08 mov $0x8049f42,%eax
8048c01: 89 04 24 mov %eax,(%esp)
8048c04: e8 f7 f8 ff ff call 8048500
if(ef & EF_ARM_HASENTRY)
8048c09: 8b 45 f4 mov -0xc(%ebp),%eax
8048c0c: 83 e0 02 and $0x2,%eax
8048c0f: 85 c0 test %eax,%eax
8048c11: 74 0d je 8048c20
printf(",HASENTRY ");
8048c13: b8 4c 9f 04 08 mov $0x8049f4c,%eax
8048c18: 89 04 24 mov %eax,(%esp)
8048c1b: e8 e0 f8 ff ff call 8048500
if(ef & EF_ARM_INTERWORK)
8048c20: 8b 45 f4 mov -0xc(%ebp),%eax
8048c23: 83 e0 04 and $0x4,%eax
8048c26: 85 c0 test %eax,%eax
8048c28: 74 0d je 8048c37
printf(",INTERWORK ");
8048c2a: b8 57 9f 04 08 mov $0x8049f57,%eax
8048c2f: 89 04 24 mov %eax,(%esp)
8048c32: e8 c9 f8 ff ff call 8048500
if(ef & EF_ARM_APCS_26)
8048c37: 8b 45 f4 mov -0xc(%ebp),%eax
8048c3a: 83 e0 08 and $0x8,%eax
8048c3d: 85 c0 test %eax,%eax
8048c3f: 74 0d je 8048c4e
printf(",APCS_26 ");
8048c41: b8 63 9f 04 08 mov $0x8049f63,%eax
8048c46: 89 04 24 mov %eax,(%esp)
8048c49: e8 b2 f8 ff ff call 8048500
if(ef & EF_ARM_APCS_FLOAT)
8048c4e: 8b 45 f4 mov -0xc(%ebp),%eax
8048c51: 83 e0 10 and $0x10,%eax
8048c54: 85 c0 test %eax,%eax
8048c56: 74 0d je 8048c65
printf(",APCS_FLOAT ");
8048c58: b8 6d 9f 04 08 mov $0x8049f6d,%eax
8048c5d: 89 04 24 mov %eax,(%esp)
8048c60: e8 9b f8 ff ff call 8048500
if(ef & EF_ARM_PIC)
8048c65: 8b 45 f4 mov -0xc(%ebp),%eax
8048c68: 83 e0 20 and $0x20,%eax
8048c6b: 85 c0 test %eax,%eax
8048c6d: 74 0d je 8048c7c
printf(",PIC ");
8048c6f: b8 7a 9f 04 08 mov $0x8049f7a,%eax
8048c74: 89 04 24 mov %eax,(%esp)
8048c77: e8 84 f8 ff ff call 8048500
if(ef & EF_ARM_ALIGN8)
8048c7c: 8b 45 f4 mov -0xc(%ebp),%eax
8048c7f: 83 e0 40 and $0x40,%eax
8048c82: 85 c0 test %eax,%eax
8048c84: 74 0d je 8048c93
printf(",ALIGN8 ");
8048c86: b8 80 9f 04 08 mov $0x8049f80,%eax
8048c8b: 89 04 24 mov %eax,(%esp)
8048c8e: e8 6d f8 ff ff call 8048500
if(ef & EF_ARM_NEW_ABI)
8048c93: 8b 45 f4 mov -0xc(%ebp),%eax
8048c96: 25 80 00 00 00 and $0x80,%eax
8048c9b: 85 c0 test %eax,%eax
8048c9d: 74 0d je 8048cac
printf(",NEW_ABI ");
8048c9f: b8 89 9f 04 08 mov $0x8049f89,%eax
8048ca4: 89 04 24 mov %eax,(%esp)
8048ca7: e8 54 f8 ff ff call 8048500
if(ef & EF_ARM_OLD_ABI)
8048cac: 8b 45 f4 mov -0xc(%ebp),%eax
8048caf: 25 00 01 00 00 and $0x100,%eax
8048cb4: 85 c0 test %eax,%eax
8048cb6: 74 0d je 8048cc5
printf(",OLD_ABI ");
8048cb8: b8 93 9f 04 08 mov $0x8049f93,%eax
8048cbd: 89 04 24 mov %eax,(%esp)
8048cc0: e8 3b f8 ff ff call 8048500
if(ef & EF_ARM_SOFT_FLOAT)
8048cc5: 8b 45 f4 mov -0xc(%ebp),%eax
8048cc8: 25 00 02 00 00 and $0x200,%eax
8048ccd: 85 c0 test %eax,%eax
8048ccf: 74 0d je 8048cde
printf(",SOFT_FLOAT ");
8048cd1: b8 9d 9f 04 08 mov $0x8049f9d,%eax
8048cd6: 89 04 24 mov %eax,(%esp)
8048cd9: e8 22 f8 ff ff call 8048500
if(ef & EF_ARM_VFP_FLOAT)
8048cde: 8b 45 f4 mov -0xc(%ebp),%eax
8048ce1: 25 00 04 00 00 and $0x400,%eax
8048ce6: 85 c0 test %eax,%eax
8048ce8: 74 0d je 8048cf7
printf(",VFP_FLOAT ");
8048cea: b8 aa 9f 04 08 mov $0x8049faa,%eax
8048cef: 89 04 24 mov %eax,(%esp)
8048cf2: e8 09 f8 ff ff call 8048500
if(ef & EF_ARM_MAVERICK_FLOAT)
8048cf7: 8b 45 f4 mov -0xc(%ebp),%eax
8048cfa: 25 00 08 00 00 and $0x800,%eax
8048cff: 85 c0 test %eax,%eax
8048d01: 74 0d je 8048d10
printf(",MAVERICK_FLOAT ");
8048d03: b8 b6 9f 04 08 mov $0x8049fb6,%eax
8048d08: 89 04 24 mov %eax,(%esp)
8048d0b: e8 f0 f7 ff ff call 8048500
printf("\n");
8048d10: c7 04 24 0a 00 00 00 movl $0xa,(%esp)
8048d17: e8 b4 f8 ff ff call 80485d0
/* MSB of flags conatins ARM EABI version */
printf("ARM EABI\t= Version %d\n", (ef & EF_ARM_EABIMASK)>>24);
8048d1c: 8b 45 f4 mov -0xc(%ebp),%eax
8048d1f: 89 c2 mov %eax,%edx
8048d21: c1 ea 18 shr $0x18,%edx
8048d24: b8 c7 9f 04 08 mov $0x8049fc7,%eax
8048d29: 89 54 24 04 mov %edx,0x4(%esp)
8048d2d: 89 04 24 mov %eax,(%esp)
8048d30: e8 cb f7 ff ff call 8048500
printf("\n"); /* End of ELF header */
8048d35: c7 04 24 0a 00 00 00 movl $0xa,(%esp)
8048d3c: e8 8f f8 ff ff call 80485d0
}
8048d41: c9 leave
8048d42: c3 ret
08048d43 :
void read_section_header_table(int32_t fd, Elf32_Ehdr eh, Elf32_Shdr sh_table[])
{
8048d43: 55 push %ebp
8048d44: 89 e5 mov %esp,%ebp
8048d46: 83 ec 28 sub $0x28,%esp
uint32_t i;
assert(lseek(fd, (off_t)eh.e_shoff, SEEK_SET) == (off_t)eh.e_shoff);
8048d49: 8b 45 2c mov 0x2c(%ebp),%eax
8048d4c: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp)
8048d53: 00
8048d54: 89 44 24 04 mov %eax,0x4(%esp)
8048d58: 8b 45 08 mov 0x8(%ebp),%eax
8048d5b: 89 04 24 mov %eax,(%esp)
8048d5e: e8 bd f7 ff ff call 8048520
8048d63: 8b 55 2c mov 0x2c(%ebp),%edx
8048d66: 39 d0 cmp %edx,%eax
8048d68: 74 24 je 8048d8e
8048d6a: c7 44 24 0c 4a a3 04 movl $0x804a34a,0xc(%esp)
8048d71: 08
8048d72: c7 44 24 08 0c 01 00 movl $0x10c,0x8(%esp)
8048d79: 00
8048d7a: c7 44 24 04 00 9c 04 movl $0x8049c00,0x4(%esp)
8048d81: 08
8048d82: c7 04 24 e0 9f 04 08 movl $0x8049fe0,(%esp)
8048d89: e8 62 f8 ff ff call 80485f0
for(i=0; i