FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
elf-parser/hola/objdump-text.S at master · mincore/elf-parser · GitHub
mincore
/
elf-parser
Public
forked from
TheCodeArtist/elf-parser
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
elf-parser
/
hola
/
objdump-text.S
Copy path
More file actions
More file actions
Latest commit
History
History
History
2251 lines (2105 loc) · 98.6 KB
Breadcrumbs
elf-parser
/
hola
/
objdump-text.S
Copy path
File metadata and controls
2251 lines (2105 loc) · 98.6 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
elf-parser: file format elf32-i386
Disassembly of section
.init:
080484a4
<_init>
:
80484a4:
53
push
%ebx
80484a5:
83
ec
08
sub
$0x8
,
%esp
80484a8:
e8
00
00
00
00
call
80484ad
<_init+0x9>
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
<_init+0x1f>
80484be:
e8 ad
00
00
00
call
8048570
<__gmon_start__@plt>
80484c3:
e8 c8
01
00
00
call
8048690
<frame_dummy>
80484c8:
e8 e3
16
00
00
call
8049bb0
<__do_global_ctors_aux>
80484cd:
83
c4
08
add
$0x8
,
%esp
80484d0:
5b
pop
%ebx
80484d1:
c3
ret
Disassembly of section
.plt:
080484e0
<read@plt-0x10>
:
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
<read@plt>
:
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
<_init+0x3c>
08048500
<printf@plt>
:
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
<_init+0x3c>
08048510
<free@plt>
:
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
<_init+0x3c>
08048520
<lseek@plt>
:
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
<_init+0x3c>
08048530
<__stack_chk_fail@plt>
:
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
<_init+0x3c>
08048540
<realloc@plt>
:
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
<_init+0x3c>
08048550
<malloc@plt>
:
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
<_init+0x3c>
08048560
<puts@plt>
:
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
<_init+0x3c>
08048570
<__gmon_start__@plt>
:
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
<_init+0x3c>
08048580
<open@plt>
:
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
<_init+0x3c>
08048590
<getcwd@plt>
:
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
<_init+0x3c>
080485a0
<fsync@plt>
:
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
<_init+0x3c>
080485b0
<__libc_start_main@plt>
:
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
<_init+0x3c>
080485c0
<write@plt>
:
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
<_init+0x3c>
080485d0
<putchar@plt>
:
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
<_init+0x3c>
080485e0
<close@plt>
:
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
<_init+0x3c>
080485f0
<__assert_fail@plt>
:
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
<_init+0x3c>
Disassembly of section
.text:
08048600
<_start>
:
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
<__libc_start_main@plt>
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
<__do_global_dtors_aux>
:
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
<__do_global_dtors_aux+0x4f>
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
<__do_global_dtors_aux+0x48>
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
<__do_global_dtors_aux+0x30>
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
<frame_dummy>
:
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
<frame_dummy+0x21>
804869f:
b8
00
00
00
00
mov
$0x0
,
%eax
80486a4:
85
c0
test
%eax
,
%eax
80486a6:
74
09
je
80486b1
<frame_dummy+0x21>
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
<read_elf_header>
:
#define
debug(...) \
do { if (DEBUG) printf(
"<debug>:"
__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
<read_elf_header+0x30>
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_fail@plt>
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
<lseek@plt>
80486ff:
85
c0
test
%eax
,
%eax
8048701:
74
24
je
8048727
<read_elf_header+0x73>
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_fail@plt>
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
<read@plt>
8048741:
83
f8
34
cmp
$0x34
,
%eax
8048744:
74
24
je
804876a
<read_elf_header+0xb6>
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
<__assert_fail@plt>
}
804876a:
c9
leave
804876b:
c3
ret
0804876c
<is_ELF>
:
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
<is_ELF+0x41>
printf(
"ELFMAGIC \t= ELF\n"
);
804879a:
c7
04
24
98
9c
04
08
movl
$0x8049c98
,(
%esp
)
80487a1:
e8 ba fd ff ff
call
8048560
<puts@plt>
/* IS a ELF file */
return
1
;
80487a6:
b8
01
00
00
00
mov
$0x1
,
%eax
80487ab:
eb
11
jmp
80487be
<is_ELF+0x52>
} else {
printf(
"ELFMAGIC mismatch!\n"
);
80487ad:
c7
04
24
a8 9c
04
08
movl
$0x8049ca8
,(
%esp
)
80487b4:
e8 a7 fd ff ff
call
8048560
<puts@plt>
/* 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
<print_elf_header>
:
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
<printf@plt>
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
<print_elf_header+0x26>
80487e4:
83
f8
02
cmp
$0x2
,
%eax
80487e7:
74
10
je
80487f9
<print_elf_header+0x34>
80487e9:
eb 1c
jmp
8048807
<print_elf_header+0x42>
{
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
<puts@plt>
break;
80487f7:
eb 1b
jmp
8048814
<print_elf_header+0x4f>
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
<puts@plt>
break;
8048805:
eb 0d
jmp
8048814
<print_elf_header+0x4f>
default:
printf(
"INVALID CLASS\n"
);
8048807:
c7
04
24
ea 9c
04
08
movl
$0x8049cea
,(
%esp
)
804880e:
e8 4d fd ff ff
call
8048560
<puts@plt>
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
<printf@plt>
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
<print_elf_header+0x6f>
804882d:
83
f8
02
cmp
$0x2
,
%eax
8048830:
74
10
je
8048842
<print_elf_header+0x7d>
8048832:
eb 1c
jmp
8048850
<print_elf_header+0x8b>
{
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
<puts@plt>
break;
8048840:
eb 1b
jmp
804885d
<print_elf_header+0x98>
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
<puts@plt>
break;
804884e:
eb 0d
jmp
804885d
<print_elf_header+0x98>
default:
printf(
"INVALID Format\n"
);
8048850:
c7
04
24
40
9d
04
08
movl
$0x8049d40
,(
%esp
)
8048857:
e8
04
fd ff ff
call
8048560
<puts@plt>
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
<printf@plt>
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
<print_elf_header+0x19f>
804887a:
83
f8
08
cmp
$0x8
,
%eax
804887d:
7f
38
jg
80488b7
<print_elf_header+0xf2>
804887f:
83
f8
02
cmp
$0x2
,
%eax
8048882:
0f
84
98
00
00
00
je
8048920
<print_elf_header+0x15b>
8048888:
83
f8
02
cmp
$0x2
,
%eax
804888b:
7f 0e
jg
804889b
<print_elf_header+0xd6>
804888d:
85
c0
test
%eax
,
%eax
804888f:
74
6d
je
80488fe
<print_elf_header+0x139>
8048891:
83
f8
01
cmp
$0x1
,
%eax
8048894:
74
79
je
804890f
<print_elf_header+0x14a>
8048896:
e9
39
01
00
00
jmp
80489d4
<print_elf_header+0x20f>
804889b:
83
f8
06
cmp
$0x6
,
%eax
804889e:
0f
84
9e
00
00
00
je
8048942
<print_elf_header+0x17d>
80488a4:
83
f8
06
cmp
$0x6
,
%eax
80488a7:
0f 8f a6
00
00
00
jg
8048953
<print_elf_header+0x18e>
80488ad:
83
f8
03
cmp
$0x3
,
%eax
80488b0:
74
7f
je
8048931
<print_elf_header+0x16c>
80488b2:
e9 1d
01
00
00
jmp
80489d4
<print_elf_header+0x20f>
80488b7:
83
f8 0c
cmp
$0xc
,
%eax
80488ba:
0f
84
dc
00
00
00
je
804899c
<print_elf_header+0x1d7>
80488c0:
83
f8 0c
cmp
$0xc
,
%eax
80488c3:
7f
17
jg
80488dc
<print_elf_header+0x117>
80488c5:
83
f8 0a
cmp
$0xa
,
%eax
80488c8:
0f
84
b2
00
00
00
je
8048980
<print_elf_header+0x1bb>
80488ce:
83
f8 0a
cmp
$0xa
,
%eax
80488d1:
0f 8f b7
00
00
00
jg
804898e
<print_elf_header+0x1c9>
80488d7:
e9
96
00
00
00
jmp
8048972
<print_elf_header+0x1ad>
80488dc:
83
f8
61
cmp
$0x61
,
%eax
80488df:
0f
84
d3
00
00
00
je
80489b8
<print_elf_header+0x1f3>
80488e5:
3d ff
00
00
00
cmp
$0xff
,
%eax
80488ea:
0f
84
d6
00
00
00
je
80489c6
<print_elf_header+0x201>
80488f0:
83
f8
40
cmp
$0x40
,
%eax
80488f3:
0f
84
b1
00
00
00
je
80489aa
<print_elf_header+0x1e5>
80488f9:
e9 d6
00
00
00
jmp
80489d4
<print_elf_header+0x20f>
{
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
<puts@plt>
break;
804890a:
e9 de
00
00
00
jmp
80489ed
<print_elf_header+0x228>
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
<puts@plt>
break;
804891b:
e9 cd
00
00
00
jmp
80489ed
<print_elf_header+0x228>
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
<puts@plt>
break;
804892c:
e9 bc
00
00
00
jmp
80489ed
<print_elf_header+0x228>
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
<puts@plt>
break;
804893d:
e9 ab
00
00
00
jmp
80489ed
<print_elf_header+0x228>
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
<puts@plt>
break;
804894e:
e9 9a
00
00
00
jmp
80489ed
<print_elf_header+0x228>
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
<puts@plt>
break;
804895f:
e9
89
00
00
00
jmp
80489ed
<print_elf_header+0x228>
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
<puts@plt>
break;
8048970:
eb 7b
jmp
80489ed
<print_elf_header+0x228>
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
<puts@plt>
break;
804897e:
eb 6d
jmp
80489ed
<print_elf_header+0x228>
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
<puts@plt>
break;
804898c:
eb 5f
jmp
80489ed
<print_elf_header+0x228>
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
<puts@plt>
break;
804899a:
eb
51
jmp
80489ed
<print_elf_header+0x228>
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
<puts@plt>
break;
80489a8:
eb
43
jmp
80489ed
<print_elf_header+0x228>
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
<puts@plt>
break;
80489b6:
eb
35
jmp
80489ed
<print_elf_header+0x228>
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
<puts@plt>
break;
80489c4:
eb
27
jmp
80489ed
<print_elf_header+0x228>
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
<puts@plt>
break;
80489d2:
eb
19
jmp
80489ed
<print_elf_header+0x228>
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
<printf@plt>
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
<printf@plt>
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
<print_elf_header+0x266>
8048a06:
83
f8
01
cmp
$0x1
,
%eax
8048a09:
7f
06
jg
8048a11
<print_elf_header+0x24c>
8048a0b:
85
c0
test
%eax
,
%eax
8048a0d:
74
0e
je
8048a1d
<print_elf_header+0x258>
8048a0f:
eb
44
jmp
8048a55
<print_elf_header+0x290>
8048a11:
83
f8
02
cmp
$0x2
,
%eax
8048a14:
74
23
je
8048a39
<print_elf_header+0x274>
8048a16:
83
f8
03
cmp
$0x3
,
%eax
8048a19:
74
2c
je
8048a47
<print_elf_header+0x282>
8048a1b:
eb
38
jmp
8048a55
<print_elf_header+0x290>
{
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
<puts@plt>
break;
8048a29:
eb
43
jmp
8048a6e
<print_elf_header+0x2a9>
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
<puts@plt>
break;
8048a37:
eb
35
jmp
8048a6e
<print_elf_header+0x2a9>
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
<puts@plt>
break;
8048a45:
eb
27
jmp
8048a6e
<print_elf_header+0x2a9>
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
<puts@plt>
break;
8048a53:
eb
19
jmp
8048a6e
<print_elf_header+0x2a9>
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
<printf@plt>
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
<printf@plt>
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
<print_elf_header+0x2d9>
8048a87:
83
f8
28
cmp
$0x28
,
%eax
8048a8a:
74
29
je
8048ab5
<print_elf_header+0x2f0>
8048a8c:
85
c0
test
%eax
,
%eax
8048a8e:
75
3c
jne
8048acc
<print_elf_header+0x307>
{
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
<puts@plt>
break;
8048a9c:
eb
47
jmp
8048ae5
<print_elf_header+0x320>
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
<printf@plt>
break;
8048ab3:
eb
30
jmp
8048ae5
<print_elf_header+0x320>
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
<printf@plt>
break;
8048aca:
eb
19
jmp
8048ae5
<print_elf_header+0x320>
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
<printf@plt>
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
<printf@plt>
/* 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
<printf@plt>
/* 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@plt>
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@plt>
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@plt>
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
<printf@plt>
/* 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@plt>
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@plt>
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@plt>
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@plt>
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
<printf@plt>
/* 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
<printf@plt>
/* 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
<printf@plt>
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
<print_elf_header+0x444>
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
<printf@plt>
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
<print_elf_header+0x45b>
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
<printf@plt>
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
<print_elf_header+0x472>
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
<printf@plt>
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
<print_elf_header+0x489>
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
<printf@plt>
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
<print_elf_header+0x4a0>
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
<printf@plt>
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
<print_elf_header+0x4b7>
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
<printf@plt>
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
<print_elf_header+0x4ce>
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
<printf@plt>
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
<print_elf_header+0x4e7>
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
<printf@plt>
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
<print_elf_header+0x500>
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
<printf@plt>
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
<print_elf_header+0x519>
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
<printf@plt>
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
<print_elf_header+0x532>
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
<printf@plt>
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
<print_elf_header+0x54b>
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@plt>
printf(
"\n"
);
8048d10:
c7
04
24
0a
00
00
00
movl
$0xa
,(
%esp
)
8048d17:
e8 b4 f8 ff ff
call
80485d0
<putchar@plt>
/* 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@plt>
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
<putchar@plt>
}
8048d41:
c9
leave
8048d42:
c3
ret
08048d43
<read_section_header_table>
:
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
<lseek@plt>
8048d63:
8b
55
2c
mov
0x2c
(
%ebp
),
%edx
8048d66:
39
d0
cmp
%edx
,
%eax
8048d68:
74
24
je
8048d8e
<read_section_header_table+0x4b>
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
<__assert_fail@plt>
for(
i
=
0
; i<eh.e_shnum; i++) {
8048d8e:
c7
45
f4
00
00
00
00
movl
$0x0
,
-0xc
(
%ebp
)
8048d95:
eb 5d
jmp
8048df4
<read_section_header_table+0xb1>
assert(read(fd, (void *)&sh_table[i], eh.e_shentsize)
8048d97:
0f b7
45
3a
movzwl
0x3a
(
%ebp
),
%eax
8048d9b:
0f b7 c8
movzwl
%ax
,
%ecx
8048d9e:
8b
55
f4
mov
-0xc
(
%ebp
),
%edx
8048da1:
89
d0
mov
%edx
,
%eax
8048da3:
c1 e0
02
shl
$0x2
,
%eax
8048da6:
01
d0
add
%edx
,
%eax
8048da8:
c1 e0
03
shl
$0x3
,
%eax
8048dab:
03
45
40
add
0x40
(
%ebp
),
%eax
8048dae:
89
4c
24
08
mov
%ecx
,
0x8
(
%esp
)
8048db2:
89
44
24
04
mov
%eax
,
0x4
(
%esp
)
8048db6:
8b
45
08
mov
0x8
(
%ebp
),
%eax
8048db9:
89
04
24
mov
%eax
,(
%esp
)
8048dbc:
e8 2f f7 ff ff
call
80484f0
<read@plt>
8048dc1:
0f b7
55
3a
movzwl
0x3a
(
%ebp
),
%edx
8048dc5:
0f b7 d2
movzwl
%dx
,
%edx
8048dc8:
39
d0
cmp
%edx
,
%eax
8048dca:
74
24
je
8048df0
<read_section_header_table+0xad>
8048dcc:
c7
44
24
0c 4a a3
04
movl
$0x804a34a
,
0xc
(
%esp
)
8048dd3:
08
8048dd4:
c7
44
24
08
10
01
00
movl
$0x110
,
0x8
(
%esp
)
8048ddb:
00
8048ddc:
c7
44
24
04
00
9c
04
movl
$0x8049c00
,
0x4
(
%esp
)
8048de3:
08
8048de4:
c7
04
24
18
a0
04
08
movl
$0x804a018
,(
%esp
)
8048deb:
e8
00
f8 ff ff
call
80485f0
<__assert_fail@plt>
{
uint32_t i;
assert(lseek(fd, (off_t)eh.e_shoff, SEEK_SET) == (off_t)eh.e_shoff);
for(
i
=
0
; i<eh.e_shnum; i++) {
8048df0:
83
45
f4
01
addl
$0x1
,
-0xc
(
%ebp
)
8048df4:
0f b7
45
3c
movzwl
0x3c
(
%ebp
),
%eax
8048df8:
0f b7 c0
movzwl
%ax
,
%eax
8048dfb:
3b
45
f4
cmp
-0xc
(
%ebp
),
%eax
8048dfe:
77
97
ja
8048d97
<read_section_header_table+0x54>
assert(read(fd, (void *)&sh_table[i], eh.e_shentsize)
== eh.e_shentsize);
}
}
8048e00:
c9
leave
8048e01:
c3
ret
08048e02
<read_section>
:
char * read_section(int32_t fd, Elf32_Shdr sh)
{
8048e02:
55
push
%ebp
8048e03:
89
e5
mov
%esp
,
%ebp
8048e05:
83
ec
28
sub
$0x28
,
%esp
char*
buff
=
malloc(sh.sh_size);
8048e08:
8b
45
20
mov
0x20
(
%ebp
),
%eax
8048e0b:
89
04
24
mov
%eax
,(
%esp
)
8048e0e:
e8 3d f7 ff ff
call
8048550
<malloc@plt>
8048e13:
89
45
f4
mov
%eax
,
-0xc
(
%ebp
)
if(!buff) {
8048e16:
83
7d f4
00
cmpl
$0x0
,
-0xc
(
%ebp
)
8048e1a:
75
1c
jne
8048e38
<read_section+0x36>
printf(
"%s:Failed to allocate %dbytes\n"
,
8048e1c:
8b
55
20
mov
0x20
(
%ebp
),
%edx
8048e1f:
b8 5c a0
04
08
mov
$0x804a05c
,
%eax
8048e24:
89
54
24
08
mov
%edx
,
0x8
(
%esp
)
8048e28:
c7
44
24
04
30
a3
04
movl
$0x804a330
,
0x4
(
%esp
)
8048e2f:
08
8048e30:
89
04
24
mov
%eax
,(
%esp
)
8048e33:
e8 c8 f6 ff ff
call
8048500
<printf@plt>
__func__, sh.sh_size);
}
assert(buff != NULL);
8048e38:
83
7d f4
00
cmpl
$0x0
,
-0xc
(
%ebp
)
8048e3c:
75
24
jne
8048e62
<read_section+0x60>
8048e3e:
c7
44
24
0c 3d a3
04
movl
$0x804a33d
,
0xc
(
%esp
)
8048e45:
08
8048e46:
c7
44
24
08
1d
01
00
movl
$0x11d
,
0x8
(
%esp
)
View remainder of file in raw view
Back
|
FazBrowse Home
|
New Git URL