Function at 0x409130
Capabilities:
Set current directory

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x2ac
mov eax, dword [0x4d4f10]
xor eax, esp
mov dword [esp + 0x2a8], eax
push ebx
mov ebx, dword [ebp + 8]
push esi
push edi
call fcn.004032f0
call fcn.004032f0
xor edi, edi
cmp dword [eax + 8], edi
jne 0x40916c
push eax
mov esi, eax
mov dword [eax + 0x14], edi
call fcn.00409990
push edi
call dword [sym.imp.ole32.dll_CoInitialize]
test eax, eax
jl 0x4094ec
push edi
call dword [sym.imp.ole32.dll_OleInitialize]
cmp eax, edi
jl 0x4094ec
push edi
lea eax, [esp + 0x18]
push eax
push 0x4d9490
mov dword [esp + 0x20], 1
mov dword [esp + 0x24], edi
mov dword [esp + 0x28], edi
mov dword [esp + 0x2c], edi
call sub.gdiplus.dll_GdiplusStartup
push ebx
call fcn.004466ab
add esp, 4
push 0x1fe
lea edx, [esp + 0xb6]
xor ecx, ecx
push edi
push edx
mov word [esp + 0xbc], cx
call fcn.0047ecc0
add esp, 0xc
push 0x100
lea eax, [esp + 0xb4]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
xor ecx, ecx
lea eax, [esp + 0xb0]
mov dword [esp + 0xac], 7
mov dword [esp + 0xa8], edi
mov word [esp + 0x98], cx
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, di
jne 0x409211
sub eax, edx
sar eax, 1
push eax
lea eax, [esp + 0xb4]
lea esi, [esp + 0x98]
call fcn.00407520
lea edi, [esp + 0x10]
mov ebx, esi
mov dword [esp + 0x10], 0x5c
call fcn.00409540
mov edx, esi
push edx
mov edx, eax
lea esi, [esp + 0x28]
call fcn.00409510
push 0xffffffffffffffff
xor ebx, ebx
push ebx
lea ecx, [esp + 0x9c]
call fcn.004078a0
mov esi, 8
cmp dword [esp + 0x3c], esi
jb 0x40927e
mov eax, dword [esp + 0x28]
push eax
call fcn.0047afc0
add esp, 4
mov eax, dword [esp + 0x98]
cmp dword [esp + 0xac], esi
jae 0x409295
lea eax, [esp + 0x98]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
call fcn.00403390
call fcn.00403390
mov edi, eax
call fcn.00407dd0
mov edi, 7
xor ecx, ecx
lea eax, [esp + 0xb0]
mov dword [esp + 0x74], 0xf
mov dword [esp + 0x70], ebx
mov byte [esp + 0x60], bl
mov dword [esp + 0x90], edi
mov dword [esp + 0x8c], ebx
mov word [esp + 0x7c], cx
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x4092e1
sub eax, edx
sar eax, 1
push eax
lea eax, [esp + 0xb4]
lea esi, [esp + 0x7c]
call fcn.00407520
lea edx, [esp + 0x5c]
push edx
sub esp, 0x1c
mov ecx, esp
mov dword [esp + 0x30], esp
xor eax, eax
mov dword [ecx + 0x18], edi
mov dword [ecx + 0x14], ebx
push 0xffffffffffffffff
mov word [ecx + 4], ax
push ebx
mov eax, esi
call fcn.004078a0
call fcn.00409880
mov esi, dword [esp + 0x80]
add esp, 0x20
cmp dword [esp + 0x74], 0x10
jae 0x40933f
lea esi, [esp + 0x60]
call fcn.00403390
push eax
mov ecx, esi
call fcn.00407f20
xor ecx, ecx
mov dword [esp + 0x58], edi
mov dword [esp + 0x54], ebx
mov word [esp + 0x44], cx
call fcn.00403390
lea edx, [esp + 0x40]
push edx
sub esp, 0x1c
mov ecx, esp
mov dword [esp + 0x30], esp
push 0xffffffffffffffff
add eax, 0x20
push ebx
mov dword [ecx + 0x18], 0xf
mov dword [ecx + 0x14], ebx
push eax
mov byte [ecx + 4], bl
call fcn.00401990
call fcn.00409770
lea eax, [esp + 0x60]
push eax
lea edi, [esp + 0x48]
call fcn.004095f0
add esp, 0x24
push 0xffffffffffffffff
push ebx
lea ecx, [esp + 0x48]
call fcn.004078a0
mov edi, 8
cmp dword [esp + 0x3c], edi
jb 0x4093c1
mov ecx, dword [esp + 0x28]
push ecx
call fcn.0047afc0
add esp, 4
cmp dword [esp + 0x58], edi
jb 0x4093d1
mov edx, dword [esp + 0x44]
mov dword [esp + 0x10], edx
jmp 0x4093d9
lea eax, [esp + 0x44]
mov dword [esp + 0x10], eax
push 0x590
call fcn.0047b1f3
add esp, 4
cmp eax, ebx
je 0x40945d
push eax
call fcn.00402260
mov esi, eax
cmp esi, ebx
je 0x40945d
mov ecx, dword [esp + 0x10]
push 0x100
push 0x80020000
push ecx
push ebx
mov ecx, esi
call fcn.0044b223
call fcn.00403390
mov dl, byte [eax]
mov ecx, esi
mov byte [esi + 0x4ec], dl
call fcn.0044ada5
push 5
mov ecx, esi
call fcn.00450d44
push eax
call dword [sym.imp.USER32.dll_ShowWindow]
call fcn.00449e71
call fcn.00446b5d
mov eax, dword [0x4d9490]
push eax
call sub.gdiplus.dll_GdiplusShutdown
call dword [sym.imp.ole32.dll_OleUninitialize]
call dword [sym.imp.ole32.dll_CoUninitialize]
mov edx, dword [esi]
mov eax, dword [edx + 0x14]
push 1
mov ecx, esi
call eax
cmp dword [esp + 0x58], edi
jb 0x409470
mov ecx, dword [esp + 0x44]
push ecx
call fcn.0047afc0
add esp, 4
xor edx, edx
mov esi, 7
mov word [esp + 0x44], dx
mov dword [esp + 0x54], ebx
mov dword [esp + 0x58], esi
cmp dword [esp + 0x90], edi
jb 0x40949a
mov eax, dword [esp + 0x7c]
push eax
call fcn.0047afc0
add esp, 4
xor ecx, ecx
cmp dword [esp + 0x74], 0x10
mov word [esp + 0x7c], cx
mov dword [esp + 0x8c], ebx
mov dword [esp + 0x90], esi
jb 0x4094c3
mov edx, dword [esp + 0x60]
push edx
call fcn.0047afc0
add esp, 4
mov byte [esp + 0x60], bl
mov dword [esp + 0x70], ebx
mov dword [esp + 0x74], 0xf
cmp dword [esp + 0xac], edi
jb 0x4094ec
mov eax, dword [esp + 0x98]
push eax
call fcn.0047afc0
add esp, 4
mov ecx, dword [esp + 0x2b4]
pop edi
pop esi
pop ebx
xor ecx, esp
xor eax, eax
call fcn.0047afcb
mov esp, ebp
pop ebp
ret 0x10