Function at 0x40c720
Capabilities:
Get common file path
Resolve function by parsing pe exports
Set current directory

Disassembly:
jmp 0x40c720
push 0xffffffffffffffff
push 0x49b692
mov eax, dword fs:[0]
push eax
sub esp, 0x26c
mov eax, dword [0x4caff4]
xor eax, esp
mov dword [esp + 0x268], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x4caff4]
xor eax, esp
push eax
lea eax, [esp + 0x280]
mov dword fs:[0], eax
mov eax, dword [esp + 0x294]
mov esi, dword [esp + 0x290]
xor ebx, ebx
mov edi, ecx
mov dword [esp + 0x5c], eax
mov dword [esp + 0x34], ebx
mov dword [esp + 0x38], ebx
mov dword [esp + 0x3c], ebx
mov dword [esp + 0x288], ebx
mov dword [esp + 0x24], ebx
mov dword [esp + 0x28], ebx
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x48], ebx
mov dword [esp + 0x4c], ebx
mov dword [esp + 0x50], ebx
mov byte [esp + 0x288], 2
call fcn.004281c4
xor ecx, ecx
cmp eax, ebx
setne cl
cmp ecx, ebx
jne 0x40c7be
push 0x80004005
call fcn.004017c6
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [esp + 0x58], eax
lea ecx, [esp + 0x178]
push ecx
push 0x104
mov byte [esp + 0x290], 3
mov dword [esp + 0x24], 0xffffffff
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
push esi
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
cmp eax, 0xffffffff
jne 0x40c814
push 0x4be528
lea edx, [esp + 0x20]
push edx
mov dword [esp + 0x24], 8
call fcn.004517ae
lea ecx, [esp + 0x60]
call fcn.004291c7
mov byte [esp + 0x288], 4
call fcn.004281c4
xor ecx, ecx
cmp eax, ebx
setne cl
cmp ecx, ebx
jne 0x40c83f
push 0x80004005
call fcn.004017c6
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [esp + 0x18], eax
push ebx
push esi
lea ecx, [esp + 0x68]
mov byte [esp + 0x290], 5
call fcn.00429253
test eax, eax
push 1
jne 0x40c870
lea ecx, [esp + 0x34]
push ecx
push ebx
jmp 0x40c876
lea edx, [esp + 0x34]
push edx
push esi
mov ecx, edi
call fcn.00401910
mov eax, dword [esp + 0x34]
cmp eax, ebx
jne 0x40c889
xor ebp, ebp
jmp 0x40c892
mov ebp, dword [esp + 0x38]
sub ebp, eax
sar ebp, 2
lea eax, [esp + 0x20]
push eax
push esi
mov ecx, edi
call fcn.0040117c
mov ecx, dword [esp + 0x24]
cmp ecx, ebx
mov eax, dword [esp + 0x28]
jne 0x40c8b1
mov dword [esp + 0x40], ebx
jmp 0x40c8bc
mov edx, eax
sub edx, ecx
sar edx, 2
mov dword [esp + 0x40], edx
xor esi, esi
cmp ebp, ebx
mov dword [esp + 0x14], ebx
jle 0x40c9b6
jmp 0x40c8d8
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x24]
mov edx, dword [esp + 0x40]
cmp dword [esp + 0x14], edx
jge 0x40c91a
cmp ecx, ebx
je 0x40c8f1
sub eax, ecx
sar eax, 2
cmp dword [esp + 0x14], eax
jb 0x40c8fa
call fcn.0045195a
mov ecx, dword [esp + 0x24]
mov eax, dword [esp + 0x14]
mov ecx, dword [ecx + eax*4]
lea edx, [esp + 0x78]
mov al, byte [ecx]
mov byte [edx], al
add ecx, 1
add edx, 1
cmp al, bl
jne 0x40c905
add dword [esp + 0x14], 1
jmp 0x40c951
mov ecx, dword [esp + 0x34]
cmp ecx, ebx
je 0x40c92f
mov eax, dword [esp + 0x38]
sub eax, ecx
sar eax, 2
cmp esi, eax
jb 0x40c938
call fcn.0045195a
mov ecx, dword [esp + 0x34]
mov ecx, dword [ecx + esi*4]
lea edx, [esp + 0x78]
nop
mov al, byte [ecx]
mov byte [edx], al
add ecx, 1
add edx, 1
cmp al, bl
jne 0x40c940
add esi, 1
push 0x5c
lea ecx, [esp + 0x7c]
push ecx
mov ecx, edi
call fcn.00401974
mov edx, dword [edi + 0x54]
push eax
add edx, 0x64
mov dword [esp + 0x58], eax
push edx
lea eax, [esp + 0x24]
push eax
lea ecx, [esp + 0x84]
push ecx
mov ecx, edi
call fcn.00401654
lea eax, [esp + 0x78]
lea edx, [eax + 1]
mov cl, byte [eax]
add eax, 1
cmp cl, bl
jne 0x40c986
sub eax, edx
push eax
lea edx, [esp + 0x7c]
push edx
lea ecx, [esp + 0x60]
call fcn.00401055
lea eax, [esp + 0x54]
push eax
lea ecx, [esp + 0x48]
call fcn.004011c7
cmp esi, ebp
jl 0x40c8d0
mov ecx, dword [esp + 0x1c]
mov edx, dword [esp + 0x5c]
push 4
push ecx
push edx
lea eax, [esp + 0x50]
push eax
mov ecx, edi
call fcn.00401947
lea ecx, [esp + 0x178]
push ecx
mov esi, eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
mov eax, dword [esp + 0x18]
add eax, 0xfffffff0
mov byte [esp + 0x288], 4
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40ca06
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea ecx, [esp + 0x60]
mov byte [esp + 0x288], 3
call fcn.004291eb
mov eax, dword [esp + 0x58]
add eax, 0xfffffff0
mov byte [esp + 0x288], 2
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40ca3f
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [esp + 0x48]
cmp eax, ebx
mov byte [esp + 0x288], 1
je 0x40ca71
mov ecx, dword [esp + 0x18]
push ecx
mov ecx, dword [esp + 0x50]
lea edx, [esp + 0x48]
push edx
push ecx
push eax
call fcn.0040121c
mov edx, dword [esp + 0x58]
push edx
call fcn.00410c0d
add esp, 0x14
mov eax, dword [esp + 0x24]
cmp eax, ebx
mov dword [esp + 0x48], ebx
mov dword [esp + 0x4c], ebx
mov dword [esp + 0x50], ebx
mov byte [esp + 0x288], bl
je 0x40caae
mov ecx, dword [esp + 0x18]
push ecx
mov ecx, dword [esp + 0x2c]
lea edx, [esp + 0x24]
push edx
push ecx
push eax
call fcn.004015be
mov edx, dword [esp + 0x34]
push edx
call fcn.00410c0d
add esp, 0x14
mov eax, dword [esp + 0x34]
cmp eax, ebx
mov dword [esp + 0x24], ebx
mov dword [esp + 0x28], ebx
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x288], 0xffffffff
je 0x40caef
mov ecx, dword [esp + 0x18]
push ecx
mov ecx, dword [esp + 0x3c]
lea edx, [esp + 0x34]
push edx
push ecx
push eax
call fcn.004015be
mov edx, dword [esp + 0x44]
push edx
call fcn.00410c0d
add esp, 0x14
mov eax, esi
mov ecx, dword [esp + 0x280]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x268]
xor ecx, esp
call fcn.00451541
add esp, 0x278
ret 8