-
Notifications
You must be signed in to change notification settings - Fork 1
/
log
3928 lines (3689 loc) · 173 KB
/
log
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
build/rabbit-x86_64_dynamic: file format elf64-x86-64
Disassembly of section .text:
0000000000003760 <_start>:
3760: f3 0f 1e fa endbr64
3764: 31 ed xor %ebp,%ebp
3766: 49 89 d1 mov %rdx,%r9
3769: 5e pop %rsi
376a: 48 89 e2 mov %rsp,%rdx
376d: 48 83 e4 f0 and $0xfffffffffffffff0,%rsp
3771: 50 push %rax
3772: 54 push %rsp
3773: 4c 8d 05 86 2b 00 00 lea 0x2b86(%rip),%r8 # 6300 <__libc_csu_fini>
377a: 48 8d 0d 0f 2b 00 00 lea 0x2b0f(%rip),%rcx # 6290 <__libc_csu_init>
3781: 48 8d 3d d0 09 00 00 lea 0x9d0(%rip),%rdi # 4158 <main>
3788: ff 15 52 68 00 00 callq *0x6852(%rip) # 9fe0 <__libc_start_main@GLIBC_2.2.5>
378e: f4 hlt
378f: 90 nop
0000000000003790 <deregister_tm_clones>:
3790: 48 8d 3d a9 78 00 00 lea 0x78a9(%rip),%rdi # b040 <stdout@@GLIBC_2.2.5>
3797: 48 8d 05 a2 78 00 00 lea 0x78a2(%rip),%rax # b040 <stdout@@GLIBC_2.2.5>
379e: 48 39 f8 cmp %rdi,%rax
37a1: 74 15 je 37b8 <deregister_tm_clones+0x28>
37a3: 48 8b 05 2e 68 00 00 mov 0x682e(%rip),%rax # 9fd8 <_ITM_deregisterTMCloneTable>
37aa: 48 85 c0 test %rax,%rax
37ad: 74 09 je 37b8 <deregister_tm_clones+0x28>
37af: ff e0 jmpq *%rax
37b1: 0f 1f 80 00 00 00 00 nopl 0x0(%rax)
37b8: c3 retq
37b9: 0f 1f 80 00 00 00 00 nopl 0x0(%rax)
00000000000037c0 <register_tm_clones>:
37c0: 48 8d 3d 79 78 00 00 lea 0x7879(%rip),%rdi # b040 <stdout@@GLIBC_2.2.5>
37c7: 48 8d 35 72 78 00 00 lea 0x7872(%rip),%rsi # b040 <stdout@@GLIBC_2.2.5>
37ce: 48 29 fe sub %rdi,%rsi
37d1: 48 89 f0 mov %rsi,%rax
37d4: 48 c1 ee 3f shr $0x3f,%rsi
37d8: 48 c1 f8 03 sar $0x3,%rax
37dc: 48 01 c6 add %rax,%rsi
37df: 48 d1 fe sar %rsi
37e2: 74 14 je 37f8 <register_tm_clones+0x38>
37e4: 48 8b 05 05 68 00 00 mov 0x6805(%rip),%rax # 9ff0 <_ITM_registerTMCloneTable>
37eb: 48 85 c0 test %rax,%rax
37ee: 74 08 je 37f8 <register_tm_clones+0x38>
37f0: ff e0 jmpq *%rax
37f2: 66 0f 1f 44 00 00 nopw 0x0(%rax,%rax,1)
37f8: c3 retq
37f9: 0f 1f 80 00 00 00 00 nopl 0x0(%rax)
0000000000003800 <__do_global_dtors_aux>:
3800: f3 0f 1e fa endbr64
3804: 80 3d 5d 78 00 00 00 cmpb $0x0,0x785d(%rip) # b068 <completed.8061>
380b: 75 2b jne 3838 <__do_global_dtors_aux+0x38>
380d: 55 push %rbp
380e: 48 83 3d e2 67 00 00 cmpq $0x0,0x67e2(%rip) # 9ff8 <__cxa_finalize@GLIBC_2.2.5>
3815: 00
3816: 48 89 e5 mov %rsp,%rbp
3819: 74 0c je 3827 <__do_global_dtors_aux+0x27>
381b: 48 8b 3d e6 67 00 00 mov 0x67e6(%rip),%rdi # a008 <__dso_handle>
3822: e8 99 fb ff ff callq 33c0 <__cxa_finalize@plt>
3827: e8 64 ff ff ff callq 3790 <deregister_tm_clones>
382c: c6 05 35 78 00 00 01 movb $0x1,0x7835(%rip) # b068 <completed.8061>
3833: 5d pop %rbp
3834: c3 retq
3835: 0f 1f 00 nopl (%rax)
3838: c3 retq
3839: 0f 1f 80 00 00 00 00 nopl 0x0(%rax)
0000000000003840 <frame_dummy>:
3840: f3 0f 1e fa endbr64
3844: e9 77 ff ff ff jmpq 37c0 <register_tm_clones>
0000000000003849 <__bswap_16>:
#define __bswap_constant_16(x) \
((__uint16_t) ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8)))
static __inline __uint16_t
__bswap_16 (__uint16_t __bsx)
{
3849: 55 push %rbp
384a: 48 89 e5 mov %rsp,%rbp
384d: 89 f8 mov %edi,%eax
384f: 66 89 45 fc mov %ax,-0x4(%rbp)
#if __GNUC_PREREQ (4, 8)
return __builtin_bswap16 (__bsx);
3853: 0f b7 45 fc movzwl -0x4(%rbp),%eax
3857: 66 c1 c0 08 rol $0x8,%ax
#else
return __bswap_constant_16 (__bsx);
#endif
}
385b: 5d pop %rbp
385c: c3 retq
000000000000385d <print_stacktrace>:
//prints formated stack trace with most information as possible
//parameter indicates if the function is called by the signal handler or not
//(to hide the call to the signal handler)
void print_stacktrace(int calledFromSigInt)
{
385d: f3 0f 1e fa endbr64
3861: 55 push %rbp
3862: 48 89 e5 mov %rsp,%rbp
3865: 48 81 ec 30 02 00 00 sub $0x230,%rsp
386c: 89 bd dc fd ff ff mov %edi,-0x224(%rbp)
3872: 64 48 8b 04 25 28 00 mov %fs:0x28,%rax
3879: 00 00
387b: 48 89 45 f8 mov %rax,-0x8(%rbp)
387f: 31 c0 xor %eax,%eax
void* buffer[MAX_BACKTRACE_LINES];
char** strings;
int nptrs = backtrace(buffer, MAX_BACKTRACE_LINES);
3881: 48 8d 85 f0 fd ff ff lea -0x210(%rbp),%rax
3888: be 40 00 00 00 mov $0x40,%esi
388d: 48 89 c7 mov %rax,%rdi
3890: e8 3b fc ff ff callq 34d0 <backtrace@plt>
3895: 89 85 e4 fd ff ff mov %eax,-0x21c(%rbp)
strings = backtrace_symbols(buffer, nptrs);
389b: 8b 95 e4 fd ff ff mov -0x21c(%rbp),%edx
38a1: 48 8d 85 f0 fd ff ff lea -0x210(%rbp),%rax
38a8: 89 d6 mov %edx,%esi
38aa: 48 89 c7 mov %rax,%rdi
38ad: e8 be fb ff ff callq 3470 <backtrace_symbols@plt>
38b2: 48 89 85 e8 fd ff ff mov %rax,-0x218(%rbp)
if(strings == NULL)
38b9: 48 83 bd e8 fd ff ff cmpq $0x0,-0x218(%rbp)
38c0: 00
38c1: 75 16 jne 38d9 <print_stacktrace+0x7c>
{
perror("backtrace_symbols");
38c3: 48 8d 3d 3e 37 00 00 lea 0x373e(%rip),%rdi # 7008 <_IO_stdin_used+0x8>
38ca: e8 f1 fd ff ff callq 36c0 <perror@plt>
exit(EXIT_FAILURE);
38cf: bf 01 00 00 00 mov $0x1,%edi
38d4: e8 47 fe ff ff callq 3720 <exit@plt>
}
unsigned int i = 1;
38d9: c7 85 e0 fd ff ff 01 movl $0x1,-0x220(%rbp)
38e0: 00 00 00
if(calledFromSigInt != 0)
38e3: 83 bd dc fd ff ff 00 cmpl $0x0,-0x224(%rbp)
38ea: 0f 84 92 00 00 00 je 3982 <print_stacktrace+0x125>
++i;
38f0: 83 85 e0 fd ff ff 01 addl $0x1,-0x220(%rbp)
for(; i < (unsigned int) (nptrs-2); ++i)
38f7: e9 86 00 00 00 jmpq 3982 <print_stacktrace+0x125>
{
//if addr2line failed, print what we can
if(addr2line(_programName, buffer[i], nptrs-2-i-1) != 0)
38fc: 8b 85 e4 fd ff ff mov -0x21c(%rbp),%eax
3902: 2b 85 e0 fd ff ff sub -0x220(%rbp),%eax
3908: 83 e8 03 sub $0x3,%eax
390b: 89 c2 mov %eax,%edx
390d: 8b 85 e0 fd ff ff mov -0x220(%rbp),%eax
3913: 48 8b 8c c5 f0 fd ff mov -0x210(%rbp,%rax,8),%rcx
391a: ff
391b: 48 8b 05 4e 77 00 00 mov 0x774e(%rip),%rax # b070 <_programName>
3922: 48 89 ce mov %rcx,%rsi
3925: 48 89 c7 mov %rax,%rdi
3928: e8 55 02 00 00 callq 3b82 <addr2line>
392d: 85 c0 test %eax,%eax
392f: 74 4a je 397b <print_stacktrace+0x11e>
fprintf(stderr, "[%i] %s\n", nptrs-2-i-1, strings[i]);
3931: 8b 85 e0 fd ff ff mov -0x220(%rbp),%eax
3937: 48 8d 14 c5 00 00 00 lea 0x0(,%rax,8),%rdx
393e: 00
393f: 48 8b 85 e8 fd ff ff mov -0x218(%rbp),%rax
3946: 48 01 d0 add %rdx,%rax
3949: 48 8b 10 mov (%rax),%rdx
394c: 8b 85 e4 fd ff ff mov -0x21c(%rbp),%eax
3952: 2b 85 e0 fd ff ff sub -0x220(%rbp),%eax
3958: 8d 70 fd lea -0x3(%rax),%esi
395b: 48 8b 05 fe 76 00 00 mov 0x76fe(%rip),%rax # b060 <stderr@@GLIBC_2.2.5>
3962: 48 89 d1 mov %rdx,%rcx
3965: 89 f2 mov %esi,%edx
3967: 48 8d 35 ac 36 00 00 lea 0x36ac(%rip),%rsi # 701a <_IO_stdin_used+0x1a>
396e: 48 89 c7 mov %rax,%rdi
3971: b8 00 00 00 00 mov $0x0,%eax
3976: e8 65 fc ff ff callq 35e0 <fprintf@plt>
for(; i < (unsigned int) (nptrs-2); ++i)
397b: 83 85 e0 fd ff ff 01 addl $0x1,-0x220(%rbp)
3982: 8b 85 e4 fd ff ff mov -0x21c(%rbp),%eax
3988: 83 e8 02 sub $0x2,%eax
398b: 39 85 e0 fd ff ff cmp %eax,-0x220(%rbp)
3991: 0f 82 65 ff ff ff jb 38fc <print_stacktrace+0x9f>
}
free(strings);
3997: 48 8b 85 e8 fd ff ff mov -0x218(%rbp),%rax
399e: 48 89 c7 mov %rax,%rdi
39a1: e8 3a fa ff ff callq 33e0 <free@plt>
}
39a6: 90 nop
39a7: 48 8b 45 f8 mov -0x8(%rbp),%rax
39ab: 64 48 33 04 25 28 00 xor %fs:0x28,%rax
39b2: 00 00
39b4: 74 05 je 39bb <print_stacktrace+0x15e>
39b6: e8 25 fb ff ff callq 34e0 <__stack_chk_fail@plt>
39bb: c9 leaveq
39bc: c3 retq
00000000000039bd <posix_signal_handler>:
void posix_signal_handler(int sig)
{
39bd: f3 0f 1e fa endbr64
39c1: 55 push %rbp
39c2: 48 89 e5 mov %rsp,%rbp
39c5: 48 83 ec 10 sub $0x10,%rsp
39c9: 89 7d fc mov %edi,-0x4(%rbp)
print_stacktrace(1);
39cc: bf 01 00 00 00 mov $0x1,%edi
39d1: e8 87 fe ff ff callq 385d <print_stacktrace>
39d6: 83 7d fc 0b cmpl $0xb,-0x4(%rbp)
39da: 0f 87 d4 00 00 00 ja 3ab4 <posix_signal_handler+0xf7>
39e0: 8b 45 fc mov -0x4(%rbp),%eax
39e3: 48 8d 14 85 00 00 00 lea 0x0(,%rax,4),%rdx
39ea: 00
39eb: 48 8d 05 7e 37 00 00 lea 0x377e(%rip),%rax # 7170 <_IO_stdin_used+0x170>
39f2: 8b 04 02 mov (%rdx,%rax,1),%eax
39f5: 48 98 cltq
39f7: 48 8d 15 72 37 00 00 lea 0x3772(%rip),%rdx # 7170 <_IO_stdin_used+0x170>
39fe: 48 01 d0 add %rdx,%rax
3a01: 3e ff e0 notrack jmpq *%rax
switch(sig)
{
case SIGABRT:
fputs("Caught SIGABRT: usually caused by an abort() or assert()\n", stderr);
3a04: 48 8b 05 55 76 00 00 mov 0x7655(%rip),%rax # b060 <stderr@@GLIBC_2.2.5>
3a0b: 48 89 c1 mov %rax,%rcx
3a0e: ba 39 00 00 00 mov $0x39,%edx
3a13: be 01 00 00 00 mov $0x1,%esi
3a18: 48 8d 3d 09 36 00 00 lea 0x3609(%rip),%rdi # 7028 <_IO_stdin_used+0x28>
3a1f: e8 0c fd ff ff callq 3730 <fwrite@plt>
break;
3a24: e9 ac 00 00 00 jmpq 3ad5 <posix_signal_handler+0x118>
case SIGFPE:
fputs("Caught SIGFPE: arithmetic exception, such as divide by zero\n", stderr);
3a29: 48 8b 05 30 76 00 00 mov 0x7630(%rip),%rax # b060 <stderr@@GLIBC_2.2.5>
3a30: 48 89 c1 mov %rax,%rcx
3a33: ba 3c 00 00 00 mov $0x3c,%edx
3a38: be 01 00 00 00 mov $0x1,%esi
3a3d: 48 8d 3d 24 36 00 00 lea 0x3624(%rip),%rdi # 7068 <_IO_stdin_used+0x68>
3a44: e8 e7 fc ff ff callq 3730 <fwrite@plt>
break;
3a49: e9 87 00 00 00 jmpq 3ad5 <posix_signal_handler+0x118>
case SIGILL:
fputs("Caught SIGILL: illegal instruction\n", stderr);
3a4e: 48 8b 05 0b 76 00 00 mov 0x760b(%rip),%rax # b060 <stderr@@GLIBC_2.2.5>
3a55: 48 89 c1 mov %rax,%rcx
3a58: ba 23 00 00 00 mov $0x23,%edx
3a5d: be 01 00 00 00 mov $0x1,%esi
3a62: 48 8d 3d 3f 36 00 00 lea 0x363f(%rip),%rdi # 70a8 <_IO_stdin_used+0xa8>
3a69: e8 c2 fc ff ff callq 3730 <fwrite@plt>
break;
3a6e: eb 65 jmp 3ad5 <posix_signal_handler+0x118>
case SIGINT:
fputs("Caught SIGINT: interactive attention signal, probably a ctrl+c\n", stderr);
3a70: 48 8b 05 e9 75 00 00 mov 0x75e9(%rip),%rax # b060 <stderr@@GLIBC_2.2.5>
3a77: 48 89 c1 mov %rax,%rcx
3a7a: ba 3f 00 00 00 mov $0x3f,%edx
3a7f: be 01 00 00 00 mov $0x1,%esi
3a84: 48 8d 3d 45 36 00 00 lea 0x3645(%rip),%rdi # 70d0 <_IO_stdin_used+0xd0>
3a8b: e8 a0 fc ff ff callq 3730 <fwrite@plt>
break;
3a90: eb 43 jmp 3ad5 <posix_signal_handler+0x118>
case SIGSEGV:
fputs("Caught SIGSEGV: segfault\n", stderr);
3a92: 48 8b 05 c7 75 00 00 mov 0x75c7(%rip),%rax # b060 <stderr@@GLIBC_2.2.5>
3a99: 48 89 c1 mov %rax,%rcx
3a9c: ba 19 00 00 00 mov $0x19,%edx
3aa1: be 01 00 00 00 mov $0x1,%esi
3aa6: 48 8d 3d 63 36 00 00 lea 0x3663(%rip),%rdi # 7110 <_IO_stdin_used+0x110>
3aad: e8 7e fc ff ff callq 3730 <fwrite@plt>
break;
3ab2: eb 21 jmp 3ad5 <posix_signal_handler+0x118>
case SIGTERM:
default:
fputs("Caught SIGTERM: a termination request was sent to the program\n", stderr);
3ab4: 48 8b 05 a5 75 00 00 mov 0x75a5(%rip),%rax # b060 <stderr@@GLIBC_2.2.5>
3abb: 48 89 c1 mov %rax,%rcx
3abe: ba 3e 00 00 00 mov $0x3e,%edx
3ac3: be 01 00 00 00 mov $0x1,%esi
3ac8: 48 8d 3d 61 36 00 00 lea 0x3661(%rip),%rdi # 7130 <_IO_stdin_used+0x130>
3acf: e8 5c fc ff ff callq 3730 <fwrite@plt>
break;
3ad4: 90 nop
}
_Exit(EXIT_FAILURE);
3ad5: bf 01 00 00 00 mov $0x1,%edi
3ada: e8 61 fc ff ff callq 3740 <_Exit@plt>
0000000000003adf <set_signal_handler>:
}
void set_signal_handler(sig_t handler)
{
3adf: f3 0f 1e fa endbr64
3ae3: 55 push %rbp
3ae4: 48 89 e5 mov %rsp,%rbp
3ae7: 48 83 ec 10 sub $0x10,%rsp
3aeb: 48 89 7d f8 mov %rdi,-0x8(%rbp)
signal(SIGABRT, handler);
3aef: 48 8b 45 f8 mov -0x8(%rbp),%rax
3af3: 48 89 c6 mov %rax,%rsi
3af6: bf 06 00 00 00 mov $0x6,%edi
3afb: e8 d0 fa ff ff callq 35d0 <signal@plt>
signal(SIGFPE, handler);
3b00: 48 8b 45 f8 mov -0x8(%rbp),%rax
3b04: 48 89 c6 mov %rax,%rsi
3b07: bf 08 00 00 00 mov $0x8,%edi
3b0c: e8 bf fa ff ff callq 35d0 <signal@plt>
signal(SIGILL, handler);
3b11: 48 8b 45 f8 mov -0x8(%rbp),%rax
3b15: 48 89 c6 mov %rax,%rsi
3b18: bf 04 00 00 00 mov $0x4,%edi
3b1d: e8 ae fa ff ff callq 35d0 <signal@plt>
signal(SIGINT, handler);
3b22: 48 8b 45 f8 mov -0x8(%rbp),%rax
3b26: 48 89 c6 mov %rax,%rsi
3b29: bf 02 00 00 00 mov $0x2,%edi
3b2e: e8 9d fa ff ff callq 35d0 <signal@plt>
signal(SIGSEGV, handler);
3b33: 48 8b 45 f8 mov -0x8(%rbp),%rax
3b37: 48 89 c6 mov %rax,%rsi
3b3a: bf 0b 00 00 00 mov $0xb,%edi
3b3f: e8 8c fa ff ff callq 35d0 <signal@plt>
signal(SIGTERM, handler);
3b44: 48 8b 45 f8 mov -0x8(%rbp),%rax
3b48: 48 89 c6 mov %rax,%rsi
3b4b: bf 0f 00 00 00 mov $0xf,%edi
3b50: e8 7b fa ff ff callq 35d0 <signal@plt>
}
3b55: 90 nop
3b56: c9 leaveq
3b57: c3 retq
0000000000003b58 <init_exceptions>:
//lib activation, first thing to do in main
//programName should be argv[0]
void init_exceptions(char* programName)
{
3b58: f3 0f 1e fa endbr64
3b5c: 55 push %rbp
3b5d: 48 89 e5 mov %rsp,%rbp
3b60: 48 83 ec 10 sub $0x10,%rsp
3b64: 48 89 7d f8 mov %rdi,-0x8(%rbp)
set_signal_handler(posix_signal_handler);
3b68: 48 8d 3d 4e fe ff ff lea -0x1b2(%rip),%rdi # 39bd <posix_signal_handler>
3b6f: e8 6b ff ff ff callq 3adf <set_signal_handler>
_programName = programName;
3b74: 48 8b 45 f8 mov -0x8(%rbp),%rax
3b78: 48 89 05 f1 74 00 00 mov %rax,0x74f1(%rip) # b070 <_programName>
}
3b7f: 90 nop
3b80: c9 leaveq
3b81: c3 retq
0000000000003b82 <addr2line>:
/* Resolve symbol name and source location given the path to the executable
and an address */
//returns 0 if address has been resolved and a message has been printed; else returns 1
int addr2line(char const * const program_name, void const * const addr, int lineNb)
{
3b82: f3 0f 1e fa endbr64
3b86: 55 push %rbp
3b87: 48 89 e5 mov %rsp,%rbp
3b8a: 48 81 ec 60 0a 00 00 sub $0xa60,%rsp
3b91: 48 89 bd b8 f5 ff ff mov %rdi,-0xa48(%rbp)
3b98: 48 89 b5 b0 f5 ff ff mov %rsi,-0xa50(%rbp)
3b9f: 89 95 ac f5 ff ff mov %edx,-0xa54(%rbp)
3ba5: 64 48 8b 04 25 28 00 mov %fs:0x28,%rax
3bac: 00 00
3bae: 48 89 45 f8 mov %rax,-0x8(%rbp)
3bb2: 31 c0 xor %eax,%eax
char addr2line_cmd[512] = {0};
3bb4: 48 c7 85 d0 f5 ff ff movq $0x0,-0xa30(%rbp)
3bbb: 00 00 00 00
3bbf: 48 c7 85 d8 f5 ff ff movq $0x0,-0xa28(%rbp)
3bc6: 00 00 00 00
3bca: 48 8d 95 e0 f5 ff ff lea -0xa20(%rbp),%rdx
3bd1: b8 00 00 00 00 mov $0x0,%eax
3bd6: b9 3e 00 00 00 mov $0x3e,%ecx
3bdb: 48 89 d7 mov %rdx,%rdi
3bde: f3 48 ab rep stos %rax,%es:(%rdi)
/* have addr2line map the address to the relent line in the code */
#ifdef __APPLE__
/* apple does things differently... */
sprintf(addr2line_cmd,"atos -o %.256s %p", program_name, addr);
#else
sprintf(addr2line_cmd,"addr2line -f -e %.256s %p", program_name, addr);
3be1: 48 8b 8d b0 f5 ff ff mov -0xa50(%rbp),%rcx
3be8: 48 8b 95 b8 f5 ff ff mov -0xa48(%rbp),%rdx
3bef: 48 8d 85 d0 f5 ff ff lea -0xa30(%rbp),%rax
3bf6: 48 8d 35 a3 35 00 00 lea 0x35a3(%rip),%rsi # 71a0 <_IO_stdin_used+0x1a0>
3bfd: 48 89 c7 mov %rax,%rdi
3c00: b8 00 00 00 00 mov $0x0,%eax
3c05: e8 06 fb ff ff callq 3710 <sprintf@plt>
FILE *fp;
char outLine1[1035];
char outLine2[1035];
/* Open the command for reading. */
fp = popen(addr2line_cmd, "r");
3c0a: 48 8d 85 d0 f5 ff ff lea -0xa30(%rbp),%rax
3c11: 48 8d 35 a2 35 00 00 lea 0x35a2(%rip),%rsi # 71ba <_IO_stdin_used+0x1ba>
3c18: 48 89 c7 mov %rax,%rdi
3c1b: e8 80 fa ff ff callq 36a0 <popen@plt>
3c20: 48 89 85 c8 f5 ff ff mov %rax,-0xa38(%rbp)
if (fp == NULL)
3c27: 48 83 bd c8 f5 ff ff cmpq $0x0,-0xa38(%rbp)
3c2e: 00
3c2f: 0f 85 7e 01 00 00 jne 3db3 <addr2line+0x231>
return 1;
3c35: b8 01 00 00 00 mov $0x1,%eax
3c3a: e9 ac 01 00 00 jmpq 3deb <addr2line+0x269>
while (fgets(outLine1, sizeof(outLine1)-1, fp) != NULL)
{
//if we have a pair of lines
if(fgets(outLine2, sizeof(outLine2)-1, fp) != NULL)
3c3f: 48 8b 95 c8 f5 ff ff mov -0xa38(%rbp),%rdx
3c46: 48 8d 85 e0 fb ff ff lea -0x420(%rbp),%rax
3c4d: be 0a 04 00 00 mov $0x40a,%esi
3c52: 48 89 c7 mov %rax,%rdi
3c55: e8 56 f9 ff ff callq 35b0 <fgets@plt>
3c5a: 48 85 c0 test %rax,%rax
3c5d: 0f 84 3a 01 00 00 je 3d9d <addr2line+0x21b>
{
//if symbols are readable
if(outLine2[0] != '?')
3c63: 0f b6 85 e0 fb ff ff movzbl -0x420(%rbp),%eax
3c6a: 3c 3f cmp $0x3f,%al
3c6c: 0f 84 15 01 00 00 je 3d87 <addr2line+0x205>
{
//only let func name in outLine1
int i;
for(i = 0; i < 1035; ++i)
3c72: c7 85 c0 f5 ff ff 00 movl $0x0,-0xa40(%rbp)
3c79: 00 00 00
3c7c: eb 41 jmp 3cbf <addr2line+0x13d>
{
if(outLine1[i] == '\r' || outLine1[i] == '\n')
3c7e: 8b 85 c0 f5 ff ff mov -0xa40(%rbp),%eax
3c84: 48 98 cltq
3c86: 0f b6 84 05 d0 f7 ff movzbl -0x830(%rbp,%rax,1),%eax
3c8d: ff
3c8e: 3c 0d cmp $0xd,%al
3c90: 74 14 je 3ca6 <addr2line+0x124>
3c92: 8b 85 c0 f5 ff ff mov -0xa40(%rbp),%eax
3c98: 48 98 cltq
3c9a: 0f b6 84 05 d0 f7 ff movzbl -0x830(%rbp,%rax,1),%eax
3ca1: ff
3ca2: 3c 0a cmp $0xa,%al
3ca4: 75 12 jne 3cb8 <addr2line+0x136>
{
outLine1[i] = '\0';
3ca6: 8b 85 c0 f5 ff ff mov -0xa40(%rbp),%eax
3cac: 48 98 cltq
3cae: c6 84 05 d0 f7 ff ff movb $0x0,-0x830(%rbp,%rax,1)
3cb5: 00
break;
3cb6: eb 13 jmp 3ccb <addr2line+0x149>
for(i = 0; i < 1035; ++i)
3cb8: 83 85 c0 f5 ff ff 01 addl $0x1,-0xa40(%rbp)
3cbf: 81 bd c0 f5 ff ff 0a cmpl $0x40a,-0xa40(%rbp)
3cc6: 04 00 00
3cc9: 7e b3 jle 3c7e <addr2line+0xfc>
}
}
//don't display the whole path
int lastSlashPos=0;
3ccb: c7 85 c4 f5 ff ff 00 movl $0x0,-0xa3c(%rbp)
3cd2: 00 00 00
for(i = 0; i < 1035; ++i)
3cd5: c7 85 c0 f5 ff ff 00 movl $0x0,-0xa40(%rbp)
3cdc: 00 00 00
3cdf: eb 3e jmp 3d1f <addr2line+0x19d>
{
if(outLine2[i] == '\0')
3ce1: 8b 85 c0 f5 ff ff mov -0xa40(%rbp),%eax
3ce7: 48 98 cltq
3ce9: 0f b6 84 05 e0 fb ff movzbl -0x420(%rbp,%rax,1),%eax
3cf0: ff
3cf1: 84 c0 test %al,%al
3cf3: 74 38 je 3d2d <addr2line+0x1ab>
break;
if(outLine2[i] == '/')
3cf5: 8b 85 c0 f5 ff ff mov -0xa40(%rbp),%eax
3cfb: 48 98 cltq
3cfd: 0f b6 84 05 e0 fb ff movzbl -0x420(%rbp,%rax,1),%eax
3d04: ff
3d05: 3c 2f cmp $0x2f,%al
3d07: 75 0f jne 3d18 <addr2line+0x196>
lastSlashPos = i+1;
3d09: 8b 85 c0 f5 ff ff mov -0xa40(%rbp),%eax
3d0f: 83 c0 01 add $0x1,%eax
3d12: 89 85 c4 f5 ff ff mov %eax,-0xa3c(%rbp)
for(i = 0; i < 1035; ++i)
3d18: 83 85 c0 f5 ff ff 01 addl $0x1,-0xa40(%rbp)
3d1f: 81 bd c0 f5 ff ff 0a cmpl $0x40a,-0xa40(%rbp)
3d26: 04 00 00
3d29: 7e b6 jle 3ce1 <addr2line+0x15f>
3d2b: eb 01 jmp 3d2e <addr2line+0x1ac>
break;
3d2d: 90 nop
}
fprintf(stderr, "[%i] %p in %s at %s", lineNb, addr, outLine1, outLine2+lastSlashPos);
3d2e: 8b 85 c4 f5 ff ff mov -0xa3c(%rbp),%eax
3d34: 48 98 cltq
3d36: 48 8d 95 e0 fb ff ff lea -0x420(%rbp),%rdx
3d3d: 48 8d 3c 02 lea (%rdx,%rax,1),%rdi
3d41: 48 8b 05 18 73 00 00 mov 0x7318(%rip),%rax # b060 <stderr@@GLIBC_2.2.5>
3d48: 48 8d b5 d0 f7 ff ff lea -0x830(%rbp),%rsi
3d4f: 48 8b 8d b0 f5 ff ff mov -0xa50(%rbp),%rcx
3d56: 8b 95 ac f5 ff ff mov -0xa54(%rbp),%edx
3d5c: 49 89 f9 mov %rdi,%r9
3d5f: 49 89 f0 mov %rsi,%r8
3d62: 48 8d 35 53 34 00 00 lea 0x3453(%rip),%rsi # 71bc <_IO_stdin_used+0x1bc>
3d69: 48 89 c7 mov %rax,%rdi
3d6c: b8 00 00 00 00 mov $0x0,%eax
3d71: e8 6a f8 ff ff callq 35e0 <fprintf@plt>
fflush(stderr);
3d76: 48 8b 05 e3 72 00 00 mov 0x72e3(%rip),%rax # b060 <stderr@@GLIBC_2.2.5>
3d7d: 48 89 c7 mov %rax,%rdi
3d80: e8 cb f8 ff ff callq 3650 <fflush@plt>
3d85: eb 2c jmp 3db3 <addr2line+0x231>
}
else
{
pclose(fp);
3d87: 48 8b 85 c8 f5 ff ff mov -0xa38(%rbp),%rax
3d8e: 48 89 c7 mov %rax,%rdi
3d91: e8 8a f7 ff ff callq 3520 <pclose@plt>
return 1;
3d96: b8 01 00 00 00 mov $0x1,%eax
3d9b: eb 4e jmp 3deb <addr2line+0x269>
}
}
else
{
pclose(fp);
3d9d: 48 8b 85 c8 f5 ff ff mov -0xa38(%rbp),%rax
3da4: 48 89 c7 mov %rax,%rdi
3da7: e8 74 f7 ff ff callq 3520 <pclose@plt>
return 1;
3dac: b8 01 00 00 00 mov $0x1,%eax
3db1: eb 38 jmp 3deb <addr2line+0x269>
while (fgets(outLine1, sizeof(outLine1)-1, fp) != NULL)
3db3: 48 8b 95 c8 f5 ff ff mov -0xa38(%rbp),%rdx
3dba: 48 8d 85 d0 f7 ff ff lea -0x830(%rbp),%rax
3dc1: be 0a 04 00 00 mov $0x40a,%esi
3dc6: 48 89 c7 mov %rax,%rdi
3dc9: e8 e2 f7 ff ff callq 35b0 <fgets@plt>
3dce: 48 85 c0 test %rax,%rax
3dd1: 0f 85 68 fe ff ff jne 3c3f <addr2line+0xbd>
}
}
/* close */
pclose(fp);
3dd7: 48 8b 85 c8 f5 ff ff mov -0xa38(%rbp),%rax
3dde: 48 89 c7 mov %rax,%rdi
3de1: e8 3a f7 ff ff callq 3520 <pclose@plt>
return 0;
3de6: b8 00 00 00 00 mov $0x0,%eax
}
3deb: 48 8b 4d f8 mov -0x8(%rbp),%rcx
3def: 64 48 33 0c 25 28 00 xor %fs:0x28,%rcx
3df6: 00 00
3df8: 74 05 je 3dff <addr2line+0x27d>
3dfa: e8 e1 f6 ff ff callq 34e0 <__stack_chk_fail@plt>
3dff: c9 leaveq
3e00: c3 retq
0000000000003e01 <sigpipe>:
extern char *verbs[];
extern LoadedScript *scripts;
extern int nloadedscripts;
void sigpipe() {
3e01: f3 0f 1e fa endbr64
3e05: 55 push %rbp
3e06: 48 89 e5 mov %rsp,%rbp
SetColor16(COLOR_RED);
3e09: bf 01 00 00 00 mov $0x1,%edi
3e0e: e8 9b 22 00 00 callq 60ae <SetColor16>
printf("EPIPE");
3e13: 48 8d 3d b6 33 00 00 lea 0x33b6(%rip),%rdi # 71d0 <_IO_stdin_used+0x1d0>
3e1a: b8 00 00 00 00 mov $0x0,%eax
3e1f: e8 ec f6 ff ff callq 3510 <printf@plt>
ResetColor16();
3e24: b8 00 00 00 00 mov $0x0,%eax
3e29: e8 64 22 00 00 callq 6092 <ResetColor16>
}
3e2e: 90 nop
3e2f: 5d pop %rbp
3e30: c3 retq
0000000000003e31 <segfault>:
void segfault() {
3e31: f3 0f 1e fa endbr64
3e35: 55 push %rbp
3e36: 48 89 e5 mov %rsp,%rbp
printf("\nWhoops! Rabbit crashed.\n\
3e39: 48 8d 3d 98 33 00 00 lea 0x3398(%rip),%rdi # 71d8 <_IO_stdin_used+0x1d8>
3e40: e8 fb f5 ff ff callq 3440 <puts@plt>
Please sent all this information in an issue to the Rabbit Github repo \
( https://github.com/kevidryon2/rabbit ):\n");
CRITICAL("Recieved signal 11 (SIGSEGV)!");
3e45: bf 00 00 00 00 mov $0x0,%edi
3e4a: e8 0e fa ff ff callq 385d <print_stacktrace>
3e4f: 48 8b 05 0a 72 00 00 mov 0x720a(%rip),%rax # b060 <stderr@@GLIBC_2.2.5>
3e56: 41 b9 33 00 00 00 mov $0x33,%r9d
3e5c: 4c 8d 05 ff 33 00 00 lea 0x33ff(%rip),%r8 # 7262 <_IO_stdin_used+0x262>
3e63: 48 8d 0d e6 38 00 00 lea 0x38e6(%rip),%rcx # 7750 <__func__.4838>
3e6a: 48 8d 15 fc 33 00 00 lea 0x33fc(%rip),%rdx # 726d <_IO_stdin_used+0x26d>
3e71: 48 8d 35 13 34 00 00 lea 0x3413(%rip),%rsi # 728b <_IO_stdin_used+0x28b>
3e78: 48 89 c7 mov %rax,%rdi
3e7b: b8 00 00 00 00 mov $0x0,%eax
3e80: e8 5b f7 ff ff callq 35e0 <fprintf@plt>
3e85: bf 01 00 00 00 mov $0x1,%edi
3e8a: e8 91 f8 ff ff callq 3720 <exit@plt>
0000000000003e8f <filesize>:
}
int filesize(FILE *fp) {
3e8f: f3 0f 1e fa endbr64
3e93: 55 push %rbp
3e94: 48 89 e5 mov %rsp,%rbp
3e97: 48 83 ec 20 sub $0x20,%rsp
3e9b: 48 89 7d e8 mov %rdi,-0x18(%rbp)
int os = ftell(fp);
3e9f: 48 8b 45 e8 mov -0x18(%rbp),%rax
3ea3: 48 89 c7 mov %rax,%rdi
3ea6: e8 45 f7 ff ff callq 35f0 <ftell@plt>
3eab: 89 45 f8 mov %eax,-0x8(%rbp)
fseek(fp, 0, SEEK_END);
3eae: 48 8b 45 e8 mov -0x18(%rbp),%rax
3eb2: ba 02 00 00 00 mov $0x2,%edx
3eb7: be 00 00 00 00 mov $0x0,%esi
3ebc: 48 89 c7 mov %rax,%rdi
3ebf: e8 ac f7 ff ff callq 3670 <fseek@plt>
int s = ftell(fp);
3ec4: 48 8b 45 e8 mov -0x18(%rbp),%rax
3ec8: 48 89 c7 mov %rax,%rdi
3ecb: e8 20 f7 ff ff callq 35f0 <ftell@plt>
3ed0: 89 45 fc mov %eax,-0x4(%rbp)
fseek(fp, os, SEEK_SET);
3ed3: 8b 45 f8 mov -0x8(%rbp),%eax
3ed6: 48 63 c8 movslq %eax,%rcx
3ed9: 48 8b 45 e8 mov -0x18(%rbp),%rax
3edd: ba 00 00 00 00 mov $0x0,%edx
3ee2: 48 89 ce mov %rcx,%rsi
3ee5: 48 89 c7 mov %rax,%rdi
3ee8: e8 83 f7 ff ff callq 3670 <fseek@plt>
return s;
3eed: 8b 45 fc mov -0x4(%rbp),%eax
}
3ef0: c9 leaveq
3ef1: c3 retq
0000000000003ef2 <logdata>:
void logdata(char *data) {
3ef2: f3 0f 1e fa endbr64
3ef6: 55 push %rbp
3ef7: 48 89 e5 mov %rsp,%rbp
3efa: 53 push %rbx
3efb: 48 83 ec 28 sub $0x28,%rsp
3eff: 48 89 7d d8 mov %rdi,-0x28(%rbp)
for (int i=0; i<strlen(data); i++) {
3f03: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%rbp)
3f0a: eb 75 jmp 3f81 <logdata+0x8f>
if (data[i] < ' ' || data[i] > '~') {
3f0c: 8b 45 ec mov -0x14(%rbp),%eax
3f0f: 48 63 d0 movslq %eax,%rdx
3f12: 48 8b 45 d8 mov -0x28(%rbp),%rax
3f16: 48 01 d0 add %rdx,%rax
3f19: 0f b6 00 movzbl (%rax),%eax
3f1c: 3c 1f cmp $0x1f,%al
3f1e: 7e 14 jle 3f34 <logdata+0x42>
3f20: 8b 45 ec mov -0x14(%rbp),%eax
3f23: 48 63 d0 movslq %eax,%rdx
3f26: 48 8b 45 d8 mov -0x28(%rbp),%rax
3f2a: 48 01 d0 add %rdx,%rax
3f2d: 0f b6 00 movzbl (%rax),%eax
3f30: 3c 7f cmp $0x7f,%al
3f32: 75 2f jne 3f63 <logdata+0x71>
printf("\\%sx%02x", "", (unsigned char)(data[i]));
3f34: 8b 45 ec mov -0x14(%rbp),%eax
3f37: 48 63 d0 movslq %eax,%rdx
3f3a: 48 8b 45 d8 mov -0x28(%rbp),%rax
3f3e: 48 01 d0 add %rdx,%rax
3f41: 0f b6 00 movzbl (%rax),%eax
3f44: 0f b6 c0 movzbl %al,%eax
3f47: 89 c2 mov %eax,%edx
3f49: 48 8d 35 50 33 00 00 lea 0x3350(%rip),%rsi # 72a0 <_IO_stdin_used+0x2a0>
3f50: 48 8d 3d 4a 33 00 00 lea 0x334a(%rip),%rdi # 72a1 <_IO_stdin_used+0x2a1>
3f57: b8 00 00 00 00 mov $0x0,%eax
3f5c: e8 af f5 ff ff callq 3510 <printf@plt>
3f61: eb 1a jmp 3f7d <logdata+0x8b>
} else putchar(data[i]);
3f63: 8b 45 ec mov -0x14(%rbp),%eax
3f66: 48 63 d0 movslq %eax,%rdx
3f69: 48 8b 45 d8 mov -0x28(%rbp),%rax
3f6d: 48 01 d0 add %rdx,%rax
3f70: 0f b6 00 movzbl (%rax),%eax
3f73: 0f be c0 movsbl %al,%eax
3f76: 89 c7 mov %eax,%edi
3f78: e8 73 f4 ff ff callq 33f0 <putchar@plt>
for (int i=0; i<strlen(data); i++) {
3f7d: 83 45 ec 01 addl $0x1,-0x14(%rbp)
3f81: 8b 45 ec mov -0x14(%rbp),%eax
3f84: 48 63 d8 movslq %eax,%rbx
3f87: 48 8b 45 d8 mov -0x28(%rbp),%rax
3f8b: 48 89 c7 mov %rax,%rdi
3f8e: e8 2d f5 ff ff callq 34c0 <strlen@plt>
3f93: 48 39 c3 cmp %rax,%rbx
3f96: 0f 82 70 ff ff ff jb 3f0c <logdata+0x1a>
}
}
3f9c: 90 nop
3f9d: 90 nop
3f9e: 48 83 c4 28 add $0x28,%rsp
3fa2: 5b pop %rbx
3fa3: 5d pop %rbp
3fa4: c3 retq
0000000000003fa5 <escapestr>:
RequestData *RabbitParseRequest(const char *reqbuff);
void RabbitExecScript(LoadedScript script, RequestData reqdata, char *resbuff);
int RabbitSearchScript(char *path, int pathlen);
int RabbitCallPHP(char *source_path, char *output_path, RequestData data, loadFile_returnData *output);
char *escapestr(unsigned char *s) {
3fa5: f3 0f 1e fa endbr64
3fa9: 55 push %rbp
3faa: 48 89 e5 mov %rsp,%rbp
3fad: 53 push %rbx
3fae: 48 83 ec 38 sub $0x38,%rsp
3fb2: 48 89 7d c8 mov %rdi,-0x38(%rbp)
unsigned char *o = malloc(BUFSIZ);
3fb6: bf 00 20 00 00 mov $0x2000,%edi
3fbb: e8 80 f6 ff ff callq 3640 <malloc@plt>
3fc0: 48 89 45 e8 mov %rax,-0x18(%rbp)
memset(o, 0, BUFSIZ);
3fc4: 48 8b 45 e8 mov -0x18(%rbp),%rax
3fc8: ba 00 20 00 00 mov $0x2000,%edx
3fcd: be 00 00 00 00 mov $0x0,%esi
3fd2: 48 89 c7 mov %rax,%rdi
3fd5: e8 76 f5 ff ff callq 3550 <memset@plt>
int j;
int oi = 0;
3fda: c7 45 e0 00 00 00 00 movl $0x0,-0x20(%rbp)
for (int i=0; i<strlen(s); i++) {
3fe1: c7 45 e4 00 00 00 00 movl $0x0,-0x1c(%rbp)
3fe8: e9 27 01 00 00 jmpq 4114 <escapestr+0x16f>
for (j=i; s[j] &&
3fed: 8b 45 e4 mov -0x1c(%rbp),%eax
3ff0: 89 45 dc mov %eax,-0x24(%rbp)
3ff3: eb 04 jmp 3ff9 <escapestr+0x54>
s[j] != '/' &&
s[j] < 0x80 &&
s[j] > 0x1f; j++);
3ff5: 83 45 dc 01 addl $0x1,-0x24(%rbp)
for (j=i; s[j] &&
3ff9: 8b 45 dc mov -0x24(%rbp),%eax
3ffc: 48 63 d0 movslq %eax,%rdx
3fff: 48 8b 45 c8 mov -0x38(%rbp),%rax
4003: 48 01 d0 add %rdx,%rax
4006: 0f b6 00 movzbl (%rax),%eax
4009: 84 c0 test %al,%al
400b: 74 3c je 4049 <escapestr+0xa4>
s[j] != '/' &&
400d: 8b 45 dc mov -0x24(%rbp),%eax
4010: 48 63 d0 movslq %eax,%rdx
4013: 48 8b 45 c8 mov -0x38(%rbp),%rax
4017: 48 01 d0 add %rdx,%rax
401a: 0f b6 00 movzbl (%rax),%eax
for (j=i; s[j] &&
401d: 3c 2f cmp $0x2f,%al
401f: 74 28 je 4049 <escapestr+0xa4>
s[j] < 0x80 &&
4021: 8b 45 dc mov -0x24(%rbp),%eax
4024: 48 63 d0 movslq %eax,%rdx
4027: 48 8b 45 c8 mov -0x38(%rbp),%rax
402b: 48 01 d0 add %rdx,%rax
402e: 0f b6 00 movzbl (%rax),%eax
s[j] != '/' &&
4031: 84 c0 test %al,%al
4033: 78 14 js 4049 <escapestr+0xa4>
s[j] > 0x1f; j++);
4035: 8b 45 dc mov -0x24(%rbp),%eax
4038: 48 63 d0 movslq %eax,%rdx
403b: 48 8b 45 c8 mov -0x38(%rbp),%rax
403f: 48 01 d0 add %rdx,%rax
4042: 0f b6 00 movzbl (%rax),%eax
s[j] < 0x80 &&
4045: 3c 1f cmp $0x1f,%al
4047: 77 ac ja 3ff5 <escapestr+0x50>
j -= i;
4049: 8b 45 e4 mov -0x1c(%rbp),%eax
404c: 29 45 dc sub %eax,-0x24(%rbp)
if (j > 0) {
404f: 83 7d dc 00 cmpl $0x0,-0x24(%rbp)
4053: 7e 65 jle 40ba <escapestr+0x115>
if (j > 25) j = 25;
4055: 83 7d dc 19 cmpl $0x19,-0x24(%rbp)
4059: 7e 07 jle 4062 <escapestr+0xbd>
405b: c7 45 dc 19 00 00 00 movl $0x19,-0x24(%rbp)
o[oi] = 'A'+j; oi++;
4062: 8b 45 dc mov -0x24(%rbp),%eax
4065: 89 c1 mov %eax,%ecx
4067: 8b 45 e0 mov -0x20(%rbp),%eax
406a: 48 63 d0 movslq %eax,%rdx
406d: 48 8b 45 e8 mov -0x18(%rbp),%rax
4071: 48 01 d0 add %rdx,%rax
4074: 8d 51 41 lea 0x41(%rcx),%edx
4077: 88 10 mov %dl,(%rax)
4079: 83 45 e0 01 addl $0x1,-0x20(%rbp)
memcpy(o+oi, s+i, j); oi += j, i += j;
407d: 8b 45 dc mov -0x24(%rbp),%eax
4080: 48 98 cltq
4082: 8b 55 e4 mov -0x1c(%rbp),%edx
4085: 48 63 ca movslq %edx,%rcx
4088: 48 8b 55 c8 mov -0x38(%rbp),%rdx
408c: 48 8d 34 11 lea (%rcx,%rdx,1),%rsi
4090: 8b 55 e0 mov -0x20(%rbp),%edx
4093: 48 63 ca movslq %edx,%rcx
4096: 48 8b 55 e8 mov -0x18(%rbp),%rdx
409a: 48 01 d1 add %rdx,%rcx
409d: 48 89 c2 mov %rax,%rdx
40a0: 48 89 cf mov %rcx,%rdi
40a3: e8 68 f5 ff ff callq 3610 <memcpy@plt>
40a8: 8b 45 dc mov -0x24(%rbp),%eax
40ab: 01 45 e0 add %eax,-0x20(%rbp)
40ae: 8b 45 dc mov -0x24(%rbp),%eax
40b1: 01 45 e4 add %eax,-0x1c(%rbp)
i--;
40b4: 83 6d e4 01 subl $0x1,-0x1c(%rbp)
40b8: eb 56 jmp 4110 <escapestr+0x16b>
} else {
o[oi] = (s[i]>>4)+'a'; oi++;
40ba: 8b 45 e4 mov -0x1c(%rbp),%eax
40bd: 48 63 d0 movslq %eax,%rdx
40c0: 48 8b 45 c8 mov -0x38(%rbp),%rax
40c4: 48 01 d0 add %rdx,%rax
40c7: 0f b6 00 movzbl (%rax),%eax
40ca: c0 e8 04 shr $0x4,%al
40cd: 89 c1 mov %eax,%ecx
40cf: 8b 45 e0 mov -0x20(%rbp),%eax
40d2: 48 63 d0 movslq %eax,%rdx
40d5: 48 8b 45 e8 mov -0x18(%rbp),%rax
40d9: 48 01 d0 add %rdx,%rax
40dc: 8d 51 61 lea 0x61(%rcx),%edx
40df: 88 10 mov %dl,(%rax)
40e1: 83 45 e0 01 addl $0x1,-0x20(%rbp)
o[oi] = (s[i]%16)+'a'; oi++;
40e5: 8b 45 e4 mov -0x1c(%rbp),%eax
40e8: 48 63 d0 movslq %eax,%rdx
40eb: 48 8b 45 c8 mov -0x38(%rbp),%rax
40ef: 48 01 d0 add %rdx,%rax
40f2: 0f b6 00 movzbl (%rax),%eax
40f5: 83 e0 0f and $0xf,%eax
40f8: 89 c1 mov %eax,%ecx
40fa: 8b 45 e0 mov -0x20(%rbp),%eax
40fd: 48 63 d0 movslq %eax,%rdx
4100: 48 8b 45 e8 mov -0x18(%rbp),%rax
4104: 48 01 d0 add %rdx,%rax
4107: 8d 51 61 lea 0x61(%rcx),%edx
410a: 88 10 mov %dl,(%rax)
410c: 83 45 e0 01 addl $0x1,-0x20(%rbp)
for (int i=0; i<strlen(s); i++) {
4110: 83 45 e4 01 addl $0x1,-0x1c(%rbp)
4114: 8b 45 e4 mov -0x1c(%rbp),%eax
4117: 48 63 d8 movslq %eax,%rbx
411a: 48 8b 45 c8 mov -0x38(%rbp),%rax
411e: 48 89 c7 mov %rax,%rdi
4121: e8 9a f3 ff ff callq 34c0 <strlen@plt>
4126: 48 39 c3 cmp %rax,%rbx
4129: 0f 82 be fe ff ff jb 3fed <escapestr+0x48>
}
}
return o;
412f: 48 8b 45 e8 mov -0x18(%rbp),%rax
}
4133: 48 83 c4 38 add $0x38,%rsp
4137: 5b pop %rbx
4138: 5d pop %rbp
4139: c3 retq
000000000000413a <set_env_variable>:
void set_env_variable() {
413a: f3 0f 1e fa endbr64
413e: 55 push %rbp
413f: 48 89 e5 mov %rsp,%rbp
printf("You should set the RABBIT_PATH environment variable to the path you want to use as the server main directory.\n");
4142: 48 8d 3d 67 31 00 00 lea 0x3167(%rip),%rdi # 72b0 <_IO_stdin_used+0x2b0>
4149: e8 f2 f2 ff ff callq 3440 <puts@plt>
exit(1);
414e: bf 01 00 00 00 mov $0x1,%edi
4153: e8 c8 f5 ff ff callq 3720 <exit@plt>
0000000000004158 <main>:
}
int main(int argc, char **argv, char **envp) {
4158: f3 0f 1e fa endbr64
415c: 55 push %rbp
415d: 48 89 e5 mov %rsp,%rbp
4160: 41 55 push %r13
4162: 41 54 push %r12
4164: 53 push %rbx
4165: 4c 8d 9c 24 00 80 ff lea -0x8000(%rsp),%r11
416c: ff
416d: 48 81 ec 00 10 00 00 sub $0x1000,%rsp
4174: 48 83 0c 24 00 orq $0x0,(%rsp)
4179: 4c 39 dc cmp %r11,%rsp
417c: 75 ef jne 416d <main+0x15>
417e: 48 81 ec c8 00 00 00 sub $0xc8,%rsp
4185: 89 bd 3c 7f ff ff mov %edi,-0x80c4(%rbp)
418b: 48 89 b5 30 7f ff ff mov %rsi,-0x80d0(%rbp)
4192: 48 89 95 28 7f ff ff mov %rdx,-0x80d8(%rbp)
4199: 64 48 8b 04 25 28 00 mov %fs:0x28,%rax
41a0: 00 00
41a2: 48 89 45 d8 mov %rax,-0x28(%rbp)
41a6: 31 c0 xor %eax,%eax
char *buffer;
char scriptpath[PATH_MAX];
struct dirent *ent;
FILE *fp;
int len;
int sn = 0;
41a8: c7 85 54 7f ff ff 00 movl $0x0,-0x80ac(%rbp)
41af: 00 00 00
unsigned short port;
char *tmp;
printf("Rabbit "RABBIT_VERS" (PID = %d)\n", getpid());
41b2: e8 d9 f2 ff ff callq 3490 <getpid@plt>
41b7: 89 c6 mov %eax,%esi
41b9: 48 8d 3d 5e 31 00 00 lea 0x315e(%rip),%rdi # 731e <_IO_stdin_used+0x31e>
41c0: b8 00 00 00 00 mov $0x0,%eax
41c5: e8 46 f3 ff ff callq 3510 <printf@plt>
init_exceptions(argv[0]);
41ca: 48 8b 85 30 7f ff ff mov -0x80d0(%rbp),%rax
41d1: 48 8b 00 mov (%rax),%rax
41d4: 48 89 c7 mov %rax,%rdi
41d7: e8 7c f9 ff ff callq 3b58 <init_exceptions>
signal(SIGPIPE, sigpipe);
41dc: 48 8d 35 1e fc ff ff lea -0x3e2(%rip),%rsi # 3e01 <sigpipe>
41e3: bf 0d 00 00 00 mov $0xd,%edi
41e8: e8 e3 f3 ff ff callq 35d0 <signal@plt>
signal(SIGSEGV, segfault);
41ed: 48 8d 35 3d fc ff ff lea -0x3c3(%rip),%rsi # 3e31 <segfault>
41f4: bf 0b 00 00 00 mov $0xb,%edi
41f9: e8 d2 f3 ff ff callq 35d0 <signal@plt>
/* Seed RNG */
srand(time(NULL));
41fe: bf 00 00 00 00 mov $0x0,%edi
4203: e8 18 f4 ff ff callq 3620 <time@plt>
4208: 89 c7 mov %eax,%edi
420a: e8 91 f3 ff ff callq 35a0 <srand@plt>
if (argc<2) {
420f: 83 bd 3c 7f ff ff 01 cmpl $0x1,-0x80c4(%rbp)
4216: 7f 0b jg 4223 <main+0xcb>
port = 8080;
4218: 66 c7 85 4e 7f ff ff movw $0x1f90,-0x80b2(%rbp)
421f: 90 1f
4221: eb 1d jmp 4240 <main+0xe8>
} else {
port = atoi(argv[1]);
4223: 48 8b 85 30 7f ff ff mov -0x80d0(%rbp),%rax
422a: 48 83 c0 08 add $0x8,%rax
422e: 48 8b 00 mov (%rax),%rax