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

Disassembly:
mov eax, 0x414989
call fcn.00413240
mov eax, 0x20434
call fcn.00413270
mov eax, dword [0x4241a4]
push ebx
push esi
mov esi, ecx
xor ebx, ebx
xor eax, ebp
push edi
mov edi, dword [ebp + 8]
mov dword [ebp - 0x10], eax
mov dword [ebp - 0x20428], esi
mov dword [esi], ebx
mov dword [ebp - 0x20424], ebx
mov dword [ebp - 0x20424], ebp
push ebx
push dword [ebp - 0x20424]
push str.__thiscall_CXmpLoadLibrary::CXmpLoadLibrary_wchar_t__
call fcn.00407881
mov dword [ebp - 0x20424], eax
add esp, 0xc
cmp dword [ebp - 0x20424], ebx
mov eax, 0x41bbd8
jne 0x40ff22
mov dword [ebp - 0x20424], eax
push ebx
push ebx
push ebx
push esi
push eax
push 0x41bb90
push dword [ebp - 0x20424]
lea ecx, [ebp - 0x20440]
call fcn.00409792
mov dword [ebp - 4], ebx
cmp dword [ebp - 0x20424], ebx
jne 0x40ff4a
push ebp
pop ebp
lea eax, [esi + 4]
mov word [eax], bx
lea eax, [ebp - 0x20424]
push eax
call fcn.0040fadd
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x20424]
mov dword [esp], str.Program_
call fcn.0040d8d9
push edi
lea ecx, [ebp - 0x20424]
call fcn.0040d8d9
xor eax, eax
mov word [ebp - 0x420], bx
mov ecx, 0x81
lea edi, [ebp - 0x41e]
rep stosd dword es:[edi], eax
mov esi, 0x104
push esi
push dword [ebp - 0x20424]
stosw word es:[edi], ax
lea eax, [ebp - 0x420]
push eax
call dword [sym.imp.MSVCR71.dll_wcsncpy]
add esp, 0xc
push 0x41bb74
lea eax, [ebp - 0x420]
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 - 0x420]
push eax
call dword [sym.imp.SHLWAPI.dll_PathRemoveBackslashW]
lea eax, [ebp - 0x10420]
push eax
lea eax, [ebp - 0x420]
push eax
push str._s__s
lea eax, [ebp - 0x20420]
push edi
push eax
call dword [sym.imp.MSVCR71.dll__snwprintf]
mov edi, 0x41bb18
push edi
call fcn.00403aec
add esp, 0x18
test eax, eax
jne 0x410096
push 1
lea eax, [ebp - 0x20420]
push eax
push str.___GetEnvironmentVariable_:
lea eax, [ebp - 0x420]
push eax
push str._AddEnvironmentVariable_:
push dword [ebp - 0x20428]
push edi
call fcn.00408cd1
pop ecx
pop ecx
mov ecx, eax
call fcn.0040e3a9
mov ecx, eax
call fcn.0040d585
mov ecx, eax
call fcn.0040e3a9
mov ecx, eax
call fcn.0040d585
mov ecx, eax
call fcn.0040e37d
lea eax, [ebp - 0x20420]
push eax
push str.Path
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
mov eax, dword [ebp - 0x20428]
add eax, 4
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
lea eax, [ebp - 0x420]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
xor eax, eax
mov word [ebp - 0x218], bx
mov ecx, 0x81
lea edi, [ebp - 0x216]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
push esi
lea eax, [ebp - 0x420]
push eax
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.MSVCR71.dll_wcsncpy]
add esp, 0xc
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAddBackslashW]
push str.xlfsio.dll
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAppendW]
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
test eax, eax
mov esi, dword [sym.imp.USER32.dll_MessageBoxW]
mov edi, dword [sym.imp.KERNEL32.dll_TerminateProcess]
jne 0x41014b
push ebx
push 0x418714
push 0x41ba9c
push ebx
call esi
push 0xfffffffffffffff6
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call edi
push str...XLLuaRuntime.dll
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAppendW]
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
test eax, eax
jne 0x410187
push ebx
push 0x418714
push 0x41ba44
push ebx
call esi
push 0xfffffffffffffff6
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call edi
push str...XLGraphic.dll
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAppendW]
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
test eax, eax
jne 0x4101c3
push ebx
push 0x418714
push 0x41b9f8
push ebx
call esi
push 0xfffffffffffffff6
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call edi
push str...XLUE.dll
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAppendW]
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
cmp eax, ebx
jne 0x4101ff
push ebx
push 0x418714
push 0x41b9c0
push ebx
call esi
push 0xfffffffffffffff6
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call edi
push dword [ebp - 0x20424]
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov esi, dword [ebp - 0x20428]
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.00409a0c
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
mov ecx, dword [ebp - 0x10]
pop edi
mov eax, esi
pop esi
xor ecx, ebp
pop ebx
call fcn.00413159
leave
ret 4