1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145
| .text:00000000004004E0 ; __int64 __fastcall main(int, char **, char **) .text:00000000004004E0 main proc near ; DATA XREF: start+1D↓o .text:00000000004004E0 .text:00000000004004E0 var_1C = dword ptr -1Ch .text:00000000004004E0 .text:00000000004004E0 ; __unwind { .text:00000000004004E0 000 55 push rbp .text:00000000004004E1 008 53 push rbx .text:00000000004004E2 010 31 F6 xor esi, esi ; buf .text:00000000004004E4 010 BD E1 07 40 00 mov ebp, offset unk_4007E1 .text:00000000004004E9 010 31 DB xor ebx, ebx ; Logical Exclusive OR .text:00000000004004EB 010 48 83 EC 18 sub rsp, 18h ; Integer Subtraction .text:00000000004004EF 028 48 8B 3D 42 0B 20 00 mov rdi, cs:stdout ; stream 这里 .text:00000000004004F6 028 E8 B5 FF FF FF call _setbuf ; Call Procedure 这里 .text:00000000004004FB 028 BF D0 07 40 00 mov edi, offset format ; "The flag is: " .text:0000000000400500 028 31 C0 xor eax, eax ; Logical Exclusive OR .text:0000000000400502 028 E8 B9 FF FF FF call _printf ; Call Procedure 这里 .text:0000000000400507 028 41 B9 49 00 00 00 mov r9d, 49h ; 'I' .text:000000000040050D 028 0F 1F 00 nop dword ptr [rax] ; No Operation .text:0000000000400510 .text:0000000000400510 loc_400510: ; CODE XREF: main+8A↓j .text:0000000000400510 028 45 31 C0 xor r8d, r8d ; Logical Exclusive OR .text:0000000000400513 028 EB 06 jmp short loc_40051B ; Jump .text:0000000000400513 ; --------------------------------------------------------------------------- .text:0000000000400515 028 0F 1F 00 align 8 .text:0000000000400518 .text:0000000000400518 loc_400518: ; CODE XREF: main+67↓j .text:0000000000400518 028 41 89 F9 mov r9d, edi .text:000000000040051B .text:000000000040051B loc_40051B: ; CODE XREF: main+33↑j .text:000000000040051B 028 42 8D 3C 03 lea edi, [rbx+r8] ; Load Effective Address .text:000000000040051F 028 48 8D 74 24 0C lea rsi, [rsp+28h+var_1C] ; Load Effective Address .text:0000000000400524 028 C7 44 24 0C 00 00 00 00 mov [rsp+28h+var_1C], 0 .text:000000000040052C 028 E8 3F 01 00 00 call sub_400670 ; Call Procedure .text:0000000000400531 028 8B 7C 24 0C mov edi, [rsp+28h+var_1C] .text:0000000000400535 028 44 89 C1 mov ecx, r8d .text:0000000000400538 028 49 83 C0 01 add r8, 1 ; Add .text:000000000040053C 028 D3 E7 shl edi, cl ; Shift Logical Left .text:000000000040053E 028 89 F8 mov eax, edi .text:0000000000400540 028 44 31 CF xor edi, r9d ; Logical Exclusive OR .text:0000000000400543 028 49 83 F8 08 cmp r8, 8 ; Compare Two Operands .text:0000000000400547 028 75 CF jnz short loc_400518 ; Jump if Not Zero (ZF=0) .text:0000000000400549 028 83 C3 08 add ebx, 8 ; Add .text:000000000040054C 028 44 38 C8 cmp al, r9b ; Compare Two Operands .text:000000000040054F 028 48 8B 35 E2 0A 20 00 mov rsi, cs:stdout ; fp 这里 .text:0000000000400556 028 74 18 jz short loc_400570 ; Jump if Zero (ZF=1) .text:0000000000400558 028 40 0F BE FF movsx edi, dil ; c .text:000000000040055C 028 48 83 C5 01 add rbp, 1 ; Add .text:0000000000400560 028 E8 6B FF FF FF call __IO_putc ; Call Procedure .text:0000000000400565 028 44 0F B6 4D FF movzx r9d, byte ptr [rbp-1] ; Move with Zero-Extend .text:000000000040056A 028 EB A4 jmp short loc_400510 ; Jump .text:000000000040056A ; --------------------------------------------------------------------------- .text:000000000040056C 028 0F 1F 40 00 align 10h .text:0000000000400570 .text:0000000000400570 loc_400570: ; CODE XREF: main+76↑j .text:0000000000400570 028 BF 0A 00 00 00 mov edi, 0Ah ; c .text:0000000000400575 028 E8 56 FF FF FF call __IO_putc ; Call Procedure .text:000000000040057A 028 48 83 C4 18 add rsp, 18h ; Add .text:000000000040057E 010 31 C0 xor eax, eax ; Logical Exclusive OR .text:0000000000400580 010 5B pop rbx .text:0000000000400581 008 5D pop rbp .text:0000000000400582 000 C3 retn ; Return Near from Procedure .text:0000000000400582 ; } // starts at 4004E0 .text:0000000000400582 main endp
.text:0000000000400670 ; __int64 __fastcall sub_400670(int, _DWORD *) .text:0000000000400670 sub_400670 proc near ; CODE XREF: main+4C↑p .text:0000000000400670 ; sub_400670+19↓p ... .text:0000000000400670 ; __unwind { .text:0000000000400670 000 85 FF test edi, edi ; Logical Compare .text:0000000000400672 000 41 54 push r12 .text:0000000000400674 008 55 push rbp .text:0000000000400675 010 48 89 F5 mov rbp, rsi .text:0000000000400678 010 53 push rbx .text:0000000000400679 018 74 7D jz short loc_4006F8 ; Jump if Zero (ZF=1) .text:000000000040067B 018 83 FF 01 cmp edi, 1 ; Compare Two Operands .text:000000000040067E 018 89 FB mov ebx, edi .text:0000000000400680 018 0F 84 8A 00 00 00 jz loc_400710 ; Jump if Zero (ZF=1) .text:0000000000400686 018 8D 7F FE lea edi, [rdi-2] ; Load Effective Address .text:0000000000400689 018 E8 E2 FF FF FF call sub_400670 ; Call Procedure .text:000000000040068E 018 8D 7B FF lea edi, [rbx-1] ; Load Effective Address .text:0000000000400691 018 41 89 C4 mov r12d, eax .text:0000000000400694 018 48 89 EE mov rsi, rbp .text:0000000000400697 018 E8 D4 FF FF FF call sub_400670 ; Call Procedure .text:000000000040069C 018 44 01 E0 add eax, r12d ; Add .text:000000000040069F 018 89 C2 mov edx, eax .text:00000000004006A1 018 89 C3 mov ebx, eax .text:00000000004006A3 018 D1 EA shr edx, 1 ; Shift Logical Right .text:00000000004006A5 018 81 E2 55 55 55 55 and edx, 55555555h ; Logical AND .text:00000000004006AB 018 29 D3 sub ebx, edx ; Integer Subtraction .text:00000000004006AD 018 89 D9 mov ecx, ebx .text:00000000004006AF 018 89 DA mov edx, ebx .text:00000000004006B1 018 C1 E9 02 shr ecx, 2 ; Shift Logical Right .text:00000000004006B4 018 81 E1 33 33 33 33 and ecx, 33333333h ; Logical AND .text:00000000004006BA 018 89 CE mov esi, ecx .text:00000000004006BC .text:00000000004006BC loc_4006BC: ; CODE XREF: sub_400670+C2↓j .text:00000000004006BC 018 81 E2 33 33 33 33 and edx, 33333333h ; Logical AND .text:00000000004006C2 018 8D 0C 16 lea ecx, [rsi+rdx] ; Load Effective Address .text:00000000004006C5 018 89 CA mov edx, ecx .text:00000000004006C7 018 C1 EA 04 shr edx, 4 ; Shift Logical Right .text:00000000004006CA 018 01 CA add edx, ecx ; Add .text:00000000004006CC 018 89 D6 mov esi, edx .text:00000000004006CE 018 81 E2 0F 0F 0F 0F and edx, 0F0F0F0Fh ; Logical AND .text:00000000004006D4 018 C1 EE 08 shr esi, 8 ; Shift Logical Right .text:00000000004006D7 018 81 E6 0F 0F 0F 00 and esi, 0F0F0Fh ; Logical AND .text:00000000004006DD 018 8D 0C 16 lea ecx, [rsi+rdx] ; Load Effective Address .text:00000000004006E0 018 89 CA mov edx, ecx .text:00000000004006E2 018 C1 EA 10 shr edx, 10h ; Shift Logical Right .text:00000000004006E5 018 01 CA add edx, ecx ; Add .text:00000000004006E7 018 83 E2 01 and edx, 1 ; Logical AND .text:00000000004006EA 018 31 55 00 xor [rbp+0], edx ; Logical Exclusive OR .text:00000000004006ED 018 5B pop rbx .text:00000000004006EE 010 5D pop rbp .text:00000000004006EF 008 41 5C pop r12 .text:00000000004006F1 000 C3 retn ; Return Near from Procedure .text:00000000004006F1 ; --------------------------------------------------------------------------- .text:00000000004006F2 000 66 0F 1F 44 00 00 align 8 .text:00000000004006F8 .text:00000000004006F8 loc_4006F8: ; CODE XREF: sub_400670+9↑j .text:00000000004006F8 018 BA 01 00 00 00 mov edx, 1 .text:00000000004006FD 018 31 55 00 xor [rbp+0], edx ; Logical Exclusive OR .text:0000000000400700 018 B8 01 00 00 00 mov eax, 1 .text:0000000000400705 018 5B pop rbx .text:0000000000400706 010 5D pop rbp .text:0000000000400707 008 41 5C pop r12 .text:0000000000400709 000 C3 retn ; Return Near from Procedure .text:0000000000400709 ; --------------------------------------------------------------------------- .text:000000000040070A 000 66 0F 1F 44 00 00 align 10h .text:0000000000400710 .text:0000000000400710 loc_400710: ; CODE XREF: sub_400670+10↑j .text:0000000000400710 018 31 FF xor edi, edi ; Logical Exclusive OR .text:0000000000400712 018 E8 59 FF FF FF call sub_400670 ; Call Procedure .text:0000000000400717 018 89 C2 mov edx, eax .text:0000000000400719 018 89 C7 mov edi, eax .text:000000000040071B 018 D1 EA shr edx, 1 ; Shift Logical Right .text:000000000040071D 018 81 E2 55 55 55 55 and edx, 55555555h ; Logical AND .text:0000000000400723 018 29 D7 sub edi, edx ; Integer Subtraction .text:0000000000400725 018 89 FE mov esi, edi .text:0000000000400727 018 89 FA mov edx, edi .text:0000000000400729 018 C1 EE 02 shr esi, 2 ; Shift Logical Right .text:000000000040072C 018 81 E6 33 33 33 33 and esi, 33333333h ; Logical AND .text:0000000000400732 018 EB 88 jmp short loc_4006BC ; Jump .text:0000000000400732 ; } // starts at 400670 .text:0000000000400732 sub_400670 endp
|