From dede1e63fe4d129986fb15f7a329df59ae9406e3 Mon Sep 17 00:00:00 2001 From: Kagura Date: Wed, 12 Jun 2024 07:36:23 +0800 Subject: [PATCH] Init --- bomblab/bomb126/B22040723.txt | 7 + bomblab/bomb126/README | 3 + bomblab/bomb126/a.py | 8 + bomblab/bomb126/bomb | Bin 0 -> 30528 bytes bomblab/bomb126/bomb.c | 115 ++ bomblab/bomb126/linker.txt | 2001 ++++++++++++++++++++++++++++ bomblab/bomb126/res1.txt | 1 + bomblab/bomb126/strings.txt | 430 ++++++ bomblab/bomb126/symbols.txt | 131 ++ datalab-handout/.vscode/tasks.json | 28 + datalab-handout/Driverhdrs.pm | 12 + datalab-handout/Driverlib.pm | 138 ++ datalab-handout/Makefile | 26 + datalab-handout/README | 140 ++ datalab-handout/bits.c | 389 ++++++ datalab-handout/bits.h | 72 + datalab-handout/btest | Bin 0 -> 21780 bytes datalab-handout/btest.c | 583 ++++++++ datalab-handout/btest.h | 32 + datalab-handout/decl.c | 95 ++ datalab-handout/dlc | Bin 0 -> 1261432 bytes datalab-handout/driver.pl | 439 ++++++ datalab-handout/fshow | Bin 0 -> 14996 bytes datalab-handout/fshow.c | 151 +++ datalab-handout/ishow | Bin 0 -> 14864 bytes datalab-handout/ishow.c | 75 ++ datalab-handout/lab1.doc | Bin 0 -> 206848 bytes datalab-handout/tests.c | 156 +++ linklab/linkbomb | Bin 0 -> 16104 bytes linklab/linkbomb3 | Bin 0 -> 15840 bytes linklab/linklab/main.o | Bin 0 -> 1792 bytes linklab/linklab/phase2.o | Bin 0 -> 1912 bytes linklab/linklab/phase3.o | Bin 0 -> 2976 bytes linklab/linklab1 | Bin 0 -> 15944 bytes linklab/main.o | Bin 0 -> 1792 bytes linklab/phase1.o | Bin 0 -> 1889 bytes linklab/phase1.txt | 16 + linklab/phase2.elf | 102 ++ linklab/phase2.elf.new | 102 ++ linklab/phase2.o | Bin 0 -> 1912 bytes linklab/phase2.txt | 41 + linklab/phase2_patch.c | 1 + linklab/phase2_patch.o | Bin 0 -> 1232 bytes linklab/phase3.o | Bin 0 -> 2976 bytes linklab/phase3.txt | 229 ++++ 45 files changed, 5523 insertions(+) create mode 100644 bomblab/bomb126/B22040723.txt create mode 100644 bomblab/bomb126/README create mode 100644 bomblab/bomb126/a.py create mode 100755 bomblab/bomb126/bomb create mode 100644 bomblab/bomb126/bomb.c create mode 100644 bomblab/bomb126/linker.txt create mode 100644 bomblab/bomb126/res1.txt create mode 100644 bomblab/bomb126/strings.txt create mode 100644 bomblab/bomb126/symbols.txt create mode 100644 datalab-handout/.vscode/tasks.json create mode 100644 datalab-handout/Driverhdrs.pm create mode 100644 datalab-handout/Driverlib.pm create mode 100644 datalab-handout/Makefile create mode 100644 datalab-handout/README create mode 100644 datalab-handout/bits.c create mode 100644 datalab-handout/bits.h create mode 100755 datalab-handout/btest create mode 100644 datalab-handout/btest.c create mode 100644 datalab-handout/btest.h create mode 100644 datalab-handout/decl.c create mode 100755 datalab-handout/dlc create mode 100755 datalab-handout/driver.pl create mode 100755 datalab-handout/fshow create mode 100644 datalab-handout/fshow.c create mode 100755 datalab-handout/ishow create mode 100644 datalab-handout/ishow.c create mode 100644 datalab-handout/lab1.doc create mode 100644 datalab-handout/tests.c create mode 100755 linklab/linkbomb create mode 100755 linklab/linkbomb3 create mode 100644 linklab/linklab/main.o create mode 100644 linklab/linklab/phase2.o create mode 100644 linklab/linklab/phase3.o create mode 100755 linklab/linklab1 create mode 100644 linklab/main.o create mode 100644 linklab/phase1.o create mode 100644 linklab/phase1.txt create mode 100644 linklab/phase2.elf create mode 100644 linklab/phase2.elf.new create mode 100644 linklab/phase2.o create mode 100644 linklab/phase2.txt create mode 100644 linklab/phase2_patch.c create mode 100644 linklab/phase2_patch.o create mode 100644 linklab/phase3.o create mode 100644 linklab/phase3.txt diff --git a/bomblab/bomb126/B22040723.txt b/bomblab/bomb126/B22040723.txt new file mode 100644 index 0000000..2cf4748 --- /dev/null +++ b/bomblab/bomb126/B22040723.txt @@ -0,0 +1,7 @@ +Public speaking is very easy. +0 1 3 6 10 15 +0 271 +99 3 DrEvil +5 115 +6 3 5 2 1 4 +47 diff --git a/bomblab/bomb126/README b/bomblab/bomb126/README new file mode 100644 index 0000000..6dd9b93 --- /dev/null +++ b/bomblab/bomb126/README @@ -0,0 +1,3 @@ +This is bomb 126. + +It belongs to B22040723 (me@kagurach.uk) diff --git a/bomblab/bomb126/a.py b/bomblab/bomb126/a.py new file mode 100644 index 0000000..5cd1c48 --- /dev/null +++ b/bomblab/bomb126/a.py @@ -0,0 +1,8 @@ +hex_string = "0x50 0x75 0x62 0x6c 0x69 0x63" +# Split the hex string into individual hex values +hex_values = hex_string.split() + +# Convert each hex value to its corresponding character +decoded_string = ''.join([chr(int(hex_val, 16)) for hex_val in hex_values]) + +print(decoded_string) \ No newline at end of file diff --git a/bomblab/bomb126/bomb b/bomblab/bomb126/bomb new file mode 100755 index 0000000000000000000000000000000000000000..410e2cf788af6cfd15713428a43d6894c6de446d GIT binary patch literal 30528 zcmeHwdwf*Ywf{bonIt4683L9M9qyg1 zqY^Twj+2~&f&ynwH(|it9Hc}-5=uTJy-Lo;Sf$P{VU0*nLbDv%#(9x0=UlDJN!T+< zr?(jS(Qz^t$*Dq46><_D5r&XZ+LLTTzgl6>+AKFP!gXk5pHmsL%5@33F2OHhgW#8t z(x7YI>+$x#CA}6Q_sIfX&nFAqJRspTQ9cP}dY3_t?D9n~Y1XwOy@~4KxJXYzfwFm_ zVB5l)d7<|5P%xa>QNE*gVfn(EiddwgnrDIXrQ%0EwQ}`(hI$($nlK}?_3F6PM{(0c zJn{c2*A;a1?Ctr=FYG(oYZp9s;tzMPA|A>&$q)}+q)#*<16L6u9&QgsWxa~iMzlHj z(RJP#H=W+G-sfC=qF**2J;HSV4Z>4RxD4)^fWCAB`sf7oZ4=P%nSeff0{UYU(C5Mc za7bc*WPe8v839E>+URQ%KUVi?40{Zj`?2|JA zf6oN;A5B1aPN0A81pKQepg%bQ{gw&nf0}^aHUa$((5J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rA=NF8`$x!^S9b{0#*b|!1_rfyB z{4Y9WP{a#T`YshoRiRGEF8ZGx;FW5rQ2oy}WN69wa|#(Tq>}!Uf$6V981eK+5G;S= z0OrG=eK0tva2<*8BFa-NBD|gN>F^5n(gqR>S64H7&kju)UyvbwKWc>gBdWrSYV5=- zllmWq$k1&0TMkCtA{K^ghUa5%jqh5uhtQt*pMeOFRpLRvw3Q z0`*VcU^{w2{s%xZ;=JD0Rm)|MWB$V*1{W_KTmwxG_Zmj#@b>s(F}y9?uK&RfgO|!c zT-fv@bLy6e1$TJ$mvCcn0BSCl4OjDD3o%s9r#=NQY#Id8o$=Q{j2OzH{`W}?5;3!i z*v@V^8X#Pi!!8-ZektCCV-={BKm|4mE3k{*6Ntulnn<)2*Io|0>0F-rCTx9oGR}?{ zJG)p#`_3?u&>=SHc?|mY82t$nGvY-Y+|ow^BGeO#vkGn_yrdVefP=D%I9}^z6}(TY zh(>siR}ttEV^3E*lt@e$)dwM6LWYrouR923co&%8NIh~$Tf!CaX;y);up2`hXo0pw zC*o8l1}_O-P|1KT9VH|hl!%xET4S8Cu9KW*v8K0hh=8z{3NgDnK?9qCs| zmYWCU-(@>p&?O*V^K~{5+Ln~^wL)J09kNO@Gs1G7BFQxWH_LYk`7W$C=yK`6xXXE? zB+%&@v%K7Aq<07DQu%%CW|iN7D7^YdCzSXl-#geR4H5%-kN_wW+?>7rcz$M7a{+?-44Mh)3=tN_HRhOUhv8HEYc!< z`CbOelg+I1cY{WDmHLf&xD!NNkw=S^uIr8~!Wnk&b$iiKM*z`%uTlMy2Ef3%_K#651eamN)j>-9o@(e<>$nzExiA zQ!tM%-)l519an`~38p}vbjke7^?L70o#WVlAwNT;Unvy|DCIA((810x3F$1F44YYh zBGR|&wer&Q2rG^B{87kH5&e+VZRK4uf&5!7x +#include +#include "support.h" +#include "phases.h" + +/* + * Note to self: Remember to erase this file so my victims will have no + * idea what is going on, and so they will all blow up in a + * spectaculary fiendish explosion. -- Dr. Evil + */ + +FILE *infile; + +int main(int argc, char *argv[]) +{ + char *input; + + /* Note to self: remember to port this bomb to Windows and put a + * fantastic GUI on it. */ + + /* When run with no arguments, the bomb reads its input lines + * from standard input. */ + if (argc == 1) { + infile = stdin; + } + + /* When run with one argument , the bomb reads from + * until EOF, and then switches to standard input. Thus, as you + * defuse each phase, you can add its defusing string to and + * avoid having to retype it. */ + else if (argc == 2) { + if (!(infile = fopen(argv[1], "r"))) { + printf("%s: Error: Couldn't open %s\n", argv[0], argv[1]); + exit(8); + } + } + + /* You can't call the bomb with more than 1 command line argument. */ + else { + printf("Usage: %s []\n", argv[0]); + exit(8); + } + + /* Do all sorts of secret stuff that makes the bomb harder to defuse. */ + initialize_bomb(); + + printf("Welcome to my fiendish little bomb. You have 6 phases with\n"); + printf("which to blow yourself up. Have a nice day!\n"); + + /* Hmm... Six phases must be more secure than one phase! */ + input = read_line(); /* Get input */ + phase_1(input); /* Run the phase */ + phase_defused(); /* Drat! They figured it out! + * Let me know how they did it. */ + printf("Phase 1 defused. How about the next one?\n"); + + /* The second phase is harder. No one will ever figure out + * how to defuse this... */ + input = read_line(); + phase_2(input); + phase_defused(); + printf("That's number 2. Keep going!\n"); + + /* I guess this is too easy so far. Some more complex code will + * confuse people. */ + input = read_line(); + phase_3(input); + phase_defused(); + printf("Halfway there!\n"); + + /* Oh yeah? Well, how good is your math? Try on this saucy problem! */ + input = read_line(); + phase_4(input); + phase_defused(); + printf("So you got that one. Try this one.\n"); + + /* Round and 'round in memory we go, where we stop, the bomb blows! */ + input = read_line(); + phase_5(input); + phase_defused(); + printf("Good work! On to the next...\n"); + + /* This phase will never be used, since no one will get past the + * earlier ones. But just in case, make this one extra hard. */ + input = read_line(); + phase_6(input); + phase_defused(); + + /* Wow, they got it! But isn't something... missing? Perhaps + * something they overlooked? Mua ha ha ha ha! */ + + return 0; +} diff --git a/bomblab/bomb126/linker.txt b/bomblab/bomb126/linker.txt new file mode 100644 index 0000000..d926f1d --- /dev/null +++ b/bomblab/bomb126/linker.txt @@ -0,0 +1,2001 @@ + +bomb: file format elf64-x86-64 + + +Disassembly of section .init: + +0000000000401000 <_init>: + 401000: f3 0f 1e fa endbr64 + 401004: 48 83 ec 08 sub $0x8,%rsp + 401008: 48 8b 05 e9 3f 00 00 mov 0x3fe9(%rip),%rax # 404ff8 <__gmon_start__@Base> + 40100f: 48 85 c0 test %rax,%rax // if %rax == 0 exit(0) + 401012: 74 02 je 401016 <_init+0x16> + 401014: ff d0 call *%rax # 405820 + 401016: 48 83 c4 08 add $0x8,%rsp + 40101a: c3 ret + +Disassembly of section .plt: + +0000000000401020 <.plt>: + 401020: ff 35 e2 3f 00 00 push 0x3fe2(%rip) # 405008 <_GLOBAL_OFFSET_TABLE_+0x8> + 401026: f2 ff 25 e3 3f 00 00 bnd jmp *0x3fe3(%rip) # 405010 <_GLOBAL_OFFSET_TABLE_+0x10> + 40102d: 0f 1f 00 nopl (%rax) + 401030: f3 0f 1e fa endbr64 + 401034: 68 00 00 00 00 push $0x0 + 401039: f2 e9 e1 ff ff ff bnd jmp 401020 <_init+0x20> + 40103f: 90 nop + 401040: f3 0f 1e fa endbr64 + 401044: 68 01 00 00 00 push $0x1 + 401049: f2 e9 d1 ff ff ff bnd jmp 401020 <_init+0x20> + 40104f: 90 nop + 401050: f3 0f 1e fa endbr64 + 401054: 68 02 00 00 00 push $0x2 + 401059: f2 e9 c1 ff ff ff bnd jmp 401020 <_init+0x20> + 40105f: 90 nop + 401060: f3 0f 1e fa endbr64 + 401064: 68 03 00 00 00 push $0x3 + 401069: f2 e9 b1 ff ff ff bnd jmp 401020 <_init+0x20> + 40106f: 90 nop + 401070: f3 0f 1e fa endbr64 + 401074: 68 04 00 00 00 push $0x4 + 401079: f2 e9 a1 ff ff ff bnd jmp 401020 <_init+0x20> + 40107f: 90 nop + 401080: f3 0f 1e fa endbr64 + 401084: 68 05 00 00 00 push $0x5 + 401089: f2 e9 91 ff ff ff bnd jmp 401020 <_init+0x20> + 40108f: 90 nop + 401090: f3 0f 1e fa endbr64 + 401094: 68 06 00 00 00 push $0x6 + 401099: f2 e9 81 ff ff ff bnd jmp 401020 <_init+0x20> + 40109f: 90 nop + 4010a0: f3 0f 1e fa endbr64 + 4010a4: 68 07 00 00 00 push $0x7 + 4010a9: f2 e9 71 ff ff ff bnd jmp 401020 <_init+0x20> + 4010af: 90 nop + 4010b0: f3 0f 1e fa endbr64 + 4010b4: 68 08 00 00 00 push $0x8 + 4010b9: f2 e9 61 ff ff ff bnd jmp 401020 <_init+0x20> + 4010bf: 90 nop + 4010c0: f3 0f 1e fa endbr64 + 4010c4: 68 09 00 00 00 push $0x9 + 4010c9: f2 e9 51 ff ff ff bnd jmp 401020 <_init+0x20> + 4010cf: 90 nop + 4010d0: f3 0f 1e fa endbr64 + 4010d4: 68 0a 00 00 00 push $0xa + 4010d9: f2 e9 41 ff ff ff bnd jmp 401020 <_init+0x20> + 4010df: 90 nop + 4010e0: f3 0f 1e fa endbr64 + 4010e4: 68 0b 00 00 00 push $0xb + 4010e9: f2 e9 31 ff ff ff bnd jmp 401020 <_init+0x20> + 4010ef: 90 nop + 4010f0: f3 0f 1e fa endbr64 + 4010f4: 68 0c 00 00 00 push $0xc + 4010f9: f2 e9 21 ff ff ff bnd jmp 401020 <_init+0x20> + 4010ff: 90 nop + 401100: f3 0f 1e fa endbr64 + 401104: 68 0d 00 00 00 push $0xd + 401109: f2 e9 11 ff ff ff bnd jmp 401020 <_init+0x20> + 40110f: 90 nop + 401110: f3 0f 1e fa endbr64 + 401114: 68 0e 00 00 00 push $0xe + 401119: f2 e9 01 ff ff ff bnd jmp 401020 <_init+0x20> + 40111f: 90 nop + 401120: f3 0f 1e fa endbr64 + 401124: 68 0f 00 00 00 push $0xf + 401129: f2 e9 f1 fe ff ff bnd jmp 401020 <_init+0x20> + 40112f: 90 nop + 401130: f3 0f 1e fa endbr64 + 401134: 68 10 00 00 00 push $0x10 + 401139: f2 e9 e1 fe ff ff bnd jmp 401020 <_init+0x20> + 40113f: 90 nop + 401140: f3 0f 1e fa endbr64 + 401144: 68 11 00 00 00 push $0x11 + 401149: f2 e9 d1 fe ff ff bnd jmp 401020 <_init+0x20> + 40114f: 90 nop + 401150: f3 0f 1e fa endbr64 + 401154: 68 12 00 00 00 push $0x12 + 401159: f2 e9 c1 fe ff ff bnd jmp 401020 <_init+0x20> + 40115f: 90 nop + 401160: f3 0f 1e fa endbr64 + 401164: 68 13 00 00 00 push $0x13 + 401169: f2 e9 b1 fe ff ff bnd jmp 401020 <_init+0x20> + 40116f: 90 nop + 401170: f3 0f 1e fa endbr64 + 401174: 68 14 00 00 00 push $0x14 + 401179: f2 e9 a1 fe ff ff bnd jmp 401020 <_init+0x20> + 40117f: 90 nop + 401180: f3 0f 1e fa endbr64 + 401184: 68 15 00 00 00 push $0x15 + 401189: f2 e9 91 fe ff ff bnd jmp 401020 <_init+0x20> + 40118f: 90 nop + 401190: f3 0f 1e fa endbr64 + 401194: 68 16 00 00 00 push $0x16 + 401199: f2 e9 81 fe ff ff bnd jmp 401020 <_init+0x20> + 40119f: 90 nop + 4011a0: f3 0f 1e fa endbr64 + 4011a4: 68 17 00 00 00 push $0x17 + 4011a9: f2 e9 71 fe ff ff bnd jmp 401020 <_init+0x20> + 4011af: 90 nop + 4011b0: f3 0f 1e fa endbr64 + 4011b4: 68 18 00 00 00 push $0x18 + 4011b9: f2 e9 61 fe ff ff bnd jmp 401020 <_init+0x20> + 4011bf: 90 nop + 4011c0: f3 0f 1e fa endbr64 + 4011c4: 68 19 00 00 00 push $0x19 + 4011c9: f2 e9 51 fe ff ff bnd jmp 401020 <_init+0x20> + 4011cf: 90 nop + 4011d0: f3 0f 1e fa endbr64 + 4011d4: 68 1a 00 00 00 push $0x1a + 4011d9: f2 e9 41 fe ff ff bnd jmp 401020 <_init+0x20> + 4011df: 90 nop + 4011e0: f3 0f 1e fa endbr64 + 4011e4: 68 1b 00 00 00 push $0x1b + 4011e9: f2 e9 31 fe ff ff bnd jmp 401020 <_init+0x20> + 4011ef: 90 nop + 4011f0: f3 0f 1e fa endbr64 + 4011f4: 68 1c 00 00 00 push $0x1c + 4011f9: f2 e9 21 fe ff ff bnd jmp 401020 <_init+0x20> + 4011ff: 90 nop + +Disassembly of section .plt.sec: + +0000000000401200 : + 401200: f3 0f 1e fa endbr64 + 401204: f2 ff 25 0d 3e 00 00 bnd jmp *0x3e0d(%rip) # 405018 + 40120b: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) + +0000000000401210 : + 401210: f3 0f 1e fa endbr64 + 401214: f2 ff 25 05 3e 00 00 bnd jmp *0x3e05(%rip) # 405020 + 40121b: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) + +0000000000401220 <__errno_location@plt>: + 401220: f3 0f 1e fa endbr64 + 401224: f2 ff 25 fd 3d 00 00 bnd jmp *0x3dfd(%rip) # 405028 <__errno_location@GLIBC_2.2.5> + 40122b: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) + +0000000000401230 : + 401230: f3 0f 1e fa endbr64 + 401234: f2 ff 25 f5 3d 00 00 bnd jmp *0x3df5(%rip) # 405030 + 40123b: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) + +0000000000401240 : + 401240: f3 0f 1e fa endbr64 + 401244: f2 ff 25 ed 3d 00 00 bnd jmp *0x3ded(%rip) # 405038 + 40124b: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) + +0000000000401250 : + 401250: f3 0f 1e fa endbr64 + 401254: f2 ff 25 e5 3d 00 00 bnd jmp *0x3de5(%rip) # 405040 + 40125b: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) + +0000000000401260 : + 401260: f3 0f 1e fa endbr64 + 401264: f2 ff 25 dd 3d 00 00 bnd jmp *0x3ddd(%rip) # 405048 + 40126b: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) + +0000000000401270 <__stack_chk_fail@plt>: + 401270: f3 0f 1e fa endbr64 + 401274: f2 ff 25 d5 3d 00 00 bnd jmp *0x3dd5(%rip) # 405050 <__stack_chk_fail@GLIBC_2.4> + 40127b: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) + +0000000000401280 : + 401280: f3 0f 1e fa endbr64 + 401284: f2 ff 25 cd 3d 00 00 bnd jmp *0x3dcd(%rip) # 405058 + 40128b: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) + +0000000000401290 : + 401290: f3 0f 1e fa endbr64 + 401294: f2 ff 25 c5 3d 00 00 bnd jmp *0x3dc5(%rip) # 405060 + 40129b: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) + +00000000004012a0 : + 4012a0: f3 0f 1e fa endbr64 + 4012a4: f2 ff 25 bd 3d 00 00 bnd jmp *0x3dbd(%rip) # 405068 + 4012ab: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) + +00000000004012b0 : + 4012b0: f3 0f 1e fa endbr64 + 4012b4: f2 ff 25 b5 3d 00 00 bnd jmp *0x3db5(%rip) # 405070 + 4012bb: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) + +00000000004012c0 : + 4012c0: f3 0f 1e fa endbr64 + 4012c4: f2 ff 25 ad 3d 00 00 bnd jmp *0x3dad(%rip) # 405078 + 4012cb: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) + +00000000004012d0 : + 4012d0: f3 0f 1e fa endbr64 + 4012d4: f2 ff 25 a5 3d 00 00 bnd jmp *0x3da5(%rip) # 405080 + 4012db: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) + +00000000004012e0 : + 4012e0: f3 0f 1e fa endbr64 + 4012e4: f2 ff 25 9d 3d 00 00 bnd jmp *0x3d9d(%rip) # 405088 + 4012eb: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) + +00000000004012f0 <__memmove_chk@plt>: + 4012f0: f3 0f 1e fa endbr64 + 4012f4: f2 ff 25 95 3d 00 00 bnd jmp *0x3d95(%rip) # 405090 <__memmove_chk@GLIBC_2.3.4> + 4012fb: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) + +0000000000401300 : + 401300: f3 0f 1e fa endbr64 + 401304: f2 ff 25 8d 3d 00 00 bnd jmp *0x3d8d(%rip) # 405098 + 40130b: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) + +0000000000401310 : + 401310: f3 0f 1e fa endbr64 + 401314: f2 ff 25 85 3d 00 00 bnd jmp *0x3d85(%rip) # 4050a0 + 40131b: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) + +0000000000401320 <__isoc99_sscanf@plt>: + 401320: f3 0f 1e fa endbr64 + 401324: f2 ff 25 7d 3d 00 00 bnd jmp *0x3d7d(%rip) # 4050a8 <__isoc99_sscanf@GLIBC_2.7> + 40132b: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) + +0000000000401330 <__printf_chk@plt>: + 401330: f3 0f 1e fa endbr64 + 401334: f2 ff 25 75 3d 00 00 bnd jmp *0x3d75(%rip) # 4050b0 <__printf_chk@GLIBC_2.3.4> + 40133b: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) + +0000000000401340 : + 401340: f3 0f 1e fa endbr64 + 401344: f2 ff 25 6d 3d 00 00 bnd jmp *0x3d6d(%rip) # 4050b8 + 40134b: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) + +0000000000401350 : + 401350: f3 0f 1e fa endbr64 + 401354: f2 ff 25 65 3d 00 00 bnd jmp *0x3d65(%rip) # 4050c0 + 40135b: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) + +0000000000401360 : + 401360: f3 0f 1e fa endbr64 + 401364: f2 ff 25 5d 3d 00 00 bnd jmp *0x3d5d(%rip) # 4050c8 + 40136b: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) + +0000000000401370 : + 401370: f3 0f 1e fa endbr64 + 401374: f2 ff 25 55 3d 00 00 bnd jmp *0x3d55(%rip) # 4050d0 + 40137b: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) + +0000000000401380 <__fprintf_chk@plt>: + 401380: f3 0f 1e fa endbr64 + 401384: f2 ff 25 4d 3d 00 00 bnd jmp *0x3d4d(%rip) # 4050d8 <__fprintf_chk@GLIBC_2.3.4> + 40138b: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) + +0000000000401390 : + 401390: f3 0f 1e fa endbr64 + 401394: f2 ff 25 45 3d 00 00 bnd jmp *0x3d45(%rip) # 4050e0 + 40139b: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) + +00000000004013a0 <__ctype_b_loc@plt>: + 4013a0: f3 0f 1e fa endbr64 + 4013a4: f2 ff 25 3d 3d 00 00 bnd jmp *0x3d3d(%rip) # 4050e8 <__ctype_b_loc@GLIBC_2.3> + 4013ab: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) + +00000000004013b0 <__sprintf_chk@plt>: + 4013b0: f3 0f 1e fa endbr64 + 4013b4: f2 ff 25 35 3d 00 00 bnd jmp *0x3d35(%rip) # 4050f0 <__sprintf_chk@GLIBC_2.3.4> + 4013bb: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) + +00000000004013c0 : + 4013c0: f3 0f 1e fa endbr64 + 4013c4: f2 ff 25 2d 3d 00 00 bnd jmp *0x3d2d(%rip) # 4050f8 + 4013cb: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) + +Disassembly of section .text: + +00000000004013d0 <_start>: + 4013d0: f3 0f 1e fa endbr64 + 4013d4: 31 ed xor %ebp,%ebp + 4013d6: 49 89 d1 mov %rdx,%r9 + 4013d9: 5e pop %rsi + 4013da: 48 89 e2 mov %rsp,%rdx + 4013dd: 48 83 e4 f0 and $0xfffffffffffffff0,%rsp + 4013e1: 50 push %rax + 4013e2: 54 push %rsp + 4013e3: 45 31 c0 xor %r8d,%r8d + 4013e6: 31 c9 xor %ecx,%ecx + 4013e8: 48 c7 c7 b6 14 40 00 mov $0x4014b6,%rdi + 4013ef: ff 15 fb 3b 00 00 call *0x3bfb(%rip) # 404ff0 <__libc_start_main@GLIBC_2.34> + 4013f5: f4 hlt + 4013f6: 66 2e 0f 1f 84 00 00 cs nopw 0x0(%rax,%rax,1) + 4013fd: 00 00 00 + +0000000000401400 <_dl_relocate_static_pie>: + 401400: f3 0f 1e fa endbr64 + 401404: c3 ret + 401405: 66 2e 0f 1f 84 00 00 cs nopw 0x0(%rax,%rax,1) + 40140c: 00 00 00 + 40140f: 90 nop + +0000000000401410 : + 401410: b8 80 57 40 00 mov $0x405780,%eax + 401415: 48 3d 80 57 40 00 cmp $0x405780,%rax + 40141b: 74 13 je 401430 + 40141d: b8 00 00 00 00 mov $0x0,%eax + 401422: 48 85 c0 test %rax,%rax + 401425: 74 09 je 401430 + 401427: bf 80 57 40 00 mov $0x405780,%edi + 40142c: ff e0 jmp *%rax + 40142e: 66 90 xchg %ax,%ax + 401430: c3 ret + 401431: 66 66 2e 0f 1f 84 00 data16 cs nopw 0x0(%rax,%rax,1) + 401438: 00 00 00 00 + 40143c: 0f 1f 40 00 nopl 0x0(%rax) + +0000000000401440 : + 401440: be 80 57 40 00 mov $0x405780,%esi + 401445: 48 81 ee 80 57 40 00 sub $0x405780,%rsi + 40144c: 48 89 f0 mov %rsi,%rax + 40144f: 48 c1 ee 3f shr $0x3f,%rsi + 401453: 48 c1 f8 03 sar $0x3,%rax + 401457: 48 01 c6 add %rax,%rsi + 40145a: 48 d1 fe sar $1,%rsi + 40145d: 74 11 je 401470 + 40145f: b8 00 00 00 00 mov $0x0,%eax + 401464: 48 85 c0 test %rax,%rax + 401467: 74 07 je 401470 + 401469: bf 80 57 40 00 mov $0x405780,%edi + 40146e: ff e0 jmp *%rax + 401470: c3 ret + 401471: 66 66 2e 0f 1f 84 00 data16 cs nopw 0x0(%rax,%rax,1) + 401478: 00 00 00 00 + 40147c: 0f 1f 40 00 nopl 0x0(%rax) + +0000000000401480 <__do_global_dtors_aux>: + 401480: f3 0f 1e fa endbr64 + 401484: 80 3d 1d 43 00 00 00 cmpb $0x0,0x431d(%rip) # 4057a8 + 40148b: 75 13 jne 4014a0 <__do_global_dtors_aux+0x20> + 40148d: 55 push %rbp + 40148e: 48 89 e5 mov %rsp,%rbp + 401491: e8 7a ff ff ff call 401410 + 401496: c6 05 0b 43 00 00 01 movb $0x1,0x430b(%rip) # 4057a8 + 40149d: 5d pop %rbp + 40149e: c3 ret + 40149f: 90 nop + 4014a0: c3 ret + 4014a1: 66 66 2e 0f 1f 84 00 data16 cs nopw 0x0(%rax,%rax,1) + 4014a8: 00 00 00 00 + 4014ac: 0f 1f 40 00 nopl 0x0(%rax) + +00000000004014b0 : + 4014b0: f3 0f 1e fa endbr64 + 4014b4: eb 8a jmp 401440 + +00000000004014b6
: + 4014b6: f3 0f 1e fa endbr64 + 4014ba: 53 push %rbx + 4014bb: 83 ff 01 cmp $0x1,%edi + 4014be: 0f 84 f8 00 00 00 je 4015bc + 4014c4: 48 89 f3 mov %rsi,%rbx + 4014c7: 83 ff 02 cmp $0x2,%edi + 4014ca: 0f 85 21 01 00 00 jne 4015f1 + 4014d0: 48 8b 7e 08 mov 0x8(%rsi),%rdi + 4014d4: 48 8d 35 29 1b 00 00 lea 0x1b29(%rip),%rsi # 403004 <_IO_stdin_used+0x4> + 4014db: e8 60 fe ff ff call 401340 + 4014e0: 48 89 05 c9 42 00 00 mov %rax,0x42c9(%rip) # 4057b0 + 4014e7: 48 85 c0 test %rax,%rax + 4014ea: 0f 84 df 00 00 00 je 4015cf + 4014f0: e8 d1 06 00 00 call 401bc6 + 4014f5: 48 8d 3d 8c 1b 00 00 lea 0x1b8c(%rip),%rdi # 403088 <_IO_stdin_used+0x88> + 4014fc: e8 3f fd ff ff call 401240 + 401501: 48 8d 3d c0 1b 00 00 lea 0x1bc0(%rip),%rdi # 4030c8 <_IO_stdin_used+0xc8> + 401508: e8 33 fd ff ff call 401240 + 40150d: e8 ca 09 00 00 call 401edc + 401512: 48 89 c7 mov %rax,%rdi + 401515: e8 fa 00 00 00 call 401614 + 40151a: e8 f5 0a 00 00 call 402014 + 40151f: 48 8d 3d d2 1b 00 00 lea 0x1bd2(%rip),%rdi # 4030f8 <_IO_stdin_used+0xf8> + 401526: e8 15 fd ff ff call 401240 + 40152b: e8 ac 09 00 00 call 401edc + 401530: 48 89 c7 mov %rax,%rdi + 401533: e8 00 01 00 00 call 401638 + 401538: e8 d7 0a 00 00 call 402014 + 40153d: 48 8d 3d f9 1a 00 00 lea 0x1af9(%rip),%rdi # 40303d <_IO_stdin_used+0x3d> + 401544: e8 f7 fc ff ff call 401240 + 401549: e8 8e 09 00 00 call 401edc + 40154e: 48 89 c7 mov %rax,%rdi + 401551: e8 54 01 00 00 call 4016aa + 401556: e8 b9 0a 00 00 call 402014 + 40155b: 48 8d 3d f9 1a 00 00 lea 0x1af9(%rip),%rdi # 40305b <_IO_stdin_used+0x5b> + 401562: e8 d9 fc ff ff call 401240 + 401567: e8 70 09 00 00 call 401edc + 40156c: 48 89 c7 mov %rax,%rdi + 40156f: e8 2c 02 00 00 call 4017a0 + 401574: e8 9b 0a 00 00 call 402014 + 401579: 48 8d 3d a8 1b 00 00 lea 0x1ba8(%rip),%rdi # 403128 <_IO_stdin_used+0x128> + 401580: e8 bb fc ff ff call 401240 + 401585: e8 52 09 00 00 call 401edc + 40158a: 48 89 c7 mov %rax,%rdi + 40158d: e8 83 02 00 00 call 401815 + 401592: e8 7d 0a 00 00 call 402014 + 401597: 48 8d 3d cc 1a 00 00 lea 0x1acc(%rip),%rdi # 40306a <_IO_stdin_used+0x6a> + 40159e: e8 9d fc ff ff call 401240 + 4015a3: e8 34 09 00 00 call 401edc + 4015a8: 48 89 c7 mov %rax,%rdi + 4015ab: e8 fc 02 00 00 call 4018ac + 4015b0: e8 5f 0a 00 00 call 402014 + 4015b5: b8 00 00 00 00 mov $0x0,%eax + 4015ba: 5b pop %rbx + 4015bb: c3 ret + 4015bc: 48 8b 05 cd 41 00 00 mov 0x41cd(%rip),%rax # 405790 + 4015c3: 48 89 05 e6 41 00 00 mov %rax,0x41e6(%rip) # 4057b0 + 4015ca: e9 21 ff ff ff jmp 4014f0 + 4015cf: 48 8b 4b 08 mov 0x8(%rbx),%rcx + 4015d3: 48 8b 13 mov (%rbx),%rdx + 4015d6: 48 8d 35 29 1a 00 00 lea 0x1a29(%rip),%rsi # 403006 <_IO_stdin_used+0x6> + 4015dd: bf 01 00 00 00 mov $0x1,%edi + 4015e2: e8 49 fd ff ff call 401330 <__printf_chk@plt> + 4015e7: bf 08 00 00 00 mov $0x8,%edi + 4015ec: e8 6f fd ff ff call 401360 + 4015f1: 48 8b 16 mov (%rsi),%rdx + 4015f4: 48 8d 35 28 1a 00 00 lea 0x1a28(%rip),%rsi # 403023 <_IO_stdin_used+0x23> + 4015fb: bf 01 00 00 00 mov $0x1,%edi + 401600: b8 00 00 00 00 mov $0x0,%eax + 401605: e8 26 fd ff ff call 401330 <__printf_chk@plt> + 40160a: bf 08 00 00 00 mov $0x8,%edi + 40160f: e8 4c fd ff ff call 401360 + +0000000000401614 : + 401614: f3 0f 1e fa endbr64 + 401618: 48 83 ec 08 sub $0x8,%rsp + 40161c: 48 8d 35 29 1b 00 00 lea 0x1b29(%rip),%rsi # 40314c <_IO_stdin_used+0x14c> + 401623: e8 3e 05 00 00 call 401b66 + 401628: 85 c0 test %eax,%eax + 40162a: 75 05 jne 401631 + 40162c: 48 83 c4 08 add $0x8,%rsp + 401630: c3 ret + 401631: e8 1f 08 00 00 call 401e55 + 401636: eb f4 jmp 40162c + +0000000000401638 : + 401638: f3 0f 1e fa endbr64 + 40163c: 55 push %rbp + 40163d: 53 push %rbx + 40163e: 48 83 ec 28 sub $0x28,%rsp + 401642: 64 48 8b 04 25 28 00 mov %fs:0x28,%rax //rax=0x405870 + 401649: 00 00 + 40164b: 48 89 44 24 18 mov %rax,0x18(%rsp) + 401650: 31 c0 xor %eax,%eax + 401652: 48 89 e6 mov %rsp,%rsi + 401655: e8 3d 08 00 00 call 401e97 //len!=6 bomb 格式是 %d %d %d %d %d %d + 40165a: 83 3c 24 00 cmpl $0x0,(%rsp) + 40165e: 78 0a js 40166a // *rsp==0 goto explode_bomb + 401660: 48 89 e5 mov %rsp,%rbp + 401663: bb 01 00 00 00 mov $0x1,%ebx // ebx 初始值:1 + 401668: eb 13 jmp 40167d // 40167d + ---------------------- + 40166a: e8 e6 07 00 00 call 401e55 + 40166f: eb ef jmp 401660 + 》》》》》》》》》》》》》》》》》》》 + 401671: 83 c3 01 add $0x1,%ebx // rbx=2 + 401674: 48 83 c5 04 add $0x4,%rbp // rbp指向输入的第二个数字 + 401678: 83 fb 06 cmp $0x6,%ebx // rbx-6==0->goto* rbx:for循环内变量 + 40167b: 74 11 je 40168e + ***************************** + ---------------------- + 40167d: 89 d8 mov %ebx,%eax // + 40167f: 03 45 00 add 0x0(%rbp),%eax //eax += *rbp rbp:输入的数字 ;eax=[1+input[0],2+input[1],...]: (n+1)+input[n]: 0 1 3 6 10 15 + 401682: 39 45 04 cmp %eax,0x4(%rbp) // *(rbp+4)-eax==0->bomb , rbp 输入的第x+1个数字 + 401685: 74 ea je 401671 + 》》》》》》》》》》》》》》》》》》》 + 401687: e8 c9 07 00 00 call 401e55 + 40168c: eb e3 jmp 401671 + ****************************** + 40168e: 48 8b 44 24 18 mov 0x18(%rsp),%rax //rax = *rsp+16+8 + 401693: 64 48 2b 04 25 28 00 sub %fs:0x28,%rax + 40169a: 00 00 + 40169c: 75 07 jne 4016a5 + 40169e: 48 83 c4 28 add $0x28,%rsp + 4016a2: 5b pop %rbx + 4016a3: 5d pop %rbp + 4016a4: c3 ret + 4016a5: e8 c6 fb ff ff call 401270 <__stack_chk_fail@plt> + +00000000004016aa : + 4016aa: f3 0f 1e fa endbr64 + 4016ae: 48 83 ec 18 sub $0x18,%rsp + 4016b2: 64 48 8b 04 25 28 00 mov %fs:0x28,%rax + 4016b9: 00 00 + 4016bb: 48 89 44 24 08 mov %rax,0x8(%rsp) + 4016c0: 31 c0 xor %eax,%eax // 清空eax + 4016c2: 48 8d 4c 24 04 lea 0x4(%rsp),%rcx //rsp+4->eax + 4016c7: 48 89 e2 mov %rsp,%rdx //rsp->rdx + 4016ca: 48 8d 35 5c 1d 00 00 lea 0x1d5c(%rip),%rsi # 40342d + 4016d1: e8 4a fc ff ff call 401320 <__isoc99_sscanf@plt> + 4016d6: 83 f8 01 cmp $0x1,%eax + 4016d9: 7e 1a jle 4016f5 + 4016db: 83 3c 24 07 cmpl $0x7,(%rsp) + 4016df: 77 65 ja 401746 + 4016e1: 8b 04 24 mov (%rsp),%eax + 4016e4: 48 8d 15 95 1a 00 00 lea 0x1a95(%rip),%rdx # 403180 <_IO_stdin_used+0x180> format=0x40342d "%d %d" + 4016eb: 48 63 04 82 movslq (%rdx,%rax,4),%rax + 4016ef: 48 01 d0 add %rdx,%rax + 4016f2: 3e ff e0 notrack jmp *%rax // 0 -> 0x401752 + 4016f5: e8 5b 07 00 00 call 401e55 + 4016fa: eb df jmp 4016db + 4016fc: b8 85 02 00 00 mov $0x285,%eax + 401701: 39 44 24 04 cmp %eax,0x4(%rsp) // *(rsp+4)!=eax!=bomb + 401705: 75 52 jne 401759 + 401707: 48 8b 44 24 08 mov 0x8(%rsp),%rax + 40170c: 64 48 2b 04 25 28 00 sub %fs:0x28,%rax + 401713: 00 00 + 401715: 75 49 jne 401760 + 401717: 48 83 c4 18 add $0x18,%rsp + 40171b: c3 ret + 40171c: b8 69 00 00 00 mov $0x69,%eax + 401721: eb de jmp 401701 + 401723: b8 5b 02 00 00 mov $0x25b,%eax + 401728: eb d7 jmp 401701 + 40172a: b8 32 00 00 00 mov $0x32,%eax + 40172f: eb d0 jmp 401701 + 401731: b8 f3 01 00 00 mov $0x1f3,%eax + 401736: eb c9 jmp 401701 + 401738: b8 8f 00 00 00 mov $0x8f,%eax + 40173d: eb c2 jmp 401701 + 40173f: b8 0a 03 00 00 mov $0x30a,%eax + 401744: eb bb jmp 401701 + 401746: e8 0a 07 00 00 call 401e55 + 40174b: b8 00 00 00 00 mov $0x0,%eax + 401750: eb af jmp 401701 + 401752: b8 0f 01 00 00 mov $0x10f,%eax //271 + 401757: eb a8 jmp 401701 + 401759: e8 f7 06 00 00 call 401e55 + 40175e: eb a7 jmp 401707 + 401760: e8 0b fb ff ff call 401270 <__stack_chk_fail@plt> + +0000000000401765 : // x = 7;x>=0;x-- x in rdi + 401765: f3 0f 1e fa endbr64 + 401769: b8 00 00 00 00 mov $0x0,%eax + 40176e: 85 ff test %edi,%edi + 401770: 7e 2d jle 40179f + 401772: 41 54 push %r12 + 401774: 55 push %rbp + 401775: 53 push %rbx + 401776: 89 fb mov %edi,%ebx + 401778: 89 f5 mov %esi,%ebp + 40177a: 89 f0 mov %esi,%eax + 40177c: 83 ff 01 cmp $0x1,%edi + 40177f: 74 19 je 40179a + 401781: 8d 7f ff lea -0x1(%rdi),%edi + 401784: e8 dc ff ff ff call 401765 + 401789: 44 8d 24 28 lea (%rax,%rbp,1),%r12d + 40178d: 8d 7b fe lea -0x2(%rbx),%edi + 401790: 89 ee mov %ebp,%esi + 401792: e8 ce ff ff ff call 401765 + 401797: 44 01 e0 add %r12d,%eax + 40179a: 5b pop %rbx + 40179b: 5d pop %rbp + 40179c: 41 5c pop %r12 + 40179e: c3 ret + 40179f: c3 ret + +00000000004017a0 : + 4017a0: f3 0f 1e fa endbr64 + 4017a4: 48 83 ec 18 sub $0x18,%rsp + 4017a8: 64 48 8b 04 25 28 00 mov %fs:0x28,%rax + 4017af: 00 00 + 4017b1: 48 89 44 24 08 mov %rax,0x8(%rsp) + 4017b6: 31 c0 xor %eax,%eax + 4017b8: 48 89 e1 mov %rsp,%rcx + 4017bb: 48 8d 54 24 04 lea 0x4(%rsp),%rdx + 4017c0: 48 8d 35 66 1c 00 00 lea 0x1c66(%rip),%rsi # 40342d + 4017c7: e8 54 fb ff ff call 401320 <__isoc99_sscanf@plt> // %d %d + 4017cc: 83 f8 02 cmp $0x2,%eax + 4017cf: 75 0b jne 4017dc + 4017d1: 8b 04 24 mov (%rsp),%eax // 第二个数字 (unsigned)d2-2 <= 2 -> !bomb + 4017d4: 83 e8 02 sub $0x2,%eax // 2 <= d2 <= 4 + 4017d7: 83 f8 02 cmp $0x2,%eax + 4017da: 76 05 jbe 4017e1 + 4017dc: e8 74 06 00 00 call 401e55 + 4017e1: 8b 34 24 mov (%rsp),%esi // 第二个数字 + 4017e4: bf 07 00 00 00 mov $0x7,%edi + 4017e9: e8 77 ff ff ff call 401765 + 4017ee: 39 44 24 04 cmp %eax,0x4(%rsp) // + 4017f2: 75 15 jne 401809 + 4017f4: 48 8b 44 24 08 mov 0x8(%rsp),%rax + 4017f9: 64 48 2b 04 25 28 00 sub %fs:0x28,%rax + 401800: 00 00 + 401802: 75 0c jne 401810 + 401804: 48 83 c4 18 add $0x18,%rsp + 401808: c3 ret + 401809: e8 47 06 00 00 call 401e55 + 40180e: eb e4 jmp 4017f4 + 401810: e8 5b fa ff ff call 401270 <__stack_chk_fail@plt> + +0000000000401815 : + 401815: f3 0f 1e fa endbr64 + 401819: 48 83 ec 18 sub $0x18,%rsp + 40181d: 64 48 8b 04 25 28 00 mov %fs:0x28,%rax + 401824: 00 00 + 401826: 48 89 44 24 08 mov %rax,0x8(%rsp) + 40182b: 31 c0 xor %eax,%eax + 40182d: 48 8d 4c 24 04 lea 0x4(%rsp),%rcx + 401832: 48 89 e2 mov %rsp,%rdx + 401835: 48 8d 35 f1 1b 00 00 lea 0x1bf1(%rip),%rsi # 40342d + 40183c: e8 df fa ff ff call 401320 <__isoc99_sscanf@plt> // %d %d + 401841: 83 f8 01 cmp $0x1,%eax + 401844: 7e 5a jle 4018a0 + 401846: 8b 04 24 mov (%rsp),%eax //第一个输入的数字 + 401849: 83 e0 0f and $0xf,%eax + 40184c: 89 04 24 mov %eax,(%rsp) + 40184f: 83 f8 0f cmp $0xf,%eax //eax&0xF-0xF==0 ->bomb ->eax!=15 + 401852: 74 32 je 401886 + 401854: b9 00 00 00 00 mov $0x0,%ecx + 401859: ba 00 00 00 00 mov $0x0,%edx + 40185e: 48 8d 35 3b 19 00 00 lea 0x193b(%rip),%rsi # 4031a0 : + 0x4031a0 : 10 2 14 7 + 0x4031b0 : 8 12 15 11 + 0x4031c0 : 0 4 1 13 + 0x4031d0 : 3 9 6 5 + ---------------------------- + 401865: 83 c2 01 add $0x1,%edx + 401868: 48 98 cltq + 40186a: 8b 04 86 mov (%rsi,%rax,4),%eax // eax=4*rax+0x4031a0 所以第一个数字小于等于15 第一次是第一个数字,找14次到15 + 40186d: 01 c1 add %eax,%ecx // ecx+=eax + 40186f: 83 f8 0f cmp $0xf,%eax + 401872: 75 f1 jne 401865 // eax==15 继续 + 401874: c7 04 24 0f 00 00 00 movl $0xf,(%rsp) + 40187b: 83 fa 0f cmp $0xf,%edx + 40187e: 75 06 jne 401886 //必须循环15次 + 401880: 39 4c 24 04 cmp %ecx,0x4(%rsp) //ecx==第二个数字 + 401884: 74 05 je 40188b + 401886: e8 ca 05 00 00 call 401e55 + 40188b: 48 8b 44 24 08 mov 0x8(%rsp),%rax + 401890: 64 48 2b 04 25 28 00 sub %fs:0x28,%rax + 401897: 00 00 + 401899: 75 0c jne 4018a7 + 40189b: 48 83 c4 18 add $0x18,%rsp + 40189f: c3 ret + 4018a0: e8 b0 05 00 00 call 401e55 + 4018a5: eb 9f jmp 401846 + 4018a7: e8 c4 f9 ff ff call 401270 <__stack_chk_fail@plt> + +00000000004018ac : + 4018ac: f3 0f 1e fa endbr64 + 4018b0: 41 57 push %r15 + 4018b2: 41 56 push %r14 + 4018b4: 41 55 push %r13 + 4018b6: 41 54 push %r12 + 4018b8: 55 push %rbp + 4018b9: 53 push %rbx + 4018ba: 48 83 ec 78 sub $0x78,%rsp + 4018be: 64 48 8b 04 25 28 00 mov %fs:0x28,%rax + 4018c5: 00 00 + 4018c7: 48 89 44 24 68 mov %rax,0x68(%rsp) + 4018cc: 31 c0 xor %eax,%eax + 4018ce: 4c 8d 74 24 10 lea 0x10(%rsp),%r14 + 4018d3: 4c 89 74 24 08 mov %r14,0x8(%rsp) + 4018d8: 4c 89 f6 mov %r14,%rsi + 4018db: e8 b7 05 00 00 call 401e97 + 4018e0: 4d 89 f4 mov %r14,%r12 + 4018e3: 41 bf 01 00 00 00 mov $0x1,%r15d + 4018e9: 4d 89 f5 mov %r14,%r13 + 4018ec: e9 c6 00 00 00 jmp 4019b7 + 4018f1: e8 5f 05 00 00 call 401e55 + 4018f6: e9 ce 00 00 00 jmp 4019c9 + >>>>>>>>>>>>>>>>>>>>> + 4018fb: 48 83 c3 01 add $0x1,%rbx + 4018ff: 83 fb 05 cmp $0x5,%ebx + 401902: 0f 8f a7 00 00 00 jg 4019af rbx>5 + ------------------------- + 401908: 41 8b 44 9d 00 mov 0x0(%r13,%rbx,4),%eax // rbx 循环变量, eax为第rbx个数字 + 40190d: 39 45 00 cmp %eax,0x0(%rbp) + 401910: 75 e9 jne 4018fb // 不能连续两个数字一样 + 401912: e8 3e 05 00 00 call 401e55 + 401917: eb e2 jmp 4018fb + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ //这里开始 + 401919: 48 8b 54 24 08 mov 0x8(%rsp),%rdx + 40191e: 48 83 c2 18 add $0x18,%rdx // rdx:数组末尾 + 401922: b9 07 00 00 00 mov $0x7,%ecx + ===== + 401927: 89 c8 mov %ecx,%eax + 401929: 41 2b 04 24 sub (%r12),%eax + 40192d: 41 89 04 24 mov %eax,(%r12) + 401931: 49 83 c4 04 add $0x4,%r12 + 401935: 4c 39 e2 cmp %r12,%rdx + 401938: 75 ed jne 401927 + ====== // 每个数变成7-x_i + 40193a: be 00 00 00 00 mov $0x0,%esi + 40193f: 8b 4c b4 10 mov 0x10(%rsp,%rsi,4),%ecx // ecx是第rsi个数字 + 401943: b8 01 00 00 00 mov $0x1,%eax + 401948: 48 8d 15 e1 39 00 00 lea 0x39e1(%rip),%rdx # 405330 + 0x405330 : 821 0 1 0 21312 64 0 0 + 0x405340 : 620 0 2 0 21328 64 0 0 + 0x405350 : 348 0 3 0 21344 64 0 0 + 0x405360 : 797 0 4 0 21360 64 0 0 + 0x405370 : 456 0 5 0 21008 64 0 0 + 0x405210 : 398 0 6 0 21344 64 0 0 + 40194f: 83 f9 01 cmp $0x1,%ecx + 401952: 7e 0b jle 40195f + 401954: 48 8b 52 08 mov 0x8(%rdx),%rdx // 进入下一个node + 401958: 83 c0 01 add $0x1,%eax + 40195b: 39 c8 cmp %ecx,%eax + 40195d: 75 f5 jne 401954 + 40195f: 48 89 54 f4 30 mov %rdx,0x30(%rsp,%rsi,8) // 结束时候的node + 401964: 48 83 c6 01 add $0x1,%rsi + 401968: 48 83 fe 06 cmp $0x6,%rsi + 40196c: 75 d1 jne 40193f + 40196e: 48 8b 5c 24 30 mov 0x30(%rsp),%rbx // rsp 是 node[7-x_i] + 401973: 48 8b 44 24 38 mov 0x38(%rsp),%rax + 401978: 48 89 43 08 mov %rax,0x8(%rbx) + 40197c: 48 8b 54 24 40 mov 0x40(%rsp),%rdx + 401981: 48 89 50 08 mov %rdx,0x8(%rax) + 401985: 48 8b 44 24 48 mov 0x48(%rsp),%rax + 40198a: 48 89 42 08 mov %rax,0x8(%rdx) + 40198e: 48 8b 54 24 50 mov 0x50(%rsp),%rdx + 401993: 48 89 50 08 mov %rdx,0x8(%rax) + 401997: 48 8b 44 24 58 mov 0x58(%rsp),%rax + 40199c: 48 89 42 08 mov %rax,0x8(%rdx) + 4019a0: 48 c7 40 08 00 00 00 movq $0x0,0x8(%rax) + 4019a7: 00 + 4019a8: bd 05 00 00 00 mov $0x5,%ebp + 4019ad: eb 35 jmp 4019e4 + >>>>>>>>>>>>>>>>>>>> + 4019af: 49 83 c7 01 add $0x1,%r15 + 4019b3: 49 83 c6 04 add $0x4,%r14 + 4019b7: 4c 89 f5 mov %r14,%rbp + 4019ba: 41 8b 06 mov (%r14),%eax + 4019bd: 83 e8 01 sub $0x1,%eax // 第x个数字 -1 > 5 -> bomb| 1 <= x1 <= 6 + 4019c0: 83 f8 05 cmp $0x5,%eax + 4019c3: 0f 87 28 ff ff ff ja 4018f1 + 4019c9: 41 83 ff 05 cmp $0x5,%r15d // r15 > 5 + 4019cd: 0f 8f 46 ff ff ff jg 401919 + 4019d3: 4c 89 fb mov %r15,%rbx + 4019d6: e9 2d ff ff ff jmp 401908 + ------------------------ + 4019db: 48 8b 5b 08 mov 0x8(%rbx),%rbx + 4019df: 83 ed 01 sub $0x1,%ebp + 4019e2: 74 11 je 4019f5 + 4019e4: 48 8b 43 08 mov 0x8(%rbx),%rax + 4019e8: 8b 00 mov (%rax),%eax // eax 是下一个 node + 4019ea: 39 03 cmp %eax,(%rbx) // node[x_i] >= node[x_i+1] + 4019ec: 7d ed jge 4019db // 每一个node要比下一个大 + 4019ee: e8 62 04 00 00 call 401e55 + 4019f3: eb e6 jmp 4019db + 4019f5: 48 8b 44 24 68 mov 0x68(%rsp),%rax + 4019fa: 64 48 2b 04 25 28 00 sub %fs:0x28,%rax + 401a01: 00 00 + 401a03: 75 0f jne 401a14 + 401a05: 48 83 c4 78 add $0x78,%rsp + 401a09: 5b pop %rbx + 401a0a: 5d pop %rbp + 401a0b: 41 5c pop %r12 + 401a0d: 41 5d pop %r13 + 401a0f: 41 5e pop %r14 + 401a11: 41 5f pop %r15 + 401a13: c3 ret + 401a14: e8 57 f8 ff ff call 401270 <__stack_chk_fail@plt> + +0000000000401a19 : + 401a19: f3 0f 1e fa endbr64 + 401a1d: 48 85 ff test %rdi,%rdi + 401a20: 74 32 je 401a54 + 401a22: 48 83 ec 08 sub $0x8,%rsp + 401a26: 8b 17 mov (%rdi),%edx + 401a28: 39 f2 cmp %esi,%edx //esi 输入的数字 + 401a2a: 7f 0c jg 401a38 // edx > esi + 401a2c: b8 00 00 00 00 mov $0x0,%eax + 401a31: 75 12 jne 401a45 + 401a33: 48 83 c4 08 add $0x8,%rsp + 401a37: c3 ret + 401a38: 48 8b 7f 08 mov 0x8(%rdi),%rdi // rdi 到下1个 + 401a3c: e8 d8 ff ff ff call 401a19 + 401a41: 01 c0 add %eax,%eax + 401a43: eb ee jmp 401a33 + 401a45: 48 8b 7f 10 mov 0x10(%rdi),%rdi // rdi 到下2个 + 401a49: e8 cb ff ff ff call 401a19 + 401a4e: 8d 44 00 01 lea 0x1(%rax,%rax,1),%eax // rax = rax*2+1, 目标 5 + 401a52: eb df jmp 401a33 + 401a54: b8 ff ff ff ff mov $0xffffffff,%eax + 401a59: c3 ret + +0000000000401a5a : + 401a5a: f3 0f 1e fa endbr64 + 401a5e: 53 push %rbx + 401a5f: e8 78 04 00 00 call 401edc + 401a64: 48 89 c7 mov %rax,%rdi + 401a67: ba 0a 00 00 00 mov $0xa,%edx + 401a6c: be 00 00 00 00 mov $0x0,%esi + 401a71: e8 8a f8 ff ff call 401300 + 401a76: 89 c3 mov %eax,%ebx + 401a78: 83 e8 01 sub $0x1,%eax + 401a7b: 3d e8 03 00 00 cmp $0x3e8,%eax // eax - 1 > 1000 -> bomb + 401a80: 77 26 ja 401aa8 + 401a82: 89 de mov %ebx,%esi + 401a84: 48 8d 3d c5 37 00 00 lea 0x37c5(%rip),%rdi # 405250 + 0x405250 : 36 0 4215408 0 + 0x405260 : 4215440 0 0 0 + 0x405270 : 8 0 4215536 0 + 0x405280 : 4215472 0 0 0 + 0x405290 : 50 0 4215504 0 + 0x4052a0 : 4215568 0 0 0 + 0x4052b0 : 22 0 4215216 0 + 0x4052c0 : 4215152 0 0 0 + 0x4052d0 : 45 0 4215056 0 + 0x4052e0 : 4215248 0 0 0 + 0x4052f0 : 6 0 4215088 0 + 0x405300 : 4215184 0 0 0 + 0x405310 : 107 0 4215120 0 + 0x405320 : 4215280 0 0 0 +0x405250 : 000024 000000 405270 000000 +0x405260 : 405290 000000 000000 000000 +0x405270 : 000008 000000 4052f0 000000 +0x405280 : 4052b0 000000 000000 000000 +0x405290 : 000032 000000 4052d0 000000 +0x4052a0 : 405310 000000 000000 000000 +0x4052b0 : 000016 000000 4051b0 000000 +0x4052c0 : 405170 000000 000000 000000 +0x4052d0 : 00002d 000000 405110 000000 +0x4052e0 : 4051d0 000000 000000 000000 +0x4052f0 : 000006 000000 405130 000000 +0x405300 : 405190 000000 000000 000000 +0x405310 : 00006b 000000 405150 000000 +0x405320 : 4051f0 000000 000000 000000 + 401a8b: e8 89 ff ff ff call 401a19 + 401a90: 83 f8 05 cmp $0x5,%eax + 401a93: 75 1a jne 401aaf + 401a95: 48 8d 3d 44 17 00 00 lea 0x1744(%rip),%rdi # 4031e0 + 401a9c: e8 9f f7 ff ff call 401240 + 401aa1: e8 6e 05 00 00 call 402014 + 401aa6: 5b pop %rbx + 401aa7: c3 ret + 401aa8: e8 a8 03 00 00 call 401e55 + 401aad: eb d3 jmp 401a82 + 401aaf: e8 a1 03 00 00 call 401e55 + 401ab4: eb df jmp 401a95 + +0000000000401ab6 : + 401ab6: f3 0f 1e fa endbr64 + 401aba: 50 push %rax + 401abb: 58 pop %rax + 401abc: 48 83 ec 08 sub $0x8,%rsp + 401ac0: 48 8d 3d 41 17 00 00 lea 0x1741(%rip),%rdi # 403208 + 401ac7: e8 74 f7 ff ff call 401240 + 401acc: bf 03 00 00 00 mov $0x3,%edi + 401ad1: e8 ba f8 ff ff call 401390 + 401ad6: 48 8d 35 cc 18 00 00 lea 0x18cc(%rip),%rsi # 4033a9 + 401add: bf 01 00 00 00 mov $0x1,%edi + 401ae2: b8 00 00 00 00 mov $0x0,%eax + 401ae7: e8 44 f8 ff ff call 401330 <__printf_chk@plt> + 401aec: 48 8b 3d 8d 3c 00 00 mov 0x3c8d(%rip),%rdi # 405780 + 401af3: e8 18 f8 ff ff call 401310 + 401af8: bf 01 00 00 00 mov $0x1,%edi + 401afd: e8 8e f8 ff ff call 401390 + 401b02: 48 8d 3d a8 18 00 00 lea 0x18a8(%rip),%rdi # 4033b1 + 401b09: e8 32 f7 ff ff call 401240 + 401b0e: bf 10 00 00 00 mov $0x10,%edi + 401b13: e8 48 f8 ff ff call 401360 + +0000000000401b18 : + 401b18: f3 0f 1e fa endbr64 + 401b1c: 50 push %rax + 401b1d: 58 pop %rax + 401b1e: 48 83 ec 08 sub $0x8,%rsp + 401b22: 48 89 fa mov %rdi,%rdx + 401b25: 48 8d 35 8d 18 00 00 lea 0x188d(%rip),%rsi # 4033b9 + 401b2c: bf 01 00 00 00 mov $0x1,%edi + 401b31: b8 00 00 00 00 mov $0x0,%eax + 401b36: e8 f5 f7 ff ff call 401330 <__printf_chk@plt> + 401b3b: bf 08 00 00 00 mov $0x8,%edi + 401b40: e8 1b f8 ff ff call 401360 + +0000000000401b45 : + 401b45: f3 0f 1e fa endbr64 + 401b49: 80 3f 00 cmpb $0x0,(%rdi) // *c == 0 return 0 + 401b4c: 74 12 je 401b60 + 401b4e: b8 00 00 00 00 mov $0x0,%eax // length = 0 + 401b53: 48 83 c7 01 add $0x1,%rdi // c = c+sizeof(char) + 401b57: 83 c0 01 add $0x1,%eax // length++ + 401b5a: 80 3f 00 cmpb $0x0,(%rdi) // *c == 0 return length + 401b5d: 75 f4 jne 401b53 + 401b5f: c3 ret + 401b60: b8 00 00 00 00 mov $0x0,%eax + 401b65: c3 ret + +0000000000401b66 : + 401b66: f3 0f 1e fa endbr64 + 401b6a: 41 54 push %r12 + 401b6c: 55 push %rbp + 401b6d: 53 push %rbx + 401b6e: 48 89 fb mov %rdi,%rbx + 401b71: 48 89 f5 mov %rsi,%rbp + 401b74: e8 cc ff ff ff call 401b45 // la = length(%rdi) + 401b79: 41 89 c4 mov %eax,%r12d + 401b7c: 48 89 ef mov %rbp,%rdi // lb = length(%rdi) %rdi = 0x40314c + 401b7f: e8 c1 ff ff ff call 401b45 // answer len=29 + 401b84: 89 c2 mov %eax,%edx + 401b86: b8 01 00 00 00 mov $0x1,%eax + 401b8b: 41 39 d4 cmp %edx,%r12d + 401b8e: 75 31 jne 401bc1 //401bc1 + 401b90: 0f b6 13 movzbl (%rbx),%edx + 401b93: 84 d2 test %dl,%dl + 401b95: 74 1e je 401bb5 + 401b97: b8 00 00 00 00 mov $0x0,%eax + 401b9c: 38 54 05 00 cmp %dl,0x0(%rbp,%rax,1) + 401ba0: 75 1a jne 401bbc //401bc1 + 401ba2: 48 83 c0 01 add $0x1,%rax + 401ba6: 0f b6 14 03 movzbl (%rbx,%rax,1),%edx + 401baa: 84 d2 test %dl,%dl + 401bac: 75 ee jne 401b9c + 401bae: b8 00 00 00 00 mov $0x0,%eax + 401bb3: eb 0c jmp 401bc1 + 401bb5: b8 00 00 00 00 mov $0x0,%eax + 401bba: eb 05 jmp 401bc1 + 401bbc: b8 01 00 00 00 mov $0x1,%eax + 401bc1: 5b pop %rbx + 401bc2: 5d pop %rbp + 401bc3: 41 5c pop %r12 + 401bc5: c3 ret + +0000000000401bc6 : + 401bc6: f3 0f 1e fa endbr64 + 401bca: 55 push %rbp + 401bcb: 53 push %rbx + 401bcc: 48 81 ec 00 10 00 00 sub $0x1000,%rsp + 401bd3: 48 83 0c 24 00 orq $0x0,(%rsp) + 401bd8: 48 81 ec 00 10 00 00 sub $0x1000,%rsp + 401bdf: 48 83 0c 24 00 orq $0x0,(%rsp) + 401be4: 48 83 ec 58 sub $0x58,%rsp + 401be8: 64 48 8b 04 25 28 00 mov %fs:0x28,%rax + 401bef: 00 00 + 401bf1: 48 89 84 24 48 20 00 mov %rax,0x2048(%rsp) + 401bf8: 00 + 401bf9: 31 c0 xor %eax,%eax + 401bfb: 48 8d 35 b4 fe ff ff lea -0x14c(%rip),%rsi # 401ab6 + 401c02: bf 02 00 00 00 mov $0x2,%edi + 401c07: e8 c4 f6 ff ff call 4012d0 + 401c0c: 48 89 e7 mov %rsp,%rdi + 401c0f: be 40 00 00 00 mov $0x40,%esi + 401c14: e8 37 f7 ff ff call 401350 + 401c19: 85 c0 test %eax,%eax + 401c1b: 75 45 jne 401c62 + 401c1d: 48 8b 3d 5c 37 00 00 mov 0x375c(%rip),%rdi # 405380 + 401c24: 48 8d 1d 5d 37 00 00 lea 0x375d(%rip),%rbx # 405388 + 401c2b: 48 89 e5 mov %rsp,%rbp + 401c2e: 48 85 ff test %rdi,%rdi + 401c31: 74 19 je 401c4c + 401c33: 48 89 ee mov %rbp,%rsi + 401c36: e8 d5 f5 ff ff call 401210 + 401c3b: 85 c0 test %eax,%eax + 401c3d: 74 5e je 401c9d + 401c3f: 48 83 c3 08 add $0x8,%rbx + 401c43: 48 8b 7b f8 mov -0x8(%rbx),%rdi + 401c47: 48 85 ff test %rdi,%rdi + 401c4a: 75 e7 jne 401c33 + 401c4c: 48 8d 3d 25 16 00 00 lea 0x1625(%rip),%rdi # 403278 + 401c53: e8 e8 f5 ff ff call 401240 + 401c58: bf 08 00 00 00 mov $0x8,%edi + 401c5d: e8 fe f6 ff ff call 401360 + 401c62: 48 8d 3d d7 15 00 00 lea 0x15d7(%rip),%rdi # 403240 + 401c69: e8 d2 f5 ff ff call 401240 + 401c6e: bf 08 00 00 00 mov $0x8,%edi + 401c73: e8 e8 f6 ff ff call 401360 + 401c78: 48 8d 54 24 40 lea 0x40(%rsp),%rdx + 401c7d: 48 8d 35 46 17 00 00 lea 0x1746(%rip),%rsi # 4033ca + 401c84: bf 01 00 00 00 mov $0x1,%edi + 401c89: b8 00 00 00 00 mov $0x0,%eax + 401c8e: e8 9d f6 ff ff call 401330 <__printf_chk@plt> + 401c93: bf 08 00 00 00 mov $0x8,%edi + 401c98: e8 c3 f6 ff ff call 401360 + 401c9d: 48 8d 7c 24 40 lea 0x40(%rsp),%rdi + 401ca2: e8 6b 0d 00 00 call 402a12 + 401ca7: 85 c0 test %eax,%eax + 401ca9: 78 cd js 401c78 + 401cab: 48 8b 84 24 48 20 00 mov 0x2048(%rsp),%rax + 401cb2: 00 + 401cb3: 64 48 2b 04 25 28 00 sub %fs:0x28,%rax + 401cba: 00 00 + 401cbc: 75 0a jne 401cc8 + 401cbe: 48 81 c4 58 20 00 00 add $0x2058,%rsp + 401cc5: 5b pop %rbx + 401cc6: 5d pop %rbp + 401cc7: c3 ret + 401cc8: e8 a3 f5 ff ff call 401270 <__stack_chk_fail@plt> + +0000000000401ccd : + 401ccd: f3 0f 1e fa endbr64 + 401cd1: c3 ret + +0000000000401cd2 : + 401cd2: f3 0f 1e fa endbr64 + 401cd6: 55 push %rbp + 401cd7: 53 push %rbx + 401cd8: 48 83 ec 08 sub $0x8,%rsp + 401cdc: 48 89 fd mov %rdi,%rbp + 401cdf: 0f b6 5d 00 movzbl 0x0(%rbp),%ebx + 401ce3: 84 db test %bl,%bl + 401ce5: 74 1e je 401d05 + 401ce7: e8 b4 f6 ff ff call 4013a0 <__ctype_b_loc@plt> + 401cec: 48 83 c5 01 add $0x1,%rbp + 401cf0: 48 0f be db movsbq %bl,%rbx + 401cf4: 48 8b 00 mov (%rax),%rax + 401cf7: f6 44 58 01 20 testb $0x20,0x1(%rax,%rbx,2) + 401cfc: 75 e1 jne 401cdf + 401cfe: b8 00 00 00 00 mov $0x0,%eax + 401d03: eb 05 jmp 401d0a + 401d05: b8 01 00 00 00 mov $0x1,%eax + 401d0a: 48 83 c4 08 add $0x8,%rsp + 401d0e: 5b pop %rbx + 401d0f: 5d pop %rbp + 401d10: c3 ret + +0000000000401d11 : + 401d11: f3 0f 1e fa endbr64 + 401d15: 55 push %rbp + 401d16: 53 push %rbx + 401d17: 48 83 ec 08 sub $0x8,%rsp + 401d1b: 48 8d 2d fe 3a 00 00 lea 0x3afe(%rip),%rbp # 405820 + 401d22: 48 63 05 e7 3a 00 00 movslq 0x3ae7(%rip),%rax # 405810 + 401d29: 48 8d 3c 80 lea (%rax,%rax,4),%rdi + 401d2d: 48 c1 e7 04 shl $0x4,%rdi + 401d31: 48 01 ef add %rbp,%rdi + 401d34: 48 8b 15 75 3a 00 00 mov 0x3a75(%rip),%rdx # 4057b0 + 401d3b: be 50 00 00 00 mov $0x50,%esi + 401d40: e8 6b f5 ff ff call 4012b0 + 401d45: 48 89 c3 mov %rax,%rbx + 401d48: 48 85 c0 test %rax,%rax + 401d4b: 74 0c je 401d59 + 401d4d: 48 89 c7 mov %rax,%rdi + 401d50: e8 7d ff ff ff call 401cd2 + 401d55: 85 c0 test %eax,%eax + 401d57: 75 c9 jne 401d22 + 401d59: 48 89 d8 mov %rbx,%rax + 401d5c: 48 83 c4 08 add $0x8,%rsp + 401d60: 5b pop %rbx + 401d61: 5d pop %rbp + 401d62: c3 ret + +0000000000401d63 : + 401d63: f3 0f 1e fa endbr64 + 401d67: 53 push %rbx + 401d68: 4c 8d 9c 24 00 c0 ff lea -0x4000(%rsp),%r11 + 401d6f: ff + 401d70: 48 81 ec 00 10 00 00 sub $0x1000,%rsp + 401d77: 48 83 0c 24 00 orq $0x0,(%rsp) + 401d7c: 4c 39 dc cmp %r11,%rsp + 401d7f: 75 ef jne 401d70 + 401d81: 48 83 ec 10 sub $0x10,%rsp + 401d85: 64 48 8b 04 25 28 00 mov %fs:0x28,%rax + 401d8c: 00 00 + 401d8e: 48 89 84 24 08 40 00 mov %rax,0x4008(%rsp) + 401d95: 00 + 401d96: 31 c0 xor %eax,%eax + 401d98: 8b 15 72 3a 00 00 mov 0x3a72(%rip),%edx # 405810 + 401d9e: 8d 42 ff lea -0x1(%rdx),%eax + 401da1: 48 98 cltq + 401da3: 48 8d 04 80 lea (%rax,%rax,4),%rax + 401da7: 48 c1 e0 04 shl $0x4,%rax + 401dab: 48 8d 0d 6e 3a 00 00 lea 0x3a6e(%rip),%rcx # 405820 + 401db2: 48 01 c8 add %rcx,%rax + 401db5: 85 ff test %edi,%edi + 401db7: 4c 8d 0d 26 16 00 00 lea 0x1626(%rip),%r9 # 4033e4 + 401dbe: 48 8d 0d 27 16 00 00 lea 0x1627(%rip),%rcx # 4033ec + 401dc5: 4c 0f 44 c9 cmove %rcx,%r9 + 401dc9: 48 89 e3 mov %rsp,%rbx + 401dcc: 50 push %rax + 401dcd: 52 push %rdx + 401dce: 44 8b 05 6f 34 00 00 mov 0x346f(%rip),%r8d # 405244 + 401dd5: 48 8d 0d 19 16 00 00 lea 0x1619(%rip),%rcx # 4033f5 + 401ddc: ba 00 20 00 00 mov $0x2000,%edx + 401de1: be 01 00 00 00 mov $0x1,%esi + 401de6: 48 89 df mov %rbx,%rdi + 401de9: b8 00 00 00 00 mov $0x0,%eax + 401dee: e8 bd f5 ff ff call 4013b0 <__sprintf_chk@plt> + 401df3: 4c 8d 84 24 10 20 00 lea 0x2010(%rsp),%r8 + 401dfa: 00 + 401dfb: b9 00 00 00 00 mov $0x0,%ecx + 401e00: 48 89 da mov %rbx,%rdx + 401e03: 48 8d 35 16 34 00 00 lea 0x3416(%rip),%rsi # 405220 + 401e0a: 48 8d 3d 27 34 00 00 lea 0x3427(%rip),%rdi # 405238 + 401e11: e8 f1 0d 00 00 call 402c07 + 401e16: 48 89 dc mov %rbx,%rsp + 401e19: 85 c0 test %eax,%eax + 401e1b: 78 1c js 401e39 + 401e1d: 48 8b 84 24 08 40 00 mov 0x4008(%rsp),%rax + 401e24: 00 + 401e25: 64 48 2b 04 25 28 00 sub %fs:0x28,%rax + 401e2c: 00 00 + 401e2e: 75 20 jne 401e50 + 401e30: 48 81 c4 10 40 00 00 add $0x4010,%rsp + 401e37: 5b pop %rbx + 401e38: c3 ret + 401e39: 48 8d bc 24 00 20 00 lea 0x2000(%rsp),%rdi + 401e40: 00 + 401e41: e8 fa f3 ff ff call 401240 + 401e46: bf 00 00 00 00 mov $0x0,%edi + 401e4b: e8 10 f5 ff ff call 401360 + 401e50: e8 1b f4 ff ff call 401270 <__stack_chk_fail@plt> + +0000000000401e55 : + 401e55: f3 0f 1e fa endbr64 + 401e59: 50 push %rax + 401e5a: 58 pop %rax + 401e5b: 48 83 ec 08 sub $0x8,%rsp + 401e5f: 48 8d 3d 9b 15 00 00 lea 0x159b(%rip),%rdi # 403401 + 401e66: e8 d5 f3 ff ff call 401240 + 401e6b: 48 8d 3d 98 15 00 00 lea 0x1598(%rip),%rdi # 40340a + 401e72: e8 c9 f3 ff ff call 401240 + 401e77: bf 00 00 00 00 mov $0x0,%edi + 401e7c: e8 e2 fe ff ff call 401d63 + 401e81: 48 8d 3d 28 14 00 00 lea 0x1428(%rip),%rdi # 4032b0 + 401e88: e8 b3 f3 ff ff call 401240 + 401e8d: bf 08 00 00 00 mov $0x8,%edi + 401e92: e8 c9 f4 ff ff call 401360 + +0000000000401e97 : //return -> rsp + 401e97: f3 0f 1e fa endbr64 + 401e9b: 48 83 ec 08 sub $0x8,%rsp + 401e9f: 48 89 f2 mov %rsi,%rdx //0x7fffffffe950 + 401ea2: 48 8d 4e 04 lea 0x4(%rsi),%rcx // *rsi+4->rcx + 401ea6: 48 8d 46 14 lea 0x14(%rsi),%rax //*rsi+20->rax + 401eaa: 50 push %rax + 401eab: 48 8d 46 10 lea 0x10(%rsi),%rax // 0x7fffffffe960 + 401eaf: 50 push %rax + 401eb0: 4c 8d 4e 0c lea 0xc(%rsi),%r9 //0x7fffffffe95c + 401eb4: 4c 8d 46 08 lea 0x8(%rsi),%i + 401eb8: 48 8d 35 62 15 00 00 lea 0x1562(%rip),%rsi # 403421 + 401ebf: b8 00 00 00 00 mov $0x0,%eax + 401ec4: e8 57 f4 ff ff call 401320 <__isoc99_sscanf@plt> // %d %d %d %d %d %d + 401ec9: 48 83 c4 10 add $0x10,%rsp + 401ecd: 83 f8 05 cmp $0x5,%eax //eax!=5 -> explode_bomb + 401ed0: 7e 05 jle 401ed7 + 401ed2: 48 83 c4 08 add $0x8,%rsp + 401ed6: c3 ret + 401ed7: e8 79 ff ff ff call 401e55 + +0000000000401edc : + 401edc: f3 0f 1e fa endbr64 + 401ee0: 55 push %rbp + 401ee1: 53 push %rbx + 401ee2: 48 83 ec 08 sub $0x8,%rsp + 401ee6: b8 00 00 00 00 mov $0x0,%eax + 401eeb: e8 21 fe ff ff call 401d11 + 401ef0: 48 85 c0 test %rax,%rax + 401ef3: 74 5d je 401f52 + 401ef5: 8b 2d 15 39 00 00 mov 0x3915(%rip),%ebp # 405810 + 401efb: 48 63 c5 movslq %ebp,%rax + 401efe: 48 8d 1c 80 lea (%rax,%rax,4),%rbx + 401f02: 48 c1 e3 04 shl $0x4,%rbx + 401f06: 48 8d 05 13 39 00 00 lea 0x3913(%rip),%rax # 405820 + 401f0d: 48 01 c3 add %rax,%rbx + 401f10: 48 89 df mov %rbx,%rdi + 401f13: e8 48 f3 ff ff call 401260 + 401f18: 83 f8 4e cmp $0x4e,%eax + 401f1b: 0f 8f a9 00 00 00 jg 401fca + 401f21: 83 e8 01 sub $0x1,%eax + 401f24: 48 98 cltq + 401f26: 48 63 d5 movslq %ebp,%rdx + 401f29: 48 8d 0c 92 lea (%rdx,%rdx,4),%rcx + 401f2d: 48 c1 e1 04 shl $0x4,%rcx + 401f31: 48 8d 15 e8 38 00 00 lea 0x38e8(%rip),%rdx # 405820 + 401f38: 48 01 ca add %rcx,%rdx + 401f3b: c6 04 02 00 movb $0x0,(%rdx,%rax,1) + 401f3f: 83 c5 01 add $0x1,%ebp + 401f42: 89 2d c8 38 00 00 mov %ebp,0x38c8(%rip) # 405810 + 401f48: 48 89 d8 mov %rbx,%rax + 401f4b: 48 83 c4 08 add $0x8,%rsp + 401f4f: 5b pop %rbx + 401f50: 5d pop %rbp + 401f51: c3 ret + 401f52: 48 8b 05 37 38 00 00 mov 0x3837(%rip),%rax # 405790 + 401f59: 48 39 05 50 38 00 00 cmp %rax,0x3850(%rip) # 4057b0 + 401f60: 74 1b je 401f7d + 401f62: 48 8d 3d e8 14 00 00 lea 0x14e8(%rip),%rdi # 403451 + 401f69: e8 92 f2 ff ff call 401200 + 401f6e: 48 85 c0 test %rax,%rax + 401f71: 74 20 je 401f93 + 401f73: bf 00 00 00 00 mov $0x0,%edi + 401f78: e8 e3 f3 ff ff call 401360 + 401f7d: 48 8d 3d af 14 00 00 lea 0x14af(%rip),%rdi # 403433 + 401f84: e8 b7 f2 ff ff call 401240 + 401f89: bf 08 00 00 00 mov $0x8,%edi + 401f8e: e8 cd f3 ff ff call 401360 + 401f93: 48 8b 05 f6 37 00 00 mov 0x37f6(%rip),%rax # 405790 + 401f9a: 48 89 05 0f 38 00 00 mov %rax,0x380f(%rip) # 4057b0 + 401fa1: b8 00 00 00 00 mov $0x0,%eax + 401fa6: e8 66 fd ff ff call 401d11 + 401fab: 48 85 c0 test %rax,%rax + 401fae: 0f 85 41 ff ff ff jne 401ef5 + 401fb4: 48 8d 3d 78 14 00 00 lea 0x1478(%rip),%rdi # 403433 + 401fbb: e8 80 f2 ff ff call 401240 + 401fc0: bf 00 00 00 00 mov $0x0,%edi + 401fc5: e8 96 f3 ff ff call 401360 + 401fca: 48 8d 3d 8b 14 00 00 lea 0x148b(%rip),%rdi # 40345c + 401fd1: e8 6a f2 ff ff call 401240 + 401fd6: 8b 05 34 38 00 00 mov 0x3834(%rip),%eax # 405810 + 401fdc: 8d 50 01 lea 0x1(%rax),%edx + 401fdf: 89 15 2b 38 00 00 mov %edx,0x382b(%rip) # 405810 + 401fe5: 48 98 cltq + 401fe7: 48 6b c0 50 imul $0x50,%rax,%rax + 401feb: 48 8d 15 2e 38 00 00 lea 0x382e(%rip),%rdx # 405820 + 401ff2: 48 be 2a 2a 2a 74 72 movabs $0x636e7572742a2a2a,%rsi + 401ff9: 75 6e 63 + 401ffc: 48 bf 61 74 65 64 2a movabs $0x2a2a2a64657461,%rdi + 402003: 2a 2a 00 + 402006: 48 89 34 02 mov %rsi,(%rdx,%rax,1) + 40200a: 48 89 7c 02 08 mov %rdi,0x8(%rdx,%rax,1) + 40200f: e8 41 fe ff ff call 401e55 + +0000000000402014 : + 402014: f3 0f 1e fa endbr64 + 402018: 48 83 ec 78 sub $0x78,%rsp + 40201c: 64 48 8b 04 25 28 00 mov %fs:0x28,%rax + 402023: 00 00 + 402025: 48 89 44 24 68 mov %rax,0x68(%rsp) + 40202a: 31 c0 xor %eax,%eax + 40202c: bf 01 00 00 00 mov $0x1,%edi + 402031: e8 2d fd ff ff call 401d63 + 402036: 83 3d d3 37 00 00 06 cmpl $0x6,0x37d3(%rip) # 405810 // 解决phase数 + 40203d: 74 19 je 402058 + 40203f: 48 8b 44 24 68 mov 0x68(%rsp),%rax + 402044: 64 48 2b 04 25 28 00 sub %fs:0x28,%rax + 40204b: 00 00 + 40204d: 0f 85 84 00 00 00 jne 4020d7 + 402053: 48 83 c4 78 add $0x78,%rsp + 402057: c3 ret + 402058: 48 8d 4c 24 0c lea 0xc(%rsp),%rcx + 40205d: 48 8d 54 24 08 lea 0x8(%rsp),%rdx + 402062: 4c 8d 44 24 10 lea 0x10(%rsp),%r8 + 402067: 48 8d 35 09 14 00 00 lea 0x1409(%rip),%rsi # 403477 + 40206e: 48 8d 3d 9b 38 00 00 lea 0x389b(%rip),%rdi # 405910 + 402075: b8 00 00 00 00 mov $0x0,%eax + 40207a: e8 a1 f2 ff ff call 401320 <__isoc99_sscanf@plt> s=0x405910 "99 3"(第四个), format=0x403477 "%d %d %s" + 40207f: 83 f8 03 cmp $0x3,%eax + 402082: 74 1a je 40209e // DrEvil + 402084: 48 8d 3d ad 12 00 00 lea 0x12ad(%rip),%rdi # 403338 + 40208b: e8 b0 f1 ff ff call 401240 + 402090: 48 8d 3d d1 12 00 00 lea 0x12d1(%rip),%rdi # 403368 + 402097: e8 a4 f1 ff ff call 401240 + 40209c: eb a1 jmp 40203f + 40209e: 48 8d 7c 24 10 lea 0x10(%rsp),%rdi + 4020a3: 48 8d 35 d6 13 00 00 lea 0x13d6(%rip),%rsi # 403480 + 4020aa: e8 b7 fa ff ff call 401b66 + 4020af: 85 c0 test %eax,%eax + 4020b1: 75 d1 jne 402084 + 4020b3: 48 8d 3d 1e 12 00 00 lea 0x121e(%rip),%rdi # 4032d8 + 4020ba: e8 81 f1 ff ff call 401240 + 4020bf: 48 8d 3d 3a 12 00 00 lea 0x123a(%rip),%rdi # 403300 + 4020c6: e8 75 f1 ff ff call 401240 + 4020cb: b8 00 00 00 00 mov $0x0,%eax + 4020d0: e8 85 f9 ff ff call 401a5a + 4020d5: eb ad jmp 402084 + 4020d7: e8 94 f1 ff ff call 401270 <__stack_chk_fail@plt> + +00000000004020dc : + 4020dc: f3 0f 1e fa endbr64 + 4020e0: 50 push %rax + 4020e1: 58 pop %rax + 4020e2: 48 83 ec 08 sub $0x8,%rsp + 4020e6: b9 00 00 00 00 mov $0x0,%ecx + 4020eb: 48 8d 15 e6 13 00 00 lea 0x13e6(%rip),%rdx # 4034d8 + 4020f2: be 01 00 00 00 mov $0x1,%esi + 4020f7: 48 8b 3d a2 36 00 00 mov 0x36a2(%rip),%rdi # 4057a0 + 4020fe: b8 00 00 00 00 mov $0x0,%eax + 402103: e8 78 f2 ff ff call 401380 <__fprintf_chk@plt> + 402108: bf 01 00 00 00 mov $0x1,%edi + 40210d: e8 4e f2 ff ff call 401360 + +0000000000402112 : + 402112: 41 56 push %r14 + 402114: 41 55 push %r13 + 402116: 41 54 push %r12 + 402118: 55 push %rbp + 402119: 53 push %rbx + 40211a: 49 89 f4 mov %rsi,%r12 + 40211d: 48 83 fa 01 cmp $0x1,%rdx + 402121: 0f 86 92 00 00 00 jbe 4021b9 + 402127: 48 89 fb mov %rdi,%rbx + 40212a: 4c 8d 74 16 ff lea -0x1(%rsi,%rdx,1),%r14 + 40212f: 41 bd 01 00 00 00 mov $0x1,%r13d + 402135: 48 8d 6f 10 lea 0x10(%rdi),%rbp + 402139: eb 56 jmp 402191 + 40213b: e8 e0 f0 ff ff call 401220 <__errno_location@plt> + 402140: 83 38 04 cmpl $0x4,(%rax) + 402143: 75 55 jne 40219a + 402145: ba 00 20 00 00 mov $0x2000,%edx + 40214a: 48 89 ee mov %rbp,%rsi + 40214d: 8b 3b mov (%rbx),%edi + 40214f: e8 4c f1 ff ff call 4012a0 + 402154: 89 c2 mov %eax,%edx + 402156: 89 43 04 mov %eax,0x4(%rbx) + 402159: 85 c0 test %eax,%eax + 40215b: 78 de js 40213b + 40215d: 85 c0 test %eax,%eax + 40215f: 74 42 je 4021a3 + 402161: 48 89 6b 08 mov %rbp,0x8(%rbx) + 402165: 48 8b 43 08 mov 0x8(%rbx),%rax + 402169: 0f b6 08 movzbl (%rax),%ecx + 40216c: 48 83 c0 01 add $0x1,%rax + 402170: 48 89 43 08 mov %rax,0x8(%rbx) + 402174: 83 ea 01 sub $0x1,%edx + 402177: 89 53 04 mov %edx,0x4(%rbx) + 40217a: 49 83 c4 01 add $0x1,%r12 + 40217e: 41 88 4c 24 ff mov %cl,-0x1(%r12) + 402183: 80 f9 0a cmp $0xa,%cl + 402186: 74 3c je 4021c4 + 402188: 41 83 c5 01 add $0x1,%r13d + 40218c: 4d 39 f4 cmp %r14,%r12 + 40218f: 74 30 je 4021c1 + 402191: 8b 53 04 mov 0x4(%rbx),%edx + 402194: 85 d2 test %edx,%edx + 402196: 7e ad jle 402145 + 402198: eb cb jmp 402165 + 40219a: 48 c7 c0 ff ff ff ff mov $0xffffffffffffffff,%rax + 4021a1: eb 05 jmp 4021a8 + 4021a3: b8 00 00 00 00 mov $0x0,%eax + 4021a8: 85 c0 test %eax,%eax + 4021aa: 75 29 jne 4021d5 + 4021ac: b8 00 00 00 00 mov $0x0,%eax + 4021b1: 41 83 fd 01 cmp $0x1,%r13d + 4021b5: 75 0d jne 4021c4 + 4021b7: eb 13 jmp 4021cc + 4021b9: 41 bd 01 00 00 00 mov $0x1,%r13d + 4021bf: eb 03 jmp 4021c4 + 4021c1: 4d 89 f4 mov %r14,%r12 + 4021c4: 41 c6 04 24 00 movb $0x0,(%r12) + 4021c9: 49 63 c5 movslq %r13d,%rax + 4021cc: 5b pop %rbx + 4021cd: 5d pop %rbp + 4021ce: 41 5c pop %r12 + 4021d0: 41 5d pop %r13 + 4021d2: 41 5e pop %r14 + 4021d4: c3 ret + 4021d5: 48 c7 c0 ff ff ff ff mov $0xffffffffffffffff,%rax + 4021dc: eb ee jmp 4021cc + +00000000004021de : + 4021de: f3 0f 1e fa endbr64 + 4021e2: 41 57 push %r15 + 4021e4: 41 56 push %r14 + 4021e6: 41 55 push %r13 + 4021e8: 41 54 push %r12 + 4021ea: 55 push %rbp + 4021eb: 53 push %rbx + 4021ec: 4c 8d 9c 24 00 60 ff lea -0xa000(%rsp),%r11 + 4021f3: ff + 4021f4: 48 81 ec 00 10 00 00 sub $0x1000,%rsp + 4021fb: 48 83 0c 24 00 orq $0x0,(%rsp) + 402200: 4c 39 dc cmp %r11,%rsp + 402203: 75 ef jne 4021f4 + 402205: 48 83 ec 78 sub $0x78,%rsp + 402209: 49 89 fd mov %rdi,%r13 + 40220c: 89 f5 mov %esi,%ebp + 40220e: 48 89 54 24 08 mov %rdx,0x8(%rsp) + 402213: 48 89 4c 24 10 mov %rcx,0x10(%rsp) + 402218: 4c 89 44 24 20 mov %r8,0x20(%rsp) + 40221d: 4c 89 4c 24 18 mov %r9,0x18(%rsp) + 402222: 48 8b 9c 24 b0 a0 00 mov 0xa0b0(%rsp),%rbx + 402229: 00 + 40222a: 4c 8b bc 24 b8 a0 00 mov 0xa0b8(%rsp),%r15 + 402231: 00 + 402232: 64 48 8b 04 25 28 00 mov %fs:0x28,%rax + 402239: 00 00 + 40223b: 48 89 84 24 68 a0 00 mov %rax,0xa068(%rsp) + 402242: 00 + 402243: 31 c0 xor %eax,%eax + 402245: c7 44 24 3c 00 00 00 movl $0x0,0x3c(%rsp) + 40224c: 00 + 40224d: ba 00 00 00 00 mov $0x0,%edx + 402252: be 01 00 00 00 mov $0x1,%esi + 402257: bf 02 00 00 00 mov $0x2,%edi + 40225c: e8 5f f1 ff ff call 4013c0 + 402261: 85 c0 test %eax,%eax + 402263: 0f 88 12 01 00 00 js 40237b + 402269: 41 89 c4 mov %eax,%r12d + 40226c: 4c 89 ef mov %r13,%rdi + 40226f: e8 6c f0 ff ff call 4012e0 + 402274: 48 85 c0 test %rax,%rax + 402277: 0f 84 4e 01 00 00 je 4023cb + 40227d: 4c 8d 6c 24 40 lea 0x40(%rsp),%r13 + 402282: 48 c7 44 24 40 00 00 movq $0x0,0x40(%rsp) + 402289: 00 00 + 40228b: 48 c7 44 24 48 00 00 movq $0x0,0x48(%rsp) + 402292: 00 00 + 402294: 66 c7 44 24 40 02 00 movw $0x2,0x40(%rsp) + 40229b: 48 63 50 14 movslq 0x14(%rax),%rdx + 40229f: 48 8b 40 18 mov 0x18(%rax),%rax + 4022a3: 48 8d 7c 24 44 lea 0x44(%rsp),%rdi + 4022a8: b9 0c 00 00 00 mov $0xc,%ecx + 4022ad: 48 8b 30 mov (%rax),%rsi + 4022b0: e8 3b f0 ff ff call 4012f0 <__memmove_chk@plt> + 4022b5: 66 c1 c5 08 rol $0x8,%bp + 4022b9: 66 89 6c 24 42 mov %bp,0x42(%rsp) + 4022be: ba 10 00 00 00 mov $0x10,%edx + 4022c3: 4c 89 ee mov %r13,%rsi + 4022c6: 44 89 e7 mov %r12d,%edi + 4022c9: e8 a2 f0 ff ff call 401370 + 4022ce: 85 c0 test %eax,%eax + 4022d0: 0f 88 60 01 00 00 js 402436 + 4022d6: 48 89 df mov %rbx,%rdi + 4022d9: e8 82 ef ff ff call 401260 + 4022de: 48 89 c5 mov %rax,%rbp + 4022e1: 48 8b 7c 24 08 mov 0x8(%rsp),%rdi + 4022e6: e8 75 ef ff ff call 401260 + 4022eb: 49 89 c6 mov %rax,%r14 + 4022ee: 48 8b 7c 24 10 mov 0x10(%rsp),%rdi + 4022f3: e8 68 ef ff ff call 401260 + 4022f8: 49 89 c5 mov %rax,%r13 + 4022fb: 48 8b 7c 24 18 mov 0x18(%rsp),%rdi + 402300: e8 5b ef ff ff call 401260 + 402305: 48 89 c2 mov %rax,%rdx + 402308: 4b 8d 84 2e 80 00 00 lea 0x80(%r14,%r13,1),%rax + 40230f: 00 + 402310: 48 01 d0 add %rdx,%rax + 402313: 48 8d 54 6d 00 lea 0x0(%rbp,%rbp,2),%rdx + 402318: 48 01 d0 add %rdx,%rax + 40231b: 48 3d 00 20 00 00 cmp $0x2000,%rax + 402321: 0f 87 6c 01 00 00 ja 402493 + 402327: 48 8d 94 24 60 40 00 lea 0x4060(%rsp),%rdx + 40232e: 00 + 40232f: b9 00 04 00 00 mov $0x400,%ecx + 402334: b8 00 00 00 00 mov $0x0,%eax + 402339: 48 89 d7 mov %rdx,%rdi + 40233c: f3 48 ab rep stos %rax,%es:(%rdi) + 40233f: 48 89 df mov %rbx,%rdi + 402342: e8 19 ef ff ff call 401260 + 402347: 85 c0 test %eax,%eax + 402349: 0f 84 07 05 00 00 je 402856 + 40234f: 8d 40 ff lea -0x1(%rax),%eax + 402352: 4c 8d 6c 03 01 lea 0x1(%rbx,%rax,1),%r13 + 402357: 48 8d ac 24 60 40 00 lea 0x4060(%rsp),%rbp + 40235e: 00 + 40235f: 48 8d 84 24 60 80 00 lea 0x8060(%rsp),%rax + 402366: 00 + 402367: 48 89 44 24 28 mov %rax,0x28(%rsp) + 40236c: 49 be d9 ff 00 00 00 movabs $0x2000000000ffd9,%r14 + 402373: 00 20 00 + 402376: e9 a6 01 00 00 jmp 402521 + 40237b: 48 b8 45 72 72 6f 72 movabs $0x43203a726f727245,%rax + 402382: 3a 20 43 + 402385: 48 ba 6c 69 65 6e 74 movabs $0x6e7520746e65696c,%rdx + 40238c: 20 75 6e + 40238f: 49 89 07 mov %rax,(%r15) + 402392: 49 89 57 08 mov %rdx,0x8(%r15) + 402396: 48 b8 61 62 6c 65 20 movabs $0x206f7420656c6261,%rax + 40239d: 74 6f 20 + 4023a0: 48 ba 63 72 65 61 74 movabs $0x7320657461657263,%rdx + 4023a7: 65 20 73 + 4023aa: 49 89 47 10 mov %rax,0x10(%r15) + 4023ae: 49 89 57 18 mov %rdx,0x18(%r15) + 4023b2: 41 c7 47 20 6f 63 6b movl $0x656b636f,0x20(%r15) + 4023b9: 65 + 4023ba: 66 41 c7 47 24 74 00 movw $0x74,0x24(%r15) + 4023c1: b8 ff ff ff ff mov $0xffffffff,%eax + 4023c6: e9 03 03 00 00 jmp 4026ce + 4023cb: 48 b8 45 72 72 6f 72 movabs $0x44203a726f727245,%rax + 4023d2: 3a 20 44 + 4023d5: 48 ba 4e 53 20 69 73 movabs $0x6e7520736920534e,%rdx + 4023dc: 20 75 6e + 4023df: 49 89 07 mov %rax,(%r15) + 4023e2: 49 89 57 08 mov %rdx,0x8(%r15) + 4023e6: 48 b8 61 62 6c 65 20 movabs $0x206f7420656c6261,%rax + 4023ed: 74 6f 20 + 4023f0: 48 ba 72 65 73 6f 6c movabs $0x2065766c6f736572,%rdx + 4023f7: 76 65 20 + 4023fa: 49 89 47 10 mov %rax,0x10(%r15) + 4023fe: 49 89 57 18 mov %rdx,0x18(%r15) + 402402: 48 b8 73 65 72 76 65 movabs $0x6120726576726573,%rax + 402409: 72 20 61 + 40240c: 49 89 47 20 mov %rax,0x20(%r15) + 402410: 41 c7 47 28 64 64 72 movl $0x65726464,0x28(%r15) + 402417: 65 + 402418: 66 41 c7 47 2c 73 73 movw $0x7373,0x2c(%r15) + 40241f: 41 c6 47 2e 00 movb $0x0,0x2e(%r15) + 402424: 44 89 e7 mov %r12d,%edi + 402427: e8 64 ee ff ff call 401290 + 40242c: b8 ff ff ff ff mov $0xffffffff,%eax + 402431: e9 98 02 00 00 jmp 4026ce + 402436: 48 b8 45 72 72 6f 72 movabs $0x55203a726f727245,%rax + 40243d: 3a 20 55 + 402440: 48 ba 6e 61 62 6c 65 movabs $0x6f7420656c62616e,%rdx + 402447: 20 74 6f + 40244a: 49 89 07 mov %rax,(%r15) + 40244d: 49 89 57 08 mov %rdx,0x8(%r15) + 402451: 48 b8 20 63 6f 6e 6e movabs $0x7463656e6e6f6320,%rax + 402458: 65 63 74 + 40245b: 48 ba 20 74 6f 20 74 movabs $0x20656874206f7420,%rdx + 402462: 68 65 20 + 402465: 49 89 47 10 mov %rax,0x10(%r15) + 402469: 49 89 57 18 mov %rdx,0x18(%r15) + 40246d: 41 c7 47 20 73 65 72 movl $0x76726573,0x20(%r15) + 402474: 76 + 402475: 66 41 c7 47 24 65 72 movw $0x7265,0x24(%r15) + 40247c: 41 c6 47 26 00 movb $0x0,0x26(%r15) + 402481: 44 89 e7 mov %r12d,%edi + 402484: e8 07 ee ff ff call 401290 + 402489: b8 ff ff ff ff mov $0xffffffff,%eax + 40248e: e9 3b 02 00 00 jmp 4026ce + 402493: 48 b8 45 72 72 6f 72 movabs $0x52203a726f727245,%rax + 40249a: 3a 20 52 + 40249d: 48 ba 65 73 75 6c 74 movabs $0x747320746c757365,%rdx + 4024a4: 20 73 74 + 4024a7: 49 89 07 mov %rax,(%r15) + 4024aa: 49 89 57 08 mov %rdx,0x8(%r15) + 4024ae: 48 b8 72 69 6e 67 20 movabs $0x6f6f7420676e6972,%rax + 4024b5: 74 6f 6f + 4024b8: 48 ba 20 6c 61 72 67 movabs $0x202e656772616c20,%rdx + 4024bf: 65 2e 20 + 4024c2: 49 89 47 10 mov %rax,0x10(%r15) + 4024c6: 49 89 57 18 mov %rdx,0x18(%r15) + 4024ca: 48 b8 49 6e 63 72 65 movabs $0x6573616572636e49,%rax + 4024d1: 61 73 65 + 4024d4: 48 ba 20 53 55 42 4d movabs $0x5254494d42555320,%rdx + 4024db: 49 54 52 + 4024de: 49 89 47 20 mov %rax,0x20(%r15) + 4024e2: 49 89 57 28 mov %rdx,0x28(%r15) + 4024e6: 48 b8 5f 4d 41 58 42 movabs $0x46554258414d5f,%rax + 4024ed: 55 46 00 + 4024f0: 49 89 47 30 mov %rax,0x30(%r15) + 4024f4: 44 89 e7 mov %r12d,%edi + 4024f7: e8 94 ed ff ff call 401290 + 4024fc: b8 ff ff ff ff mov $0xffffffff,%eax + 402501: e9 c8 01 00 00 jmp 4026ce + 402506: 49 0f a3 c6 bt %rax,%r14 + 40250a: 73 21 jae 40252d + 40250c: 44 88 45 00 mov %r8b,0x0(%rbp) + 402510: 48 8d 6d 01 lea 0x1(%rbp),%rbp + 402514: 48 83 c3 01 add $0x1,%rbx + 402518: 4c 39 eb cmp %r13,%rbx + 40251b: 0f 84 35 03 00 00 je 402856 + 402521: 44 0f b6 03 movzbl (%rbx),%r8d + 402525: 41 8d 40 d6 lea -0x2a(%r8),%eax + 402529: 3c 35 cmp $0x35,%al + 40252b: 76 d9 jbe 402506 + 40252d: 44 89 c0 mov %r8d,%eax + 402530: 83 e0 df and $0xffffffdf,%eax + 402533: 83 e8 41 sub $0x41,%eax + 402536: 3c 19 cmp $0x19,%al + 402538: 76 d2 jbe 40250c + 40253a: 41 80 f8 20 cmp $0x20,%r8b + 40253e: 74 60 je 4025a0 + 402540: 41 8d 40 e0 lea -0x20(%r8),%eax + 402544: 3c 5f cmp $0x5f,%al + 402546: 76 0a jbe 402552 + 402548: 41 80 f8 09 cmp $0x9,%r8b + 40254c: 0f 85 77 02 00 00 jne 4027c9 + 402552: 45 0f b6 c0 movzbl %r8b,%r8d + 402556: 48 8d 0d 51 10 00 00 lea 0x1051(%rip),%rcx # 4035ae + 40255d: ba 08 00 00 00 mov $0x8,%edx + 402562: be 01 00 00 00 mov $0x1,%esi + 402567: 48 8b 7c 24 28 mov 0x28(%rsp),%rdi + 40256c: b8 00 00 00 00 mov $0x0,%eax + 402571: e8 3a ee ff ff call 4013b0 <__sprintf_chk@plt> + 402576: 0f b6 84 24 60 80 00 movzbl 0x8060(%rsp),%eax + 40257d: 00 + 40257e: 88 45 00 mov %al,0x0(%rbp) + 402581: 0f b6 84 24 61 80 00 movzbl 0x8061(%rsp),%eax + 402588: 00 + 402589: 88 45 01 mov %al,0x1(%rbp) + 40258c: 0f b6 84 24 62 80 00 movzbl 0x8062(%rsp),%eax + 402593: 00 + 402594: 88 45 02 mov %al,0x2(%rbp) + 402597: 48 8d 6d 03 lea 0x3(%rbp),%rbp + 40259b: e9 74 ff ff ff jmp 402514 + 4025a0: c6 45 00 2b movb $0x2b,0x0(%rbp) + 4025a4: 48 8d 6d 01 lea 0x1(%rbp),%rbp + 4025a8: e9 67 ff ff ff jmp 402514 + 4025ad: 48 01 c5 add %rax,%rbp + 4025b0: 48 29 c3 sub %rax,%rbx + 4025b3: 0f 84 08 03 00 00 je 4028c1 + 4025b9: 48 89 da mov %rbx,%rdx + 4025bc: 48 89 ee mov %rbp,%rsi + 4025bf: 44 89 e7 mov %r12d,%edi + 4025c2: e8 89 ec ff ff call 401250 + 4025c7: 48 85 c0 test %rax,%rax + 4025ca: 7f e1 jg 4025ad + 4025cc: e8 4f ec ff ff call 401220 <__errno_location@plt> + 4025d1: 83 38 04 cmpl $0x4,(%rax) + 4025d4: 0f 85 90 01 00 00 jne 40276a + 4025da: 4c 89 e8 mov %r13,%rax + 4025dd: eb ce jmp 4025ad + 4025df: 48 b8 45 72 72 6f 72 movabs $0x43203a726f727245,%rax + 4025e6: 3a 20 43 + 4025e9: 48 ba 6c 69 65 6e 74 movabs $0x6e7520746e65696c,%rdx + 4025f0: 20 75 6e + 4025f3: 49 89 07 mov %rax,(%r15) + 4025f6: 49 89 57 08 mov %rdx,0x8(%r15) + 4025fa: 48 b8 61 62 6c 65 20 movabs $0x206f7420656c6261,%rax + 402601: 74 6f 20 + 402604: 48 ba 72 65 61 64 20 movabs $0x7269662064616572,%rdx + 40260b: 66 69 72 + 40260e: 49 89 47 10 mov %rax,0x10(%r15) + 402612: 49 89 57 18 mov %rdx,0x18(%r15) + 402616: 48 b8 73 74 20 68 65 movabs $0x6564616568207473,%rax + 40261d: 61 64 65 + 402620: 48 ba 72 20 66 72 6f movabs $0x73206d6f72662072,%rdx + 402627: 6d 20 73 + 40262a: 49 89 47 20 mov %rax,0x20(%r15) + 40262e: 49 89 57 28 mov %rdx,0x28(%r15) + 402632: 41 c7 47 30 65 72 76 movl $0x65767265,0x30(%r15) + 402639: 65 + 40263a: 66 41 c7 47 34 72 00 movw $0x72,0x34(%r15) + 402641: 44 89 e7 mov %r12d,%edi + 402644: e8 47 ec ff ff call 401290 + 402649: b8 ff ff ff ff mov $0xffffffff,%eax + 40264e: eb 7e jmp 4026ce + 402650: 4c 8d 8c 24 60 80 00 lea 0x8060(%rsp),%r9 + 402657: 00 + 402658: 48 8d 0d a1 0e 00 00 lea 0xea1(%rip),%rcx # 403500 + 40265f: 48 c7 c2 ff ff ff ff mov $0xffffffffffffffff,%rdx + 402666: be 01 00 00 00 mov $0x1,%esi + 40266b: 4c 89 ff mov %r15,%rdi + 40266e: b8 00 00 00 00 mov $0x0,%eax + 402673: e8 38 ed ff ff call 4013b0 <__sprintf_chk@plt> + 402678: 44 89 e7 mov %r12d,%edi + 40267b: e8 10 ec ff ff call 401290 + 402680: b8 ff ff ff ff mov $0xffffffff,%eax + 402685: eb 47 jmp 4026ce + 402687: 48 8d b4 24 60 20 00 lea 0x2060(%rsp),%rsi + 40268e: 00 + 40268f: 48 8d 7c 24 50 lea 0x50(%rsp),%rdi + 402694: ba 00 20 00 00 mov $0x2000,%edx + 402699: e8 74 fa ff ff call 402112 + 40269e: 48 85 c0 test %rax,%rax + 4026a1: 7e 54 jle 4026f7 + 4026a3: 48 8d b4 24 60 20 00 lea 0x2060(%rsp),%rsi + 4026aa: 00 + 4026ab: 4c 89 ff mov %r15,%rdi + 4026ae: e8 7d eb ff ff call 401230 + 4026b3: 44 89 e7 mov %r12d,%edi + 4026b6: e8 d5 eb ff ff call 401290 + 4026bb: 48 8d 35 07 0f 00 00 lea 0xf07(%rip),%rsi # 4035c9 + 4026c2: 4c 89 ff mov %r15,%rdi + 4026c5: e8 f6 eb ff ff call 4012c0 + 4026ca: f7 d8 neg %eax + 4026cc: 19 c0 sbb %eax,%eax + 4026ce: 48 8b 94 24 68 a0 00 mov 0xa068(%rsp),%rdx + 4026d5: 00 + 4026d6: 64 48 2b 14 25 28 00 sub %fs:0x28,%rdx + 4026dd: 00 00 + 4026df: 0f 85 f8 02 00 00 jne 4029dd + 4026e5: 48 81 c4 78 a0 00 00 add $0xa078,%rsp + 4026ec: 5b pop %rbx + 4026ed: 5d pop %rbp + 4026ee: 41 5c pop %r12 + 4026f0: 41 5d pop %r13 + 4026f2: 41 5e pop %r14 + 4026f4: 41 5f pop %r15 + 4026f6: c3 ret + 4026f7: 48 b8 45 72 72 6f 72 movabs $0x43203a726f727245,%rax + 4026fe: 3a 20 43 + 402701: 48 ba 6c 69 65 6e 74 movabs $0x6e7520746e65696c,%rdx + 402708: 20 75 6e + 40270b: 49 89 07 mov %rax,(%r15) + 40270e: 49 89 57 08 mov %rdx,0x8(%r15) + 402712: 48 b8 61 62 6c 65 20 movabs $0x206f7420656c6261,%rax + 402719: 74 6f 20 + 40271c: 48 ba 72 65 61 64 20 movabs $0x6174732064616572,%rdx + 402723: 73 74 61 + 402726: 49 89 47 10 mov %rax,0x10(%r15) + 40272a: 49 89 57 18 mov %rdx,0x18(%r15) + 40272e: 48 b8 74 75 73 20 6d movabs $0x7373656d20737574,%rax + 402735: 65 73 73 + 402738: 48 ba 61 67 65 20 66 movabs $0x6d6f726620656761,%rdx + 40273f: 72 6f 6d + 402742: 49 89 47 20 mov %rax,0x20(%r15) + 402746: 49 89 57 28 mov %rdx,0x28(%r15) + 40274a: 48 b8 20 73 65 72 76 movabs $0x72657672657320,%rax + 402751: 65 72 00 + 402754: 49 89 47 30 mov %rax,0x30(%r15) + 402758: 44 89 e7 mov %r12d,%edi + 40275b: e8 30 eb ff ff call 401290 + 402760: b8 ff ff ff ff mov $0xffffffff,%eax + 402765: e9 64 ff ff ff jmp 4026ce + 40276a: 48 b8 45 72 72 6f 72 movabs $0x43203a726f727245,%rax + 402771: 3a 20 43 + 402774: 48 ba 6c 69 65 6e 74 movabs $0x6e7520746e65696c,%rdx + 40277b: 20 75 6e + 40277e: 49 89 07 mov %rax,(%r15) + 402781: 49 89 57 08 mov %rdx,0x8(%r15) + 402785: 48 b8 61 62 6c 65 20 movabs $0x206f7420656c6261,%rax + 40278c: 74 6f 20 + 40278f: 48 ba 77 72 69 74 65 movabs $0x6f74206574697277,%rdx + 402796: 20 74 6f + 402799: 49 89 47 10 mov %rax,0x10(%r15) + 40279d: 49 89 57 18 mov %rdx,0x18(%r15) + 4027a1: 48 b8 20 74 68 65 20 movabs $0x7265732065687420,%rax + 4027a8: 73 65 72 + 4027ab: 49 89 47 20 mov %rax,0x20(%r15) + 4027af: 41 c7 47 28 76 65 72 movl $0x726576,0x28(%r15) + 4027b6: 00 + 4027b7: 44 89 e7 mov %r12d,%edi + 4027ba: e8 d1 ea ff ff call 401290 + 4027bf: b8 ff ff ff ff mov $0xffffffff,%eax + 4027c4: e9 05 ff ff ff jmp 4026ce + 4027c9: 48 b8 45 72 72 6f 72 movabs $0x52203a726f727245,%rax + 4027d0: 3a 20 52 + 4027d3: 48 ba 65 73 75 6c 74 movabs $0x747320746c757365,%rdx + 4027da: 20 73 74 + 4027dd: 49 89 07 mov %rax,(%r15) + 4027e0: 49 89 57 08 mov %rdx,0x8(%r15) + 4027e4: 48 b8 72 69 6e 67 20 movabs $0x6e6f6320676e6972,%rax + 4027eb: 63 6f 6e + 4027ee: 48 ba 74 61 69 6e 73 movabs $0x6e6120736e696174,%rdx + 4027f5: 20 61 6e + 4027f8: 49 89 47 10 mov %rax,0x10(%r15) + 4027fc: 49 89 57 18 mov %rdx,0x18(%r15) + 402800: 48 b8 20 69 6c 6c 65 movabs $0x6c6167656c6c6920,%rax + 402807: 67 61 6c + 40280a: 48 ba 20 6f 72 20 75 movabs $0x72706e7520726f20,%rdx + 402811: 6e 70 72 + 402814: 49 89 47 20 mov %rax,0x20(%r15) + 402818: 49 89 57 28 mov %rdx,0x28(%r15) + 40281c: 48 b8 69 6e 74 61 62 movabs $0x20656c6261746e69,%rax + 402823: 6c 65 20 + 402826: 48 ba 63 68 61 72 61 movabs $0x6574636172616863,%rdx + 40282d: 63 74 65 + 402830: 49 89 47 30 mov %rax,0x30(%r15) + 402834: 49 89 57 38 mov %rdx,0x38(%r15) + 402838: 66 41 c7 47 40 72 2e movw $0x2e72,0x40(%r15) + 40283f: 41 c6 47 42 00 movb $0x0,0x42(%r15) + 402844: 44 89 e7 mov %r12d,%edi + 402847: e8 44 ea ff ff call 401290 + 40284c: b8 ff ff ff ff mov $0xffffffff,%eax + 402851: e9 78 fe ff ff jmp 4026ce + 402856: 48 8d 9c 24 60 20 00 lea 0x2060(%rsp),%rbx + 40285d: 00 + 40285e: 48 83 ec 08 sub $0x8,%rsp + 402862: 48 8d 84 24 68 40 00 lea 0x4068(%rsp),%rax + 402869: 00 + 40286a: 50 push %rax + 40286b: ff 74 24 28 push 0x28(%rsp) + 40286f: ff 74 24 38 push 0x38(%rsp) + 402873: 4c 8b 4c 24 30 mov 0x30(%rsp),%r9 + 402878: 4c 8b 44 24 28 mov 0x28(%rsp),%r8 + 40287d: 48 8d 0d ac 0c 00 00 lea 0xcac(%rip),%rcx # 403530 + 402884: ba 00 20 00 00 mov $0x2000,%edx + 402889: be 01 00 00 00 mov $0x1,%esi + 40288e: 48 89 df mov %rbx,%rdi + 402891: b8 00 00 00 00 mov $0x0,%eax + 402896: e8 15 eb ff ff call 4013b0 <__sprintf_chk@plt> + 40289b: 48 83 c4 20 add $0x20,%rsp + 40289f: 48 89 df mov %rbx,%rdi + 4028a2: e8 b9 e9 ff ff call 401260 + 4028a7: 48 89 c3 mov %rax,%rbx + 4028aa: 48 8d ac 24 60 20 00 lea 0x2060(%rsp),%rbp + 4028b1: 00 + 4028b2: 41 bd 00 00 00 00 mov $0x0,%r13d + 4028b8: 48 85 c0 test %rax,%rax + 4028bb: 0f 85 f8 fc ff ff jne 4025b9 + 4028c1: 44 89 64 24 50 mov %r12d,0x50(%rsp) + 4028c6: c7 44 24 54 00 00 00 movl $0x0,0x54(%rsp) + 4028cd: 00 + 4028ce: 48 8d 7c 24 50 lea 0x50(%rsp),%rdi + 4028d3: 48 8d 44 24 60 lea 0x60(%rsp),%rax + 4028d8: 48 89 44 24 58 mov %rax,0x58(%rsp) + 4028dd: 48 8d b4 24 60 20 00 lea 0x2060(%rsp),%rsi + 4028e4: 00 + 4028e5: ba 00 20 00 00 mov $0x2000,%edx + 4028ea: e8 23 f8 ff ff call 402112 + 4028ef: 48 85 c0 test %rax,%rax + 4028f2: 0f 8e e7 fc ff ff jle 4025df + 4028f8: 48 8d 4c 24 3c lea 0x3c(%rsp),%rcx + 4028fd: 48 8d 94 24 60 60 00 lea 0x6060(%rsp),%rdx + 402904: 00 + 402905: 48 8d bc 24 60 20 00 lea 0x2060(%rsp),%rdi + 40290c: 00 + 40290d: 4c 8d 84 24 60 80 00 lea 0x8060(%rsp),%r8 + 402914: 00 + 402915: 48 8d 35 99 0c 00 00 lea 0xc99(%rip),%rsi # 4035b5 + 40291c: b8 00 00 00 00 mov $0x0,%eax + 402921: e8 fa e9 ff ff call 401320 <__isoc99_sscanf@plt> + 402926: 44 8b 44 24 3c mov 0x3c(%rsp),%r8d + 40292b: 41 81 f8 c8 00 00 00 cmp $0xc8,%r8d + 402932: 0f 85 18 fd ff ff jne 402650 + 402938: 48 8d 1d 87 0c 00 00 lea 0xc87(%rip),%rbx # 4035c6 + 40293f: 48 8d bc 24 60 20 00 lea 0x2060(%rsp),%rdi + 402946: 00 + 402947: 48 89 de mov %rbx,%rsi + 40294a: e8 71 e9 ff ff call 4012c0 + 40294f: 85 c0 test %eax,%eax + 402951: 0f 84 30 fd ff ff je 402687 + 402957: 48 8d b4 24 60 20 00 lea 0x2060(%rsp),%rsi + 40295e: 00 + 40295f: 48 8d 7c 24 50 lea 0x50(%rsp),%rdi + 402964: ba 00 20 00 00 mov $0x2000,%edx + 402969: e8 a4 f7 ff ff call 402112 + 40296e: 48 85 c0 test %rax,%rax + 402971: 7f cc jg 40293f + 402973: 48 b8 45 72 72 6f 72 movabs $0x43203a726f727245,%rax + 40297a: 3a 20 43 + 40297d: 48 ba 6c 69 65 6e 74 movabs $0x6e7520746e65696c,%rdx + 402984: 20 75 6e + 402987: 49 89 07 mov %rax,(%r15) + 40298a: 49 89 57 08 mov %rdx,0x8(%r15) + 40298e: 48 b8 61 62 6c 65 20 movabs $0x206f7420656c6261,%rax + 402995: 74 6f 20 + 402998: 48 ba 72 65 61 64 20 movabs $0x6165682064616572,%rdx + 40299f: 68 65 61 + 4029a2: 49 89 47 10 mov %rax,0x10(%r15) + 4029a6: 49 89 57 18 mov %rdx,0x18(%r15) + 4029aa: 48 b8 64 65 72 73 20 movabs $0x6f72662073726564,%rax + 4029b1: 66 72 6f + 4029b4: 48 ba 6d 20 73 65 72 movabs $0x726576726573206d,%rdx + 4029bb: 76 65 72 + 4029be: 49 89 47 20 mov %rax,0x20(%r15) + 4029c2: 49 89 57 28 mov %rdx,0x28(%r15) + 4029c6: 41 c6 47 30 00 movb $0x0,0x30(%r15) + 4029cb: 44 89 e7 mov %r12d,%edi + 4029ce: e8 bd e8 ff ff call 401290 + 4029d3: b8 ff ff ff ff mov $0xffffffff,%eax + 4029d8: e9 f1 fc ff ff jmp 4026ce + 4029dd: e8 8e e8 ff ff call 401270 <__stack_chk_fail@plt> + +00000000004029e2 : + 4029e2: f3 0f 1e fa endbr64 + 4029e6: 85 ff test %edi,%edi + 4029e8: 75 01 jne 4029eb + 4029ea: c3 ret + 4029eb: 53 push %rbx + 4029ec: 89 fb mov %edi,%ebx + 4029ee: 48 8d 35 e7 f6 ff ff lea -0x919(%rip),%rsi # 4020dc + 4029f5: bf 0e 00 00 00 mov $0xe,%edi + 4029fa: e8 d1 e8 ff ff call 4012d0 + 4029ff: 85 db test %ebx,%ebx + 402a01: b8 00 00 00 00 mov $0x0,%eax + 402a06: 0f 49 c3 cmovns %ebx,%eax + 402a09: 89 c7 mov %eax,%edi + 402a0b: e8 70 e8 ff ff call 401280 + 402a10: 5b pop %rbx + 402a11: c3 ret + +0000000000402a12 : + 402a12: f3 0f 1e fa endbr64 + 402a16: 41 54 push %r12 + 402a18: 55 push %rbp + 402a19: 53 push %rbx + 402a1a: 48 83 ec 20 sub $0x20,%rsp + 402a1e: 48 89 fd mov %rdi,%rbp + 402a21: 64 48 8b 04 25 28 00 mov %fs:0x28,%rax + 402a28: 00 00 + 402a2a: 48 89 44 24 18 mov %rax,0x18(%rsp) + 402a2f: 31 c0 xor %eax,%eax + 402a31: be 01 00 00 00 mov $0x1,%esi + 402a36: bf 0d 00 00 00 mov $0xd,%edi + 402a3b: e8 90 e8 ff ff call 4012d0 + 402a40: be 01 00 00 00 mov $0x1,%esi + 402a45: bf 1d 00 00 00 mov $0x1d,%edi + 402a4a: e8 81 e8 ff ff call 4012d0 + 402a4f: be 01 00 00 00 mov $0x1,%esi + 402a54: bf 1d 00 00 00 mov $0x1d,%edi + 402a59: e8 72 e8 ff ff call 4012d0 + 402a5e: ba 00 00 00 00 mov $0x0,%edx + 402a63: be 01 00 00 00 mov $0x1,%esi + 402a68: bf 02 00 00 00 mov $0x2,%edi + 402a6d: e8 4e e9 ff ff call 4013c0 + 402a72: 85 c0 test %eax,%eax + 402a74: 0f 88 9c 00 00 00 js 402b16 + 402a7a: 89 c3 mov %eax,%ebx + 402a7c: 48 8d 3d 49 0b 00 00 lea 0xb49(%rip),%rdi # 4035cc + 402a83: e8 58 e8 ff ff call 4012e0 + 402a88: 48 85 c0 test %rax,%rax + 402a8b: 0f 84 d1 00 00 00 je 402b62 + 402a91: 49 89 e4 mov %rsp,%r12 + 402a94: 48 c7 04 24 00 00 00 movq $0x0,(%rsp) + 402a9b: 00 + 402a9c: 48 c7 44 24 08 00 00 movq $0x0,0x8(%rsp) + 402aa3: 00 00 + 402aa5: 66 c7 04 24 02 00 movw $0x2,(%rsp) + 402aab: 48 63 50 14 movslq 0x14(%rax),%rdx + 402aaf: 48 8b 40 18 mov 0x18(%rax),%rax + 402ab3: 48 8d 7c 24 04 lea 0x4(%rsp),%rdi + 402ab8: b9 0c 00 00 00 mov $0xc,%ecx + 402abd: 48 8b 30 mov (%rax),%rsi + 402ac0: e8 2b e8 ff ff call 4012f0 <__memmove_chk@plt> + 402ac5: 66 c7 44 24 02 3b 6e movw $0x6e3b,0x2(%rsp) + 402acc: ba 10 00 00 00 mov $0x10,%edx + 402ad1: 4c 89 e6 mov %r12,%rsi + 402ad4: 89 df mov %ebx,%edi + 402ad6: e8 95 e8 ff ff call 401370 + 402adb: 85 c0 test %eax,%eax + 402add: 0f 88 e7 00 00 00 js 402bca + 402ae3: 89 df mov %ebx,%edi + 402ae5: e8 a6 e7 ff ff call 401290 + 402aea: 66 c7 45 00 4f 4b movw $0x4b4f,0x0(%rbp) + 402af0: c6 45 02 00 movb $0x0,0x2(%rbp) + 402af4: b8 00 00 00 00 mov $0x0,%eax + 402af9: 48 8b 54 24 18 mov 0x18(%rsp),%rdx + 402afe: 64 48 2b 14 25 28 00 sub %fs:0x28,%rdx + 402b05: 00 00 + 402b07: 0f 85 f5 00 00 00 jne 402c02 + 402b0d: 48 83 c4 20 add $0x20,%rsp + 402b11: 5b pop %rbx + 402b12: 5d pop %rbp + 402b13: 41 5c pop %r12 + 402b15: c3 ret + 402b16: 48 b8 45 72 72 6f 72 movabs $0x43203a726f727245,%rax + 402b1d: 3a 20 43 + 402b20: 48 ba 6c 69 65 6e 74 movabs $0x6e7520746e65696c,%rdx + 402b27: 20 75 6e + 402b2a: 48 89 45 00 mov %rax,0x0(%rbp) + 402b2e: 48 89 55 08 mov %rdx,0x8(%rbp) + 402b32: 48 b8 61 62 6c 65 20 movabs $0x206f7420656c6261,%rax + 402b39: 74 6f 20 + 402b3c: 48 ba 63 72 65 61 74 movabs $0x7320657461657263,%rdx + 402b43: 65 20 73 + 402b46: 48 89 45 10 mov %rax,0x10(%rbp) + 402b4a: 48 89 55 18 mov %rdx,0x18(%rbp) + 402b4e: c7 45 20 6f 63 6b 65 movl $0x656b636f,0x20(%rbp) + 402b55: 66 c7 45 24 74 00 movw $0x74,0x24(%rbp) + 402b5b: b8 ff ff ff ff mov $0xffffffff,%eax + 402b60: eb 97 jmp 402af9 + 402b62: 48 b8 45 72 72 6f 72 movabs $0x44203a726f727245,%rax + 402b69: 3a 20 44 + 402b6c: 48 ba 4e 53 20 69 73 movabs $0x6e7520736920534e,%rdx + 402b73: 20 75 6e + 402b76: 48 89 45 00 mov %rax,0x0(%rbp) + 402b7a: 48 89 55 08 mov %rdx,0x8(%rbp) + 402b7e: 48 b8 61 62 6c 65 20 movabs $0x206f7420656c6261,%rax + 402b85: 74 6f 20 + 402b88: 48 ba 72 65 73 6f 6c movabs $0x2065766c6f736572,%rdx + 402b8f: 76 65 20 + 402b92: 48 89 45 10 mov %rax,0x10(%rbp) + 402b96: 48 89 55 18 mov %rdx,0x18(%rbp) + 402b9a: 48 b8 73 65 72 76 65 movabs $0x6120726576726573,%rax + 402ba1: 72 20 61 + 402ba4: 48 89 45 20 mov %rax,0x20(%rbp) + 402ba8: c7 45 28 64 64 72 65 movl $0x65726464,0x28(%rbp) + 402baf: 66 c7 45 2c 73 73 movw $0x7373,0x2c(%rbp) + 402bb5: c6 45 2e 00 movb $0x0,0x2e(%rbp) + 402bb9: 89 df mov %ebx,%edi + 402bbb: e8 d0 e6 ff ff call 401290 + 402bc0: b8 ff ff ff ff mov $0xffffffff,%eax + 402bc5: e9 2f ff ff ff jmp 402af9 + 402bca: 4c 8d 05 fb 09 00 00 lea 0x9fb(%rip),%r8 # 4035cc + 402bd1: 48 8d 0d b0 09 00 00 lea 0x9b0(%rip),%rcx # 403588 + 402bd8: 48 c7 c2 ff ff ff ff mov $0xffffffffffffffff,%rdx + 402bdf: be 01 00 00 00 mov $0x1,%esi + 402be4: 48 89 ef mov %rbp,%rdi + 402be7: b8 00 00 00 00 mov $0x0,%eax + 402bec: e8 bf e7 ff ff call 4013b0 <__sprintf_chk@plt> + 402bf1: 89 df mov %ebx,%edi + 402bf3: e8 98 e6 ff ff call 401290 + 402bf8: b8 ff ff ff ff mov $0xffffffff,%eax + 402bfd: e9 f7 fe ff ff jmp 402af9 + 402c02: e8 69 e6 ff ff call 401270 <__stack_chk_fail@plt> + +0000000000402c07 : + 402c07: f3 0f 1e fa endbr64 + 402c0b: 53 push %rbx + 402c0c: 4c 89 c3 mov %r8,%rbx + 402c0f: 85 c9 test %ecx,%ecx + 402c11: 75 17 jne 402c2a + 402c13: 48 85 ff test %rdi,%rdi + 402c16: 74 05 je 402c1d + 402c18: 80 3f 00 cmpb $0x0,(%rdi) + 402c1b: 75 33 jne 402c50 + 402c1d: 66 c7 03 4f 4b movw $0x4b4f,(%rbx) + 402c22: c6 43 02 00 movb $0x0,0x2(%rbx) + 402c26: 89 c8 mov %ecx,%eax + 402c28: 5b pop %rbx + 402c29: c3 ret + 402c2a: 48 8d 35 aa 09 00 00 lea 0x9aa(%rip),%rsi # 4035db + 402c31: bf 01 00 00 00 mov $0x1,%edi + 402c36: b8 00 00 00 00 mov $0x0,%eax + 402c3b: e8 f0 e6 ff ff call 401330 <__printf_chk@plt> + 402c40: 66 c7 03 4f 4b movw $0x4b4f,(%rbx) + 402c45: c6 43 02 00 movb $0x0,0x2(%rbx) + 402c49: b8 00 00 00 00 mov $0x0,%eax + 402c4e: eb d8 jmp 402c28 + 402c50: 41 50 push %r8 + 402c52: 52 push %rdx + 402c53: 4c 8d 0d 98 09 00 00 lea 0x998(%rip),%r9 # 4035f2 + 402c5a: 49 89 f0 mov %rsi,%r8 + 402c5d: 48 89 f9 mov %rdi,%rcx + 402c60: 48 8d 15 8f 09 00 00 lea 0x98f(%rip),%rdx # 4035f6 + 402c67: be 6e 3b 00 00 mov $0x3b6e,%esi + 402c6c: 48 8d 3d 59 09 00 00 lea 0x959(%rip),%rdi # 4035cc + 402c73: e8 66 f5 ff ff call 4021de + 402c78: 48 83 c4 10 add $0x10,%rsp + 402c7c: eb aa jmp 402c28 + +Disassembly of section .fini: + +0000000000402c80 <_fini>: + 402c80: f3 0f 1e fa endbr64 + 402c84: 48 83 ec 08 sub $0x8,%rsp + 402c88: 48 83 c4 08 add $0x8,%rsp + 402c8c: c3 ret diff --git a/bomblab/bomb126/res1.txt b/bomblab/bomb126/res1.txt new file mode 100644 index 0000000..5c2178e --- /dev/null +++ b/bomblab/bomb126/res1.txt @@ -0,0 +1 @@ +0x50 0x75 0x62 0x6c 0x69 0x63 0x20 0x73 0x70 0x65 0x61 0x6b 0x69 0x6e 0x67 0x20 0x69 0x73 0x20 0x76 0x65 0x72 0x79 0x20 0x65 0x61 0x73 0x79 0x2e 0x00 \ No newline at end of file diff --git a/bomblab/bomb126/strings.txt b/bomblab/bomb126/strings.txt new file mode 100644 index 0000000..b05d13d --- /dev/null +++ b/bomblab/bomb126/strings.txt @@ -0,0 +1,430 @@ +/lib64/ld-linux-x86-64.so.2 +xd85 +fgets +__printf_chk +read +alarm +write +connect +__memmove_chk +__libc_start_main +__fprintf_chk +strcmp +socket +signal +fopen +strcpy +strtol +strcasecmp +__ctype_b_loc +stdout +puts +gethostname +fflush +close +strlen +sleep +getenv +stdin +gethostbyname +__sprintf_chk +stderr +__errno_location +exit +__isoc99_sscanf +__stack_chk_fail +libc.so.6 +GLIBC_2.3 +GLIBC_2.7 +GLIBC_2.3.4 +GLIBC_2.4 +GLIBC_2.34 +GLIBC_2.2.5 +__gmon_start__ +PTE1 +~-ATUS +[]A\ +AWAVAUATUSH +D$h1 +\$0H +D$8H +T$@H +D$HH +T$PH +D$XH +D$hdH+ +x[]A\A]A^A_ +ATUSH +[]A\ +T$@H +***truncH +ated*** +D$h1 +D$hdH+ +AVAUATUSI +[]A\A]A^ +AWAVAUATUSL +D$ L +l$@H +D$(I +Error: CH +lient unI +able to H +create sI +G ockefA +Error: DH +NS is unI +able to H +resolve I +server aI +G(ddrefA +G,ssA +Error: UH +nable toI + connectH + to the I +G servfA +G$erA +Error: RH +esult stI +ring tooH + large. I +IncreaseH + SUBMITRI +_MAXBUF + t`A +Error: CH +lient unI +able to H +read firI +st headeH +r from sI +G0ervefA +[]A\A]A^A_ +Error: CH +lient unI +able to H +read staI +tus messH +age fromI + server +Error: CH +lient unI +able to H +write toI + the serI +G(ver +Error: RH +esult stI +ring conH +tains anI + illegalH + or unprI +intable H +characteI +W8fA +G@r.A +t$8L +L$0L +D$(H +|$PH +D$`H +D$XH +L$] +That's number 2. Keep going! +Halfway there! +Good work! On to the next... +Welcome to my fiendish little bomb. You have 6 phases with +which to blow yourself up. Have a nice day! +Phase 1 defused. How about the next one? +So you got that one. Try this one. +Public speaking is very easy. +Wow! You've defused the secret stage! +So you think you can stop the bomb with ctrl-c, do you? +Initialization error: Running on an illegal host [1] +Initialization error: Running on an illegal host [2] +Your instructor has been notified. +Curses, you've found the secret phase! +But finding it and solving it are quite different... +Congratulations! You've defused the bomb! +Your instructor has been notified and will verify your solution. +Well... +OK. :-) +Invalid phase%s +Initialization error: +defused +exploded +%d:%s:%d:%s +BOOM!!! +The bomb has blown up. +%d %d %d %d %d %d +Error: Premature EOF on stdin +GRADE_BOMB +Error: Input line too long +%d %d %s +DrEvil +angelshark.ics.cs.cmu.edu +makoshark.ics.cs.cmu.edu +whaleshark.ics.cs.cmu.edu +Program timed out after %d seconds +Error: HTTP request failed with error %d: %s +GET /%s/submitr.pl/?userid=%s&userpwd=%s&lab=%s&result=%s&submit=submit HTTP/1.0 +Error: Unable to connect to server %s +%%%02X +%s %d %[a-zA-z ] +10.160.106.190 +AUTORESULT_STRING=%s +csapp +:*3$" +Kb19YKfveW6pIHQAJWGc +B22040723 +GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0 + +crt1.o +__abi_tag +crtstuff.c +deregister_tm_clones +__do_global_dtors_aux +completed.0 +__do_global_dtors_aux_fini_array_entry +frame_dummy +__frame_dummy_init_array_entry +bomb.c +phases.c +array.0 +support.c +sig_handler +driverlib.c +rio_readlineb +__FRAME_END__ +_DYNAMIC +__GNU_EH_FRAME_HDR +_GLOBAL_OFFSET_TABLE_ +skip +getenv@GLIBC_2.2.5 +phase_defused +strcasecmp@GLIBC_2.2.5 +__libc_start_main@GLIBC_2.34 +__errno_location@GLIBC_2.2.5 +stdout@GLIBC_2.2.5 +strcpy@GLIBC_2.2.5 +puts@GLIBC_2.2.5 +stdin@GLIBC_2.2.5 +write@GLIBC_2.2.5 +_edata +_fini +strlen@GLIBC_2.2.5 +__stack_chk_fail@GLIBC_2.4 +num_input_strings +phase_5 +initialize_bomb_solve +blank_line +submitr +phase_3 +phase_1 +invalid_phase +init_driver +alarm@GLIBC_2.2.5 +close@GLIBC_2.2.5 +node3 +read@GLIBC_2.2.5 +fgets@GLIBC_2.2.5 +explode_bomb +node1 +__data_start +strcmp@GLIBC_2.2.5 +signal@GLIBC_2.2.5 +gethostbyname@GLIBC_2.2.5 +node5 +__memmove_chk@GLIBC_2.3.4 +__gmon_start__ +strtol@GLIBC_2.2.5 +fun7 +__dso_handle +_IO_stdin_used +host_table +func4 +string_length +fflush@GLIBC_2.2.5 +__isoc99_sscanf@GLIBC_2.7 +_end +_dl_relocate_static_pie +secret_phase +infile +sigalrm_handler +init_timeout +__bss_start +userid +main +__printf_chk@GLIBC_2.3.4 +read_line +strings_not_equal +phase_4 +fopen@GLIBC_2.2.5 +phase_6 +scratch +driver_post +send_msg +phase_2 +gethostname@GLIBC_2.2.5 +exit@GLIBC_2.2.5 +bomb_id +connect@GLIBC_2.2.5 +__TMC_END__ +__fprintf_chk@GLIBC_2.3.4 +node2 +node4 +user_password +sleep@GLIBC_2.2.5 +node6 +_init +read_six_numbers +initialize_bomb +__ctype_b_loc@GLIBC_2.3 +stderr@GLIBC_2.2.5 +__sprintf_chk@GLIBC_2.3.4 +socket@GLIBC_2.2.5 +.symtab +.strtab +.shstrtab +.interp +.note.gnu.property +.note.gnu.build-id +.note.ABI-tag +.gnu.hash +.dynsym +.dynstr +.gnu.version +.gnu.version_r +.rela.dyn +.rela.plt +.init +.plt.sec +.text +.fini +.rodata +.eh_frame_hdr +.eh_frame +.init_array +.fini_array +.dynamic +.got +.got.plt +.data +.bss +.comment +.debug_aranges +.debug_info +.debug_abbrev +.debug_line +.debug_str +.debug_line_str +.debug_loclists diff --git a/bomblab/bomb126/symbols.txt b/bomblab/bomb126/symbols.txt new file mode 100644 index 0000000..de27412 --- /dev/null +++ b/bomblab/bomb126/symbols.txt @@ -0,0 +1,131 @@ + +bomb: file format elf64-x86-64 + +SYMBOL TABLE: +0000000000000000 l df *ABS* 0000000000000000 crt1.o +000000000040038c l O .note.ABI-tag 0000000000000020 __abi_tag +0000000000000000 l df *ABS* 0000000000000000 crtstuff.c +0000000000401410 l F .text 0000000000000000 deregister_tm_clones +0000000000401440 l F .text 0000000000000000 register_tm_clones +0000000000401480 l F .text 0000000000000000 __do_global_dtors_aux +00000000004057a8 l O .bss 0000000000000001 completed.0 +0000000000404e18 l O .fini_array 0000000000000000 __do_global_dtors_aux_fini_array_entry +00000000004014b0 l F .text 0000000000000000 frame_dummy +0000000000404e10 l O .init_array 0000000000000000 __frame_dummy_init_array_entry +0000000000000000 l df *ABS* 0000000000000000 bomb.c +0000000000000000 l df *ABS* 0000000000000000 phases.c +00000000004031a0 l O .rodata 0000000000000040 array.0 +0000000000000000 l df *ABS* 0000000000000000 support.c +0000000000401ab6 l F .text 0000000000000062 sig_handler +0000000000000000 l df *ABS* 0000000000000000 driverlib.c +0000000000402112 l F .text 00000000000000cc rio_readlineb +0000000000000000 l df *ABS* 0000000000000000 crtstuff.c +0000000000403c30 l O .eh_frame 0000000000000000 __FRAME_END__ +0000000000000000 l df *ABS* 0000000000000000 +0000000000404e20 l O .dynamic 0000000000000000 _DYNAMIC +00000000004035fc l .eh_frame_hdr 0000000000000000 __GNU_EH_FRAME_HDR +0000000000405000 l O .got.plt 0000000000000000 _GLOBAL_OFFSET_TABLE_ +0000000000401d11 g F .text 0000000000000052 skip +0000000000000000 F *UND* 0000000000000000 getenv@GLIBC_2.2.5 +0000000000402014 g F .text 00000000000000c8 phase_defused +00000000004052f0 g O .data 0000000000000018 n31 +0000000000000000 F *UND* 0000000000000000 strcasecmp@GLIBC_2.2.5 +0000000000000000 F *UND* 0000000000000000 __libc_start_main@GLIBC_2.34 +0000000000000000 F *UND* 0000000000000000 __errno_location@GLIBC_2.2.5 +0000000000405780 g O .bss 0000000000000008 stdout@GLIBC_2.2.5 +0000000000405100 w .data 0000000000000000 data_start +0000000000405820 g O .bss 0000000000000640 input_strings +0000000000000000 F *UND* 0000000000000000 strcpy@GLIBC_2.2.5 +00000000004052d0 g O .data 0000000000000018 n33 +0000000000000000 F *UND* 0000000000000000 puts@GLIBC_2.2.5 +0000000000405790 g O .bss 0000000000000008 stdin@GLIBC_2.2.5 +0000000000000000 F *UND* 0000000000000000 write@GLIBC_2.2.5 +0000000000405780 g .data 0000000000000000 _edata +0000000000405170 g O .data 0000000000000018 n44 +00000000004051d0 g O .data 0000000000000018 n46 +0000000000405190 g O .data 0000000000000018 n42 +00000000004051f0 g O .data 0000000000000018 n48 +0000000000402c80 g F .fini 0000000000000000 .hidden _fini +0000000000000000 F *UND* 0000000000000000 strlen@GLIBC_2.2.5 +0000000000000000 F *UND* 0000000000000000 __stack_chk_fail@GLIBC_2.4 +0000000000405810 g O .bss 0000000000000004 num_input_strings +0000000000401815 g F .text 0000000000000097 phase_5 +0000000000401ccd g F .text 0000000000000005 initialize_bomb_solve +0000000000401cd2 g F .text 000000000000003f blank_line +00000000004021de g F .text 0000000000000804 submitr +00000000004016aa g F .text 00000000000000bb phase_3 +0000000000401614 g F .text 0000000000000024 phase_1 +0000000000401b18 g F .text 000000000000002d invalid_phase +0000000000402a12 g F .text 00000000000001f5 init_driver +0000000000000000 F *UND* 0000000000000000 alarm@GLIBC_2.2.5 +0000000000000000 F *UND* 0000000000000000 close@GLIBC_2.2.5 +0000000000405350 g O .data 0000000000000010 node3 +0000000000000000 F *UND* 0000000000000000 read@GLIBC_2.2.5 +0000000000000000 F *UND* 0000000000000000 fgets@GLIBC_2.2.5 +0000000000401e55 g F .text 0000000000000042 explode_bomb +0000000000405330 g O .data 0000000000000010 node1 +0000000000405100 g .data 0000000000000000 __data_start +0000000000000000 F *UND* 0000000000000000 strcmp@GLIBC_2.2.5 +0000000000000000 F *UND* 0000000000000000 signal@GLIBC_2.2.5 +0000000000000000 F *UND* 0000000000000000 gethostbyname@GLIBC_2.2.5 +0000000000405370 g O .data 0000000000000010 node5 +0000000000000000 F *UND* 0000000000000000 __memmove_chk@GLIBC_2.3.4 +0000000000000000 w *UND* 0000000000000000 __gmon_start__ +0000000000000000 F *UND* 0000000000000000 strtol@GLIBC_2.2.5 +0000000000401a19 g F .text 0000000000000041 fun7 +0000000000405108 g O .data 0000000000000000 .hidden __dso_handle +0000000000403000 g O .rodata 0000000000000004 _IO_stdin_used +0000000000405290 g O .data 0000000000000018 n22 +0000000000405380 g O .data 0000000000000400 host_table +0000000000401765 g F .text 000000000000003b func4 +0000000000405250 g O .data 0000000000000018 n1 +0000000000401b45 g F .text 0000000000000021 string_length +0000000000000000 F *UND* 0000000000000000 fflush@GLIBC_2.2.5 +0000000000000000 F *UND* 0000000000000000 __isoc99_sscanf@GLIBC_2.7 +0000000000405310 g O .data 0000000000000018 n34 +00000000004052b0 g O .data 0000000000000018 n32 +0000000000405e60 g .bss 0000000000000000 _end +0000000000401400 g F .text 0000000000000005 .hidden _dl_relocate_static_pie +00000000004013d0 g F .text 0000000000000026 _start +0000000000401a5a g F .text 000000000000005c secret_phase +00000000004057b0 g O .bss 0000000000000008 infile +00000000004020dc g F .text 0000000000000036 sigalrm_handler +00000000004029e2 g F .text 0000000000000030 init_timeout +0000000000405780 g .bss 0000000000000000 __bss_start +0000000000405238 g O .data 000000000000000a userid +00000000004014b6 g F .text 000000000000015e main +0000000000000000 F *UND* 0000000000000000 __printf_chk@GLIBC_2.3.4 +0000000000405150 g O .data 0000000000000018 n47 +00000000004051b0 g O .data 0000000000000018 n43 +0000000000405130 g O .data 0000000000000018 n41 +0000000000401edc g F .text 0000000000000138 read_line +0000000000405110 g O .data 0000000000000018 n45 +0000000000401b66 g F .text 0000000000000060 strings_not_equal +00000000004017a0 g F .text 0000000000000075 phase_4 +0000000000000000 F *UND* 0000000000000000 fopen@GLIBC_2.2.5 +00000000004018ac g F .text 000000000000016d phase_6 +00000000004057c0 g O .bss 0000000000000050 scratch +0000000000402c07 g F .text 0000000000000077 driver_post +0000000000401d63 g F .text 00000000000000f2 send_msg +0000000000401638 g F .text 0000000000000072 phase_2 +0000000000000000 F *UND* 0000000000000000 gethostname@GLIBC_2.2.5 +0000000000000000 F *UND* 0000000000000000 exit@GLIBC_2.2.5 +0000000000405244 g O .data 0000000000000004 bomb_id +0000000000000000 F *UND* 0000000000000000 connect@GLIBC_2.2.5 +0000000000405780 g O .data 0000000000000000 .hidden __TMC_END__ +0000000000000000 F *UND* 0000000000000000 __fprintf_chk@GLIBC_2.3.4 +0000000000405340 g O .data 0000000000000010 node2 +0000000000405360 g O .data 0000000000000010 node4 +0000000000405220 g O .data 0000000000000015 user_password +0000000000000000 F *UND* 0000000000000000 sleep@GLIBC_2.2.5 +0000000000405210 g O .data 0000000000000010 node6 +0000000000401000 g F .init 0000000000000000 .hidden _init +0000000000401e97 g F .text 0000000000000045 read_six_numbers +0000000000405270 g O .data 0000000000000018 n21 +0000000000401bc6 g F .text 0000000000000107 initialize_bomb +0000000000000000 F *UND* 0000000000000000 __ctype_b_loc@GLIBC_2.3 +00000000004057a0 g O .bss 0000000000000008 stderr@GLIBC_2.2.5 +0000000000000000 F *UND* 0000000000000000 __sprintf_chk@GLIBC_2.3.4 +0000000000000000 F *UND* 0000000000000000 socket@GLIBC_2.2.5 + + diff --git a/datalab-handout/.vscode/tasks.json b/datalab-handout/.vscode/tasks.json new file mode 100644 index 0000000..08d9005 --- /dev/null +++ b/datalab-handout/.vscode/tasks.json @@ -0,0 +1,28 @@ +{ + "tasks": [ + { + "type": "cppbuild", + "label": "C/C++: gcc build active file", + "command": "/usr/bin/gcc", + "args": [ + "-fdiagnostics-color=always", + "-g", + "${file}", + "-o", + "${fileDirname}/${fileBasenameNoExtension}" + ], + "options": { + "cwd": "${fileDirname}" + }, + "problemMatcher": [ + "$gcc" + ], + "group": { + "kind": "build", + "isDefault": true + }, + "detail": "Task generated by Debugger." + } + ], + "version": "2.0.0" +} \ No newline at end of file diff --git a/datalab-handout/Driverhdrs.pm b/datalab-handout/Driverhdrs.pm new file mode 100644 index 0000000..ecf5e2a --- /dev/null +++ b/datalab-handout/Driverhdrs.pm @@ -0,0 +1,12 @@ +# +# This file contains configuration variables for drivers. +# It was generated by genhdrs.pl. Do not modify it. +# +package Driverhdrs; + +$LAB = "datalab"; +$SERVER_NAME = "changeme.ics.cs.cmu.edu"; +$SERVER_PORT = 8081; +$COURSE_NAME = "csapp"; +$AUTOGRADE_TIMEOUT = 0; +1; diff --git a/datalab-handout/Driverlib.pm b/datalab-handout/Driverlib.pm new file mode 100644 index 0000000..d7f7da1 --- /dev/null +++ b/datalab-handout/Driverlib.pm @@ -0,0 +1,138 @@ +############################################################### +# Driverlib.pm - A package of helper functions for Perl drivers +# +# Copyright (c) 2005 David R. O'Hallaron, All rights reserved. +############################################################### + +package Driverlib; + +use Socket; + +# Autogenerated header file with lab-specific constants +use lib "."; +use Driverhdrs; + +require Exporter; +@ISA = qw(Exporter); +@EXPORT = qw( + driver_post + ); + +use strict; + +##### +# Public functions +# + +# +# driver_post - This is the routine that a driver calls when +# it needs to transmit an autoresult string to the result server. +# +sub driver_post ($$) { + my $userid = shift; # User id for this submission + my $result = shift; # Autoresult string + my $autograded = shift; # Set if called by an autograder + + # Echo the autoresult string to stdout if the driver was called + # by an autograder + if ($autograded) { + print "\n"; + print "AUTORESULT_STRING=$result\n"; + return; + } + + # If the driver was called with a specific userid, then submit + # the autoresult string to the result server over the Internet. + if ($userid) { + my $status = submitr($Driverhdrs::SERVER_NAME, + $Driverhdrs::SERVER_PORT, + $Driverhdrs::COURSE_NAME, + $userid, + $Driverhdrs::LAB, + $result); + + # Print the status of the transfer + if (!($status =~ /OK/)) { + print "$status\n"; + print "Did not send autoresult string to the result server.\n"; + exit(1); + } + print "Success: Sent autoresult string for $userid to the result server.\n"; + } +} + + +##### +# Private functions +# + +# +# submitr - Sends an autoresult string to the result server +# +sub submitr ($$$$$$) { + my $hostname = shift; + my $port = shift; + my $course = shift; + my $userid = shift; + my $lab = shift; + my $result = shift; + + my $internet_addr; + my $enc_result; + my $paddr; + my $line; + my $http_version; + my $errcode; + my $errmsg; + + # Establish the connection to the server + socket(SERVER, PF_INET, SOCK_STREAM, getprotobyname('tcp')); + $internet_addr = inet_aton($hostname) + or die "Could not convert $hostname to an internet address: $!\n"; + $paddr = sockaddr_in($port, $internet_addr); + connect(SERVER, $paddr) + or die "Could not connect to $hostname:$port:$!\n"; + + select((select(SERVER), $| = 1)[0]); # enable command buffering + + # Send HTTP request to server + $enc_result = url_encode($result); + print SERVER "GET /$course/submitr.pl/?userid=$userid&lab=$lab&result=$enc_result&submit=submit HTTP/1.0\r\n\r\n"; + + # Get first HTTP response line + $line = ; + chomp($line); + ($http_version, $errcode, $errmsg) = split(/\s+/, $line); + if ($errcode != 200) { + return "Error: HTTP request failed with error $errcode: $errmsg"; + } + + # Read the remaining HTTP response header lines + while ($line = ) { + if ($line =~ /^\r\n/) { + last; + } + } + + # Read and return the response from the result server + $line = ; + chomp($line); + + close SERVER; + return $line; + +} + +# +# url_encode - Encode text string so it can be included in URI of GET request +# +sub url_encode ($) { + my $value = shift; + + $value =~s/([^a-zA-Z0-9_\-.])/uc sprintf("%%%02x",ord($1))/eg; + return $value; +} + +# Always end a module with a 1 so that it returns TRUE +1; + diff --git a/datalab-handout/Makefile b/datalab-handout/Makefile new file mode 100644 index 0000000..1ef6fcf --- /dev/null +++ b/datalab-handout/Makefile @@ -0,0 +1,26 @@ +# +# Makefile that builds btest and other helper programs for the CS:APP data lab +# +CC = gcc +CFLAGS = -O -Wall -m32 +LIBS = -lm + +all: btest fshow ishow + +btest: btest.c bits.c decl.c tests.c btest.h bits.h + $(CC) $(CFLAGS) $(LIBS) -o btest bits.c btest.c decl.c tests.c + +fshow: fshow.c + $(CC) $(CFLAGS) -o fshow fshow.c + +ishow: ishow.c + $(CC) $(CFLAGS) -o ishow ishow.c + +# Forces a recompile. Used by the driver program. +btestexplicit: + $(CC) $(CFLAGS) $(LIBS) -o btest bits.c btest.c decl.c tests.c + +clean: + rm -f *.o btest fshow ishow *~ + + diff --git a/datalab-handout/README b/datalab-handout/README new file mode 100644 index 0000000..e73d37f --- /dev/null +++ b/datalab-handout/README @@ -0,0 +1,140 @@ +*********************** +The CS:APP Data Lab +Directions to Students +*********************** + +Your goal is to modify your copy of bits.c so that it passes all the +tests in btest without violating any of the coding guidelines. + + +********* +0. Files: +********* + +Makefile - Makes btest, fshow, and ishow +README - This file +bits.c - The file you will be modifying and handing in +bits.h - Header file +btest.c - The main btest program + btest.h - Used to build btest + decl.c - Used to build btest + tests.c - Used to build btest + tests-header.c- Used to build btest +dlc* - Rule checking compiler binary (data lab compiler) +driver.pl* - Driver program that uses btest and dlc to autograde bits.c +Driverhdrs.pm - Header file for optional "Beat the Prof" contest +fshow.c - Utility for examining floating-point representations +ishow.c - Utility for examining integer representations + +*********************************************************** +1. Modifying bits.c and checking it for compliance with dlc +*********************************************************** + +IMPORTANT: Carefully read the instructions in the bits.c file before +you start. These give the coding rules that you will need to follow if +you want full credit. + +Use the dlc compiler (./dlc) to automatically check your version of +bits.c for compliance with the coding guidelines: + + unix> ./dlc bits.c + +dlc returns silently if there are no problems with your code. +Otherwise it prints messages that flag any problems. Running dlc with +the -e switch: + + unix> ./dlc -e bits.c + +causes dlc to print counts of the number of operators used by each function. + +Once you have a legal solution, you can test it for correctness using +the ./btest program. + +********************* +2. Testing with btest +********************* + +The Makefile in this directory compiles your version of bits.c with +additional code to create a program (or test harness) named btest. + +To compile and run the btest program, type: + + unix> make btest + unix> ./btest [optional cmd line args] + +You will need to recompile btest each time you change your bits.c +program. When moving from one platform to another, you will want to +get rid of the old version of btest and generate a new one. Use the +commands: + + unix> make clean + unix> make btest + +Btest tests your code for correctness by running millions of test +cases on each function. It tests wide swaths around well known corner +cases such as Tmin and zero for integer puzzles, and zero, inf, and +the boundary between denormalized and normalized numbers for floating +point puzzles. When btest detects an error in one of your functions, +it prints out the test that failed, the incorrect result, and the +expected result, and then terminates the testing for that function. + +Here are the command line options for btest: + + unix> ./btest -h + Usage: ./btest [-hg] [-r ] [-f [-1|-2|-3 ]*] [-T