Function at 0x401780
Capabilities:
Get common file path
Query environment variable
Set current directory
Set environment variable

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x402a78
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
push ecx
mov eax, 0x206e4
call fcn.004025c0
mov eax, dword [0x404038]
push ebx
xor ebx, ebx
push esi
mov esi, ecx
push edi
mov dword [esp + 0x206ec], eax
xor eax, eax
mov byte [esp + 0xb8], bl
mov ecx, 0x40
lea edi, [esp + 0xb9]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
lea eax, [esp + 0xb8]
push eax
push str.xlue
push str.GetPathWithoutFix
mov dword [esi], ebx
mov dword [esi + 4], ebx
mov dword [esi + 8], ebx
mov dword [esi + 0xc], ebx
mov dword [esi + 0x10], ebx
mov dword [esi + 0x21c], ebx
mov word [esi + 0x14], bx
call fcn.00401430
add esp, 0xc
lea ecx, [esp + 0x10]
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::constructor_void_]
lea ecx, [esp + 0x10]
push ecx
sub esp, 0x1c
lea edx, [esp + 0xd8]
mov ecx, esp
mov dword [esp + 0x2c], esp
push edx
mov dword [esp + 0x20720], ebx
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_char_const__]
mov ecx, esi
call fcn.00401180
xor eax, eax
mov word [esp + 0x6e8], bx
mov ecx, 0x3fff
lea edi, [esp + 0x6ea]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
xor eax, eax
mov word [esp + 0x106e8], bx
mov ecx, 0x3fff
lea edi, [esp + 0x106ea]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
push 0x8000
lea eax, [esp + 0x6ec]
push eax
push str.Path
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
lea ecx, [esp + 0x6e8]
push ecx
lea ecx, [esp + 0x14]
call dword [sym.imp.MSVCP71.dll_public:_wchar_t_const____thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::c_str_void_const]
push eax
push str._s__s
lea edx, [esp + 0x106f4]
push 0x8000
push edx
call dword [sym.imp.MSVCR71.dll__snwprintf]
add esp, 0x14
lea eax, [esp + 0x106e8]
push eax
push str.Path
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
lea eax, [esi + 0x14]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
lea ecx, [esp + 0x10]
call dword [sym.imp.MSVCP71.dll_public:_wchar_t_const____thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::c_str_void_const]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
mov byte [esp + 0x2c8], bl
xor eax, eax
mov ecx, 0x40
lea edi, [esp + 0x2c9]
rep stosd dword es:[edi], eax
push str.xlfsio.dll
lea ecx, [esp + 0xbc]
stosw word es:[edi], ax
push ecx
lea edx, [esp + 0x2d0]
push edx
stosb byte es:[edi], al
call dword [sym.imp.SHLWAPI.dll_PathCombineA]
lea ecx, [esp + 0x2c]
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::constructor_void_]
lea eax, [esp + 0x2c]
push eax
sub esp, 0x1c
lea edx, [esp + 0x2e8]
mov ecx, esp
mov dword [esp + 0x2c], esp
push edx
mov byte [esp + 0x20720], 1
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_char_const__]
mov ecx, esi
call fcn.00401180
lea ecx, [esp + 0x2c]
call dword [sym.imp.MSVCP71.dll_public:_wchar_t_const____thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::c_str_void_const]
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
cmp eax, ebx
mov dword [esi], eax
je 0x401be8
xor eax, eax
mov byte [esp + 0x5e0], bl
mov ecx, 0x40
lea edi, [esp + 0x5e1]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
push str.XLLuaRuntime.dll
lea eax, [esp + 0xbc]
push eax
lea ecx, [esp + 0x5e8]
push ecx
call dword [sym.imp.SHLWAPI.dll_PathCombineA]
lea ecx, [esp + 0x48]
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::constructor_void_]
lea edx, [esp + 0x48]
push edx
sub esp, 0x1c
lea eax, [esp + 0x600]
mov ecx, esp
mov dword [esp + 0x2c], esp
push eax
mov byte [esp + 0x20720], 2
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_char_const__]
mov ecx, esi
call fcn.00401180
lea ecx, [esp + 0x48]
call dword [sym.imp.MSVCP71.dll_public:_wchar_t_const____thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::c_str_void_const]
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
cmp eax, ebx
mov dword [esi + 4], eax
je 0x401bd6
mov byte [esp + 0x4d8], bl
xor eax, eax
mov ecx, 0x40
lea edi, [esp + 0x4d9]
rep stosd dword es:[edi], eax
push str.XLGraphic.dll
lea ecx, [esp + 0xbc]
stosw word es:[edi], ax
push ecx
lea edx, [esp + 0x4e0]
push edx
stosb byte es:[edi], al
call dword [sym.imp.SHLWAPI.dll_PathCombineA]
lea ecx, [esp + 0x64]
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::constructor_void_]
lea eax, [esp + 0x64]
push eax
sub esp, 0x1c
lea edx, [esp + 0x4f8]
mov ecx, esp
mov dword [esp + 0x2c], esp
push edx
mov byte [esp + 0x20720], 3
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_char_const__]
mov ecx, esi
call fcn.00401180
lea ecx, [esp + 0x64]
call dword [sym.imp.MSVCP71.dll_public:_wchar_t_const____thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::c_str_void_const]
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
cmp eax, ebx
mov dword [esi + 8], eax
je 0x401bc4
xor eax, eax
mov byte [esp + 0x1c0], bl
mov ecx, 0x40
lea edi, [esp + 0x1c1]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
push str.XLUE.dll
lea eax, [esp + 0xbc]
push eax
lea ecx, [esp + 0x1c8]
push ecx
call dword [sym.imp.SHLWAPI.dll_PathCombineA]
lea ecx, [esp + 0x80]
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::constructor_void_]
lea edx, [esp + 0x80]
push edx
sub esp, 0x1c
lea eax, [esp + 0x1e0]
mov ecx, esp
mov dword [esp + 0x2c], esp
push eax
mov byte [esp + 0x20720], 4
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_char_const__]
mov ecx, esi
call fcn.00401180
lea ecx, [esp + 0x80]
call dword [sym.imp.MSVCP71.dll_public:_wchar_t_const____thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::c_str_void_const]
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
cmp eax, ebx
mov dword [esi + 0xc], eax
je 0x401baf
mov byte [esp + 0x3d0], bl
xor eax, eax
mov ecx, 0x40
lea edi, [esp + 0x3d1]
rep stosd dword es:[edi], eax
lea ecx, [esp + 0x3d0]
push ecx
stosw word es:[edi], ax
push str.XmpTipWnd.dll
push str.GetPathWithoutFix
stosb byte es:[edi], al
call fcn.00401430
add esp, 0xc
lea ecx, [esp + 0x9c]
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::constructor_void_]
lea edx, [esp + 0x9c]
push edx
sub esp, 0x1c
lea eax, [esp + 0x3f0]
mov ecx, esp
mov dword [esp + 0x2c], esp
push eax
mov byte [esp + 0x20720], 5
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_char_const__]
mov ecx, esi
call fcn.00401180
lea ecx, [esp + 0x9c]
call dword [sym.imp.MSVCP71.dll_public:_wchar_t_const____thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::c_str_void_const]
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
cmp eax, ebx
mov dword [esi + 0x10], eax
lea ecx, [esp + 0x9c]
mov byte [esp + 0x206fc], 4
je 0x401ba9
mov dword [esi + 0x21c], 1
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::destructor_void_]
lea ecx, [esp + 0x80]
mov byte [esp + 0x206fc], 3
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::destructor_void_]
lea ecx, [esp + 0x64]
mov byte [esp + 0x206fc], 2
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::destructor_void_]
lea ecx, [esp + 0x48]
mov byte [esp + 0x206fc], 1
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::destructor_void_]
lea ecx, [esp + 0x2c]
mov byte [esp + 0x206fc], bl
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::destructor_void_]
lea ecx, [esp + 0x10]
mov dword [esp + 0x206fc], 0xffffffff
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::destructor_void_]
mov ecx, dword [esp + 0x206f4]
mov dword fs:[0], ecx
mov ecx, dword [esp + 0x206ec]
mov eax, esi
call fcn.00402555
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret