Function at 0x40e818
Capabilities:
Get common file path
Query environment variable
Set current directory
Set environment variable
Terminate process

Disassembly:
mov eax, 0x412daa
call fcn.004114d0
mov eax, 0x20434
call fcn.00411500
mov eax, dword [0x4211a4]
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
xor ebx, ebx
push ebx
push ebx
push 1
xor eax, ebp
mov esi, ecx
push esi
mov dword [ebp - 0x10], eax
mov eax, str.__thiscall_CXmpLoadLibrary::CXmpLoadLibrary_wchar_t__
push eax
push 0x419318
push eax
lea ecx, [ebp - 0x20440]
mov dword [esi], ebx
call fcn.00406666
mov dword [ebp - 4], ebx
lea eax, [ebp - 0x20424]
push eax
mov word [esi + 4], bx
call fcn.0040d609
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x20424]
mov dword [esp], 0x41568c
call fcn.0040ab34
push edi
lea ecx, [ebp - 0x20424]
call fcn.0040ab34
xor eax, eax
mov word [ebp - 0x218], bx
mov ecx, 0x81
lea edi, [ebp - 0x216]
rep stosd dword es:[edi], eax
push 0x104
push dword [ebp - 0x20424]
stosw word es:[edi], ax
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.MSVCR71.dll_wcsncpy]
add esp, 0xc
push 0x41930c
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAppendW]
mov edx, 0x3fff
xor eax, eax
mov word [ebp - 0x10420], bx
mov ecx, edx
lea edi, [ebp - 0x1041e]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
xor eax, eax
mov word [ebp - 0x20420], bx
mov ecx, edx
lea edi, [ebp - 0x2041e]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
mov edi, 0x8000
push edi
lea eax, [ebp - 0x10420]
push eax
push str.Path
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.SHLWAPI.dll_PathRemoveBackslashW]
lea eax, [ebp - 0x10420]
push eax
lea eax, [ebp - 0x218]
push eax
push str._s__s
lea eax, [ebp - 0x20420]
push edi
push eax
call dword [sym.imp.MSVCR71.dll__snwprintf]
mov edi, 0x4192b0
push edi
call fcn.004023cd
add esp, 0x18
test eax, eax
jne 0x40e9a5
push 1
lea eax, [ebp - 0x20420]
push eax
push str.___GetEnvironmentVariable_:
lea eax, [ebp - 0x218]
push eax
push str._AddEnvironmentVariable_:
push esi
push edi
call fcn.00405b88
pop ecx
pop ecx
mov ecx, eax
call fcn.0040bd19
mov ecx, eax
call fcn.0040a80a
mov ecx, eax
call fcn.0040bd19
mov ecx, eax
call fcn.0040a80a
mov ecx, eax
call fcn.0040bce8
lea eax, [ebp - 0x20420]
push eax
push str.Path
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
lea eax, [esi + 4]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
push ebx
push ebx
lea eax, [ebp - 0x218]
push eax
mov ecx, esi
call fcn.0040a0b0
test eax, eax
jne 0x40ea64
mov ecx, esi
call fcn.0040e4b9
test eax, eax
je 0x40ea43
xor eax, eax
mov word [ebp - 0x420], bx
mov ecx, 0x81
lea edi, [ebp - 0x41e]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea eax, [ebp - 0x20428]
push eax
lea eax, [ebp - 0x420]
push eax
lea eax, [ebp - 0x218]
push eax
mov ecx, esi
mov dword [ebp - 0x20428], 0x104
call fcn.0040a0b0
test eax, eax
jne 0x40ea64
push ebx
push 0x415d2c
lea eax, [ebp - 0x420]
push eax
jmp 0x40ea4e
push ebx
push 0x415d2c
push 0x419248
push ebx
call dword [sym.imp.USER32.dll_MessageBoxW]
push 0xfffffffffffffff6
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_TerminateProcess]
push dword [ebp - 0x20424]
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov dword [esi], eax
mov byte [ebp - 4], bl
push dword [ebp - 0x20424]
call dword [sym.imp.OLEAUT32.dll_SysStringLen]
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x20440]
call fcn.004068e0
mov ecx, dword [ebp - 0xc]
pop edi
mov dword fs:[0], ecx
mov ecx, dword [ebp - 0x10]
mov eax, esi
pop esi
xor ecx, ebp
pop ebx
call fcn.004113e5
leave
ret 4