Function at 0x403010
Capabilities:
Set current directory

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x46c
mov eax, dword [0x436b90]
xor eax, esp
mov dword [esp + 0x468], eax
push ebx
push esi
push edi
mov dword [esp + 0x10], ecx
mov dword [esp + 0x14], 1
mov dword [ecx + 0x54], 0
call fcn.004126a2
mov ebx, dword [eax + 8]
xor ecx, ecx
mov edi, 0x104
mov eax, edi
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.0040ab0b
add esp, 4
push edi
mov esi, eax
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
cmp eax, 0x103
jb 0x4030b9
lea ebx, [ebx]
push esi
call fcn.0040ab06
add edi, 0x104
xor ecx, ecx
mov eax, edi
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.0040ab0b
add esp, 8
push edi
mov esi, eax
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea ecx, [edi - 1]
cmp ecx, eax
jbe 0x403080
call fcn.004087e0
test eax, eax
mov ebx, dword [esp + 0x10]
lea ecx, [ebx + 0x218]
jne 0x4030d0
xor edx, edx
jmp 0x4030f1
mov edx, eax
lea edi, [edx + 2]
mov dword [esp + 0x10], edi
lea esp, [esp]
mov di, word [edx]
add edx, 2
test di, di
jne 0x4030e0
sub edx, dword [esp + 0x10]
sar edx, 1
push edx
push eax
call fcn.00402290
mov edi, esi
call fcn.004086f0
test esi, esi
lea edi, [ebx + 0x210]
jne 0x40310d
xor eax, eax
jmp 0x403121
mov eax, esi
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x403112
sub eax, edx
sar eax, 1
push eax
push esi
mov ecx, edi
call fcn.00402290
push esi
call fcn.0040ab06
mov eax, dword [edi]
add esp, 4
test eax, eax
je 0x4031aa
mov ecx, 0x7fffffff
xor edx, edx
cmp word [eax], 0
je 0x403150
add eax, 2
sub ecx, 1
jne 0x403140
jmp 0x403154
test ecx, ecx
jne 0x4031a1
mov edx, 0x80070057
xor eax, eax
test edx, edx
mov ecx, edx
jge 0x403163
xor eax, eax
xor edx, edx
test ecx, ecx
setl dl
sub edx, 1
and edx, eax
add edx, 0x104
mov esi, edx
call fcn.004126a2
mov eax, dword [eax + 4]
mov eax, dword [eax + 0x48]
test eax, eax
je 0x403272
mov ecx, 0x7fffffff
xor edx, edx
cmp word [eax], 0
je 0x4031b1
add eax, 2
sub ecx, 1
jne 0x403191
jmp 0x4031b9
mov eax, 0x7fffffff
sub eax, ecx
jmp 0x40315b
mov ecx, 0x80070057
jmp 0x403161
test ecx, ecx
jne 0x403266
mov edx, 0x80070057
xor eax, eax
test edx, edx
mov ecx, edx
jge 0x4031c8
xor eax, eax
xor edx, edx
test ecx, ecx
setl dl
xor ecx, ecx
sub edx, 1
and edx, eax
add esi, edx
mov eax, esi
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.0040ab0b
add esp, 4
mov dword [ebx + 0x214], eax
mov dword [esp + 0x10], esi
call fcn.004126a2
mov ecx, dword [eax + 4]
mov ecx, dword [ecx + 0x48]
lea eax, [esp + 0x10]
push eax
mov eax, dword [ebx + 0x214]
push 0x4300a8
call fcn.00409ec0
add esp, 8
test eax, eax
je 0x40322e
mov ecx, dword [ebx + 0x214]
cmp word [ecx], 0
jne 0x403245
cmp esi, 0x7fffffff
ja 0x403245
mov eax, dword [edi]
mov ecx, dword [ebx + 0x214]
mov edx, esi
call fcn.00402b20
mov edx, dword [ebx + 0x214]
push edx
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
mov edi, dword [ebx + 0x214]
test edi, edi
lea ecx, [ebx + 0x84]
jne 0x40327c
xor eax, eax
jmp 0x403296
mov eax, 0x7fffffff
sub eax, ecx
jmp 0x4031c0
mov ecx, 0x80070057
jmp 0x4031c6
mov eax, edi
lea edx, [eax + 2]
mov dword [esp + 0x10], edx
mov dx, word [eax]
add eax, 2
test dx, dx
jne 0x403285
sub eax, dword [esp + 0x10]
sar eax, 1
push eax
push edi
call fcn.00402290
add esi, 0x104
xor ecx, ecx
mov eax, esi
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.0040ab0b
add esp, 4
cmp esi, 0x7fffffff
mov edi, eax
ja 0x4032d7
mov eax, dword [ebx + 0x214]
mov edx, esi
mov ecx, edi
call fcn.00402b20
call dword [sym.imp.KERNEL32.dll_GetUserDefaultLCID]
mov esi, 0x104
mov dword [ebx + 0x21c], eax
mov dword [esp + 0x10], esi
call fcn.004126a2
mov ecx, dword [eax + 4]
mov ecx, dword [ecx + 0x48]
lea eax, [esp + 0x10]
push eax
push 0x4300b0
lea eax, [esp + 0x270]
call fcn.00409ec0
add esp, 8
test eax, eax
je 0x40331f
cmp word [esp + 0x268], 0
jne 0x403356
mov dword [esp + 0x10], esi
call fcn.004126a2
mov ecx, dword [eax + 4]
mov ecx, dword [ecx + 0x48]
lea edx, [esp + 0x10]
push edx
push 0x4300b4
lea eax, [esp + 0x270]
call fcn.00409ec0
add esp, 8
test eax, eax
je 0x40336c
cmp word [esp + 0x268], 0
je 0x40336c
lea eax, [esp + 0x268]
push eax
call fcn.00408a90
add esp, 4
mov dword [ebx + 0x21c], eax
mov eax, 0x4300bc
mov ecx, edi
call fcn.00408830
push 2
push edi
call fcn.00409320
test eax, eax
mov dword [ebx + 0x74], eax
je 0x403396
mov ecx, dword [ebx + 0x21c]
push ecx
push ebx
call fcn.00403550
jmp 0x40339d
mov dword [ebx + 0x54], 2
call fcn.004086f0
mov eax, str..uif
mov ecx, edi
call fcn.00408830
lea edx, [esp + 0x18]
push edx
push edi
call dword [sym.imp.KERNEL32.dll_FindFirstFileW]
mov esi, eax
cmp esi, 0xffffffff
je 0x40340d
call fcn.004086f0
lea eax, [esp + 0x44]
mov ecx, edi
call fcn.00408830
push esi
call dword [sym.imp.KERNEL32.dll_FindClose]
push 1
push edi
call fcn.00409320
test eax, eax
je 0x40340d
mov esi, dword [ebx + 0x68]
lea ecx, [ebx + 0x60]
push eax
push esi
call fcn.00414812
mov dword [ebx + 0x78], esi
mov eax, dword [ebx]
mov edx, dword [eax + 0x140]
mov ecx, ebx
call edx
test eax, eax
jne 0x40341c
mov dword [ebx + 0x54], 3
jmp 0x403414
mov dword [ebx + 0x54], 1
mov dword [esp + 0x14], 0
push edi
call fcn.0040ab06
mov ecx, dword [esp + 0x478]
mov eax, dword [esp + 0x18]
add esp, 4
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.00417643
mov esp, ebp
pop ebp
ret