Function at 0x402d45
Capabilities:
Set current directory

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x13c
mov eax, dword [0x40501c]
push ebx
push esi
push edi
xor edi, edi
push edi
push 1
push 0x80000002
push 0x401678
lea ecx, [ebp - 0x13c]
mov dword [ebp - 4], eax
call fcn.00403e41
cmp dword [0x405058], 2
mov dword [ebp - 0x118], edi
mov dword [ebp - 0x114], edi
je 0x402dd0
lea eax, [ebp - 0x118]
push eax
push 0x401814
lea ecx, [ebp - 0x13c]
call fcn.00404117
cmp eax, edi
jne 0x402daf
mov ebx, 0x80070005
jmp 0x402fa7
push eax
push dword [ebp - 0x118]
call dword [sym.imp.OLEAUT32.dll_DllRegisterServer]
cmp eax, edi
mov dword [ebp - 0x114], eax
jne 0x402dd0
mov ebx, 0x8007000e
jmp 0x402fa7
push 0x401808
call dword [sym.imp.KERNEL32.dll_AddAtomA]
lea eax, [ebp - 0x108]
push eax
call fcn.004042d5
test eax, eax
je 0x402df8
lea eax, [ebp - 0x108]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
lea eax, [ebp - 0x11c]
push eax
push 0x4018ac
push edi
push 3
push 0x4014fc
call dword [sym.imp.ole32.dll_CoGetClassObject]
mov ebx, eax
cmp ebx, edi
jl 0x402ed7
mov eax, dword [ebp - 0x11c]
mov ecx, dword [eax]
push 0x405158
push 0x4013ec
push edi
push eax
call dword [ecx + 0xc]
mov ebx, eax
cmp ebx, edi
jl 0x402ecb
push 0x20
call fcn.00403c8a
cmp eax, edi
pop ecx
je 0x402e52
mov ecx, eax
call fcn.00402cac
jmp 0x402e54
xor eax, eax
cmp eax, edi
mov dword [0x40515c], eax
je 0x402e8e
push dword [0x405158]
push eax
call fcn.004026a1
mov ebx, eax
cmp ebx, edi
jl 0x402e8e
mov eax, dword [0x405158]
lea edx, [ebp - 0x120]
push edx
push edi
mov dword [ebp - 0x120], 0x21
mov ecx, dword [eax]
push eax
call dword [ecx + 0xc]
mov ebx, eax
mov eax, dword [0x405158]
lea edx, [ebp - 0x110]
push edx
mov dword [ebp - 0x110], edi
mov ecx, dword [eax]
push eax
call dword [ecx + 0x10]
test eax, eax
jl 0x402ecb
mov eax, dword [ebp - 0x110]
mov ecx, dword [eax]
push 0x405168
push 0x4013fc
push eax
call dword [ecx]
mov eax, dword [ebp - 0x110]
mov ecx, dword [eax]
push eax
call dword [ecx + 8]
mov eax, dword [ebp - 0x11c]
mov ecx, dword [eax]
push eax
call dword [ecx + 8]
cmp dword [0x405158], edi
je 0x402fa7
call fcn.0040296e
mov ecx, dword [0x40515c]
mov eax, dword [0x405158]
mov edx, dword [eax]
mov esi, ecx
add ecx, 0xc
push 0x40516c
neg esi
sbb esi, esi
push 3
and esi, ecx
push esi
push eax
call dword [edx + 0x2c]
cmp eax, edi
jge 0x402f17
mov ebx, eax
jmp 0x402fa7
mov eax, dword [0x40516c]
mov ecx, dword [eax]
push eax
call dword [ecx + 0xc]
test eax, eax
jne 0x402f2d
mov ebx, 0x80004005
jmp 0x402fa7
push 0x40
mov esi, 0x405118
push esi
push 0x65
push edi
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
push eax
call dword [sym.imp.USER32.dll_LoadStringA]
push esi
lea ecx, [ebp - 0x10c]
call fcn.00402559
mov eax, dword [0x405158]
mov ecx, dword [eax]
push 2
push 0x10
push 0x10051
push dword [ebp - 0x114]
push dword [ebp - 0x10c]
push 0x405160
push eax
call dword [ecx + 0x38]
push dword [ebp - 0x114]
mov esi, dword [sym.imp.OLEAUT32.dll_SysStringLen]
mov ebx, eax
call esi
cmp ebx, edi
jl 0x402f97
mov eax, dword [0x405160]
mov ecx, dword [eax]
push eax
call dword [ecx + 0x38]
mov ebx, eax
cmp dword [ebp - 0x10c], edi
je 0x402fa7
push dword [ebp - 0x10c]
call esi
lea ecx, [ebp - 0x13c]
call fcn.00404059
mov ecx, dword [ebp - 4]
pop edi
pop esi
mov eax, ebx
pop ebx
call fcn.004039e7
leave
ret