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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x110
mov eax, dword [0x581900]
xor eax, ebp
mov dword [ebp - 4], eax
push esi
push 0x104
lea eax, [ebp - 0x108]
push 0
push eax
call fcn.004e69c0
mov esi, dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
lea eax, [ebp - 0x110]
add esp, 0xc
mov dword [ebp - 0x10c], 0
mov dword [ebp - 0x110], 0
push eax
lea eax, [ebp - 0x10c]
push eax
call esi
push eax
call dword [sym.imp.KERNEL32.dll_GetProcessAffinityMask]
test eax, eax
jne 0x40e5a3
push str._GetLastError_
push str.:2:GetProcessAffinityMask___FAILED:__s
mov dword [ebp - 0x10c], 1
call fcn.00424a90
mov eax, dword [ebp - 0x10c]
add esp, 8
jmp 0x40e5d5
test byte [ebp - 0x110], 8
je 0x40e5b3
mov eax, 8
jmp 0x40e5cf
mov eax, dword [ebp - 0x10c]
test al, 4
je 0x40e5c4
mov eax, 4
jmp 0x40e5cf
test al, 2
mov eax, 0
setne al
inc eax
mov dword [ebp - 0x10c], eax
push eax
call esi
push eax
call dword [sym.imp.KERNEL32.dll_SetProcessAffinityMask]
test eax, eax
jne 0x40e606
mov eax, dword [ebp - 0x10c]
test eax, eax
je 0x40e606
push str._GetLastError_
push dword [ebp - 0x110]
push eax
push str.:2:SetProcessAffinityMask___FAILED:__u___u:__s
call fcn.00424a90
add esp, 0x10
mov esi, 1
mov dword [0x57400c], 0xffffffff
mov dword [0x574010], 0xffffffff
mov dword [0x587bec], 0
call dword [sym.imp.KERNEL32.dll_AllocConsole]
test eax, eax
jne 0x40e647
push str._GetLastError_
push str.:7:InitConsole___FAILED:_AllocConsole___FAILED:__s
xor esi, esi
call fcn.00424a90
add esp, 8
push 7
push 0xfffffffffffffff6
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
push eax
call dword [sym.imp.KERNEL32.dll_SetConsoleMode]
test eax, eax
jne 0x40e670
push str._GetLastError_
push str.:7:InitConsole___FAILED:_SetConsoleMode_STD_INPUT_HANDLE__FAILED:__s
xor esi, esi
call fcn.00424a90
add esp, 8
push 3
push 0xfffffffffffffff5
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
push eax
call dword [sym.imp.KERNEL32.dll_SetConsoleMode]
test eax, eax
jne 0x40e699
push str._GetLastError_
push str.:7:InitConsole___FAILED:_SetConsoleMode_STD_OUTPUT_HANDLE__FAILED:__s
xor esi, esi
call fcn.00424a90
add esp, 8
push 1
push 0x40d6f0
call dword [sym.imp.KERNEL32.dll_SetConsoleCtrlHandler]
test eax, eax
jne 0x40e6be
push str._GetLastError_
push str.:7:InitConsole___FAILED:_SetConsoleCtrlHandler___FAILED:__s
xor esi, esi
call fcn.00424a90
add esp, 8
push 0x35c
call dword [sym.imp.KERNEL32.dll_SetConsoleOutputCP]
test eax, eax
jne 0x40e6e1
push 0x35c
push str.:9:InitConsole___FAILED:_SetConsoleOutputCP___FAILED:_could_not_set_code_page__d___
xor esi, esi
call fcn.00424a90
add esp, 8
call dword [sym.imp.KERNEL32.dll_GetConsoleWindow]
mov dword [0x585798], eax
test eax, eax
jne 0x40e704
push str._GetLastError_
push str.:7:InitConsole___FAILED:_GetConsoleWindow___FAILED:__s
xor esi, esi
call fcn.00424a90
add esp, 8
lea eax, [ebp - 0x108]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
test eax, eax
je 0x40e74f
lea eax, [ebp - 0x108]
push eax
call fcn.004a87a0
lea eax, [ebp - 0x108]
push 0x50b2a4
push eax
call fcn.004a95f0
add esp, 0xc
test eax, eax
jne 0x40e74f
push eax
push eax
call fcn.0047d960
add esp, 8
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
push str.Sounds_
push 0
call fcn.0047d960
push eax
call fcn.0049fc20
mov eax, dword [ebp + 8]
add esp, 0xc
test eax, eax
je 0x40e770
mov dword [0x585794], eax
call fcn.004d9850
call dword [sym.imp.KERNEL32.dll_GetTickCount]
push eax
call fcn.004eeadb
add esp, 4
call fcn.004eeaba
call fcn.004eeaba
call fcn.004eeaba
mov ecx, dword [ebp - 4]
mov eax, esi
xor ecx, ebp
pop esi
call fcn.004e50dc
mov esp, ebp
pop ebp
ret