Function at 0x4046cb
Capabilities:
Get common file path
Set current directory

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x3a8
mov eax, dword [0x40e044]
push ebx
push esi
push edi
mov dword [ebp - 4], eax
push 0x40
xor eax, eax
pop ecx
xor ebx, ebx
mov byte [ebp - 0x20c], bl
lea edi, [ebp - 0x20b]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
push 0x40
xor eax, eax
pop ecx
mov byte [ebp - 0x310], bl
lea edi, [ebp - 0x30f]
rep stosd dword es:[edi], eax
mov esi, dword [ebp + 8]
stosw word es:[edi], ax
stosb byte es:[edi], al
push 0x40
pop ecx
xor eax, eax
mov byte [ebp - 0x108], bl
lea edi, [ebp - 0x107]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
lea eax, [ebp - 0x310]
push eax
mov edi, 0x104
push edi
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
test eax, eax
jne 0x404750
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x401660
jmp 0x4048de
push edi
lea eax, [ebp - 0x108]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
test eax, eax
jne 0x404773
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x401620
jmp 0x4048de
lea eax, [ebp - 0x108]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
test eax, eax
jne 0x404795
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x4015d8
jmp 0x4048de
lea eax, [ebp - 0x3a4]
push eax
mov dword [esi], ebx
mov dword [esi + 4], ebx
mov dword [ebp - 0x3a4], 0x94
call dword [sym.imp.KERNEL32.dll_GetVersionExA]
test eax, eax
jne 0x4047c3
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x401598
jmp 0x404830
cmp dword [ebp - 0x394], 2
jne 0x40489b
cmp dword [ebp - 0x3a0], 4
jb 0x4048c1
jne 0x404893
push 0x40158c
lea eax, [ebp - 0x108]
push eax
lea eax, [ebp - 0x20c]
push eax
mov dword [esi], 0x40002
call fcn.004064aa
test eax, eax
jne 0x404811
push 0x401560
call fcn.0040674d
jmp 0x404836
lea eax, [ebp - 0x20c]
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov edi, eax
cmp edi, ebx
jne 0x40483c
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x401524
call fcn.0040674d
pop ecx
pop ecx
jmp 0x4048c1
push 0x401510
push edi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
cmp eax, ebx
mov dword [ebp - 0x3a8], eax
jne 0x404865
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x4014c0
call fcn.0040674d
pop ecx
pop ecx
push edi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
test eax, eax
jne 0x404883
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x401484
call fcn.0040674d
pop ecx
pop ecx
cmp dword [ebp - 0x3a8], ebx
je 0x4048c1
mov dword [esi], 0x40003
jmp 0x4048c1
mov dword [esi], 0x40006
jmp 0x4048be
mov eax, dword [ebp - 0x398]
and eax, 0xffff
cmp eax, 0x549
jbe 0x4048bc
mov dword [esi], 0x40005
mov dword [esi + 4], 0x10000
jmp 0x4048c1
mov dword [esi], ebx
mov dword [esi + 4], ebx
lea eax, [ebp - 0x310]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
test eax, eax
jne 0x4048e9
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x401438
call fcn.0040674d
pop ecx
pop ecx
xor eax, eax
jmp 0x4048ec
xor eax, eax
inc eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
pop ebx
call fcn.00406819
leave
ret 4