Created
May 26, 2012 19:27
-
-
Save awreece/2795046 to your computer and use it in GitHub Desktop.
hopper output
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void sub_2648(void) { | |
rax = *(rsi + 0x8); | |
rbx = rdi; | |
if (*(rsi + 0x8) != 0x0) { | |
r14 = rsi; | |
rdi = rax; | |
do { | |
putenv(rdi); | |
rdi = *(r14 + 0x10); | |
r14 = r14 + 0x8; | |
} while (rdi != 0x0); | |
} | |
else { | |
r14 = rsi; | |
} | |
rax = getenv("MBC_DEBUG"); | |
if (rax != 0x0) { | |
rax = atoi(rax); | |
if ((rax & 0x4) != 0x0) { | |
NSLog(@"Chess starting\\n"); | |
} | |
} | |
rax = [NSAutoreleasePool alloc]; | |
rdi = rax; | |
rax = [rdi init]; | |
r15 = rax; | |
rax = [NSBundle mainBundle]; | |
rdi = rax; | |
rax = [rdi pathForResource:@"Defaults" ofType:@"plist"]; | |
rdx = rax; | |
rax = [NSDictionary dictionaryWithContentsOfFile:rdx]; | |
r12 = rax; | |
rax = [NSUserDefaults standardUserDefaults]; | |
[rax registerDefaults:r12]; | |
rax = [NSUserDefaults standardUserDefaults]; | |
[rax synchronize]; | |
[r15 drain]; | |
rdi = rbx; | |
rsi = r14; | |
rax = NSApplicationMain(rdi, rsi); | |
return rax; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
================ B E G I N O F P R O C E D U R E ================ | |
; Basic Block Input Regs: rsi rdi - Killed Regs: rax rbx | |
sub_2648: | |
0000000000002648 55 push rbp ; XREF=0x263b | |
0000000000002649 4889E5 mov rbp, rsp | |
000000000000264c 4157 push r15 | |
000000000000264e 4156 push r14 | |
0000000000002650 4154 push r12 | |
0000000000002652 53 push rbx | |
0000000000002653 488B4608 mov rax, qword [ds:rsi+0x8] | |
0000000000002657 4885C0 test rax, rax | |
000000000000265a 89FB mov ebx, edi | |
000000000000265c 0F8429010000 je 0x278B | |
; Basic Block Input Regs: rax rsi - Killed Regs: rdi r14 | |
0000000000002662 4989F6 mov r14, rsi | |
0000000000002665 4889C7 mov rdi, rax | |
; Basic Block Input Regs: r14 - Killed Regs: rdi r14 | |
0000000000002668 E85BA70100 call imp___stubs__putenv ; XREF=0x2678 | |
000000000000266d 498B7E10 mov rdi, qword [ds:r14+0x10] | |
0000000000002671 4983C608 add r14, 0x8 | |
0000000000002675 4885FF test rdi, rdi | |
0000000000002678 75EE jne 0x2668 | |
; Basic Block Input Regs: rax - Killed Regs: rdi | |
000000000000267a 488D3D59F00100 lea rdi, qword [ds:0x216DA] ; "MBC_DEBUG" XREF=0x278e | |
0000000000002681 E85CA50100 call imp___stubs__getenv | |
0000000000002686 4885C0 test rax, rax | |
0000000000002689 741A je 0x26A5 | |
; Basic Block Input Regs: rax - Killed Regs: rdi | |
000000000000268b 4889C7 mov rdi, rax | |
000000000000268e E8E9A40100 call imp___stubs__atoi | |
0000000000002693 A804 test al, 0x4 | |
0000000000002695 740E je 0x26A5 | |
; Basic Block Input Regs: rax - Killed Regs: rax rdi | |
0000000000002697 488D3DD2D70200 lea rdi, qword [ds:cfstring_Chess_starting_] ; @"Chess starting\\n" | |
000000000000269e 30C0 xor al, al | |
00000000000026a0 E83BA40100 call imp___stubs__NSLog | |
; Basic Block Input Regs: rax rbx rsp r14 - Killed Regs: rax rcx rdx rbx rbp rsi rdi r12 r14 r15 | |
00000000000026a5 488B3D34CE0200 mov rdi, qword [ds:bind__OBJC_CLASS_$_NSAutoreleasePool] ; XREF=0x2689, 0x2695 | |
00000000000026ac 488D352DCD0200 lea rsi, qword [ds:objc_msg_alloc] ; @selector(alloc) | |
00000000000026b3 FF1527CD0200 call qword [ds:objc_msg_alloc] ; @selector(alloc) | |
00000000000026b9 488B35F8BE0200 mov rsi, qword [ds:objc_sel_init] ; @selector(init) | |
00000000000026c0 4889C7 mov rdi, rax | |
00000000000026c3 30C0 xor al, al | |
00000000000026c5 E8E6A60100 call imp___stubs__objc_msgSend | |
00000000000026ca 4989C7 mov r15, rax | |
00000000000026cd 4C8B2514CE0200 mov r12, qword [ds:bind__OBJC_CLASS_$_NSDictionary] | |
00000000000026d4 488B35D5BE0200 mov rsi, qword [ds:objc_sel_mainBundle] ; @selector(mainBundle) | |
00000000000026db 488B3D0ECE0200 mov rdi, qword [ds:bind__OBJC_CLASS_$_NSBundle] | |
00000000000026e2 30C0 xor al, al | |
00000000000026e4 E8C7A60100 call imp___stubs__objc_msgSend | |
00000000000026e9 488B35B8BE0200 mov rsi, qword [ds:objc_sel_pathForResource_ofType_] ; @selector(pathForResource:ofType:) | |
00000000000026f0 488D15B9D70200 lea rdx, qword [ds:cfstring_Defaults] ; @"Defaults" | |
00000000000026f7 488D0D92D70200 lea rcx, qword [ds:cfstring_plist] ; @"plist" | |
00000000000026fe 4889C7 mov rdi, rax | |
0000000000002701 30C0 xor al, al | |
0000000000002703 E8A8A60100 call imp___stubs__objc_msgSend | |
0000000000002708 488B3591BE0200 mov rsi, qword [ds:objc_sel_dictionaryWithContentsOfFile_] ; @selector(dictionaryWithContentsOfFile:) | |
000000000000270f 4C89E7 mov rdi, r12 | |
0000000000002712 4889C2 mov rdx, rax | |
0000000000002715 30C0 xor al, al | |
0000000000002717 E894A60100 call imp___stubs__objc_msgSend | |
000000000000271c 4989C4 mov r12, rax | |
000000000000271f 488B3572BE0200 mov rsi, qword [ds:objc_sel_standardUserDefaults] ; @selector(standardUserDefaults) | |
0000000000002726 488B3DCBCD0200 mov rdi, qword [ds:bind__OBJC_CLASS_$_NSUserDefaults] | |
000000000000272d 30C0 xor al, al | |
000000000000272f E87CA60100 call imp___stubs__objc_msgSend | |
0000000000002734 488B3555BE0200 mov rsi, qword [ds:objc_sel_registerDefaults_] ; @selector(registerDefaults:) | |
000000000000273b 4889C7 mov rdi, rax | |
000000000000273e 4C89E2 mov rdx, r12 | |
0000000000002741 E86AA60100 call imp___stubs__objc_msgSend | |
0000000000002746 488B354BBE0200 mov rsi, qword [ds:objc_sel_standardUserDefaults] ; @selector(standardUserDefaults) | |
000000000000274d 488B3DA4CD0200 mov rdi, qword [ds:bind__OBJC_CLASS_$_NSUserDefaults] | |
0000000000002754 30C0 xor al, al | |
0000000000002756 E855A60100 call imp___stubs__objc_msgSend | |
000000000000275b 488B3526BE0200 mov rsi, qword [ds:objc_sel_synchronize] ; @selector(synchronize) | |
0000000000002762 4889C7 mov rdi, rax | |
0000000000002765 E846A60100 call imp___stubs__objc_msgSend | |
000000000000276a 488B350FBE0200 mov rsi, qword [ds:objc_sel_drain] ; @selector(drain) | |
0000000000002771 4C89FF mov rdi, r15 | |
0000000000002774 E837A60100 call imp___stubs__objc_msgSend | |
0000000000002779 89DF mov edi, ebx | |
000000000000277b 4C89F6 mov rsi, r14 | |
000000000000277e 5B pop rbx | |
000000000000277f 415C pop r12 | |
0000000000002781 415E pop r14 | |
0000000000002783 415F pop r15 | |
0000000000002785 5D pop rbp | |
0000000000002786 E943A30100 jmp imp___stubs__NSApplicationMain | |
; Basic Block Input Regs: rsi - Killed Regs: r14 | |
000000000000278b 4989F6 mov r14, rsi ; XREF=0x265c | |
000000000000278e E9E7FEFFFF jmp 0x267A | |
; endp | |
0000000000002793 90 nop | |
0000000000002794 90 nop |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment