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
| .text:0000000000400560 ; int __cdecl main(int argc, const char **argv, const char **envp) .text:0000000000400560 public main .text:0000000000400560 main proc near ; DATA XREF: _start+1D↓o .text:0000000000400560 .text:0000000000400560 var_42C = dword ptr -42Ch .text:0000000000400560 var_41C = qword ptr -41Ch .text:0000000000400560 .text:0000000000400560 ; __unwind { .text:0000000000400560 push r12 .text:0000000000400562 push rbp .text:0000000000400563 xor ecx, ecx ; n .text:0000000000400565 push rbx .text:0000000000400566 mov edx, 2 ; modes .text:000000000040056B xor esi, esi ; buf .text:000000000040056D xor ebx, ebx .text:000000000040056F sub rsp, 420h .text:0000000000400576 mov rdi, cs:stdin@@GLIBC_2_2_5 ; stream .text:000000000040057D lea rbp, [rsp+32] .text:0000000000400582 lea r12, [rsp+28] .text:0000000000400587 call _setvbuf .text:000000000040058C mov rdi, cs:__bss_start ; stream .text:0000000000400593 xor ecx, ecx ; n .text:0000000000400595 mov edx, 2 ; modes .text:000000000040059A xor esi, esi ; buf .text:000000000040059C call _setvbuf .text:00000000004005A1 lea rsi, aBufferP ; "buffer = %p.\n" .text:00000000004005A8 mov rdx, rbp .text:00000000004005AB mov edi, 1 .text:00000000004005B0 xor eax, eax .text:00000000004005B2 call ___printf_chk .text:00000000004005B7 .text:00000000004005B7 loc_4005B7: ; CODE XREF: main+BF↓j .text:00000000004005B7 lea rdi, format ; "%u" .text:00000000004005BE xor eax, eax .text:00000000004005C0 mov rsi, r12 .text:00000000004005C3 call _scanf .text:00000000004005C8 inc eax .text:00000000004005CA cmp eax, 1 .text:00000000004005CD jbe short loc_400621 .text:00000000004005CF mov edi, [rsp+28] ; __int64 .text:00000000004005D3 mov [rsp+12], edi .text:00000000004005D7 call _Z6millerx ; miller(long long) .text:00000000004005DC test al, al .text:00000000004005DE mov edx, [rsp+12] ; edx为input .text:00000000004005E2 jz short loc_400606 .text:00000000004005E4 lea rsi, aGoodUIsPrime ; "Good! %u is prime.\n" .text:00000000004005EB mov edi, 1 .text:00000000004005F0 xor eax, eax .text:00000000004005F2 call ___printf_chk .text:00000000004005F7 mov edx, [rsp+28] .text:00000000004005FB movsxd rax, ebx .text:00000000004005FE inc ebx ; 循环次数 .text:0000000000400600 mov [rsp+rax*4+32], edx ; 第一次rax=1 .text:0000000000400604 jmp short loc_400619 .text:0000000000400606 ; --------------------------------------------------------------------------- .text:0000000000400606 .text:0000000000400606 loc_400606: ; CODE XREF: main+82↑j .text:0000000000400606 lea rsi, aBadUIsNotPrime ; "Bad! %u is not prime.\n" .text:000000000040060D mov edi, 1 .text:0000000000400612 xor eax, eax .text:0000000000400614 call ___printf_chk .text:0000000000400619 .text:0000000000400619 loc_400619: ; CODE XREF: main+A4↑j .text:0000000000400619 cmp ebx, 255 .text:000000000040061F jle short loc_4005B7 .text:0000000000400621 .text:0000000000400621 loc_400621: ; CODE XREF: main+6D↑j .text:0000000000400621 call rbp .text:0000000000400623 add rsp, 1056 .text:000000000040062A xor eax, eax .text:000000000040062C pop rbx .text:000000000040062D pop rbp .text:000000000040062E pop r12 .text:0000000000400630 retn .text:0000000000400630 ; } // starts at 400560 .text:0000000000400630 main endp
|