Function at 0x490f58
Capabilities:
Get common file path
Query environment variable

Disassembly:
push ebp
sub esp, 0x208
lea ebp, [esp - 4]
mov eax, dword [0x50f130]
xor eax, ebp
mov dword [ebp + 0x208], eax
push 0x14
mov eax, 0x4e1115
call fcn.004be95c
mov eax, dword [ebp + 0x214]
xor ebx, ebx
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x18], ebx
mov dword [ebp - 4], ebx
mov eax, dword [ebp + 0x218]
add eax, 0xfffffff0
call fcn.004012e0
add eax, 0x10
mov dword [ebp - 0x18], eax
lea esi, [ebp - 0x10]
call fcn.004016f0
push 0x206
lea eax, [ebp + 2]
push ebx
mov byte [ebp - 4], 2
push eax
mov word [ebp], bx
call fcn.004be240
add esp, 0xc
lea edi, [ebp + 0x218]
call fcn.00408100
mov edi, str._APPDATA_ALL_USER_
xor ecx, ecx
mov edx, edi
lea esi, [ebp + 0x218]
call fcn.00406170
test eax, eax
jl 0x491000
mov edx, edi
lea edi, [ebp - 0x10]
call fcn.00404a50
push 0x104
lea eax, [ebp]
push eax
push str._ALLUSERSPROFILE_
jmp 0x491062
mov edi, str._APPDATA_
xor ecx, ecx
mov edx, edi
lea esi, [ebp + 0x218]
call fcn.00406170
test eax, eax
jl 0x491032
mov edx, edi
lea edi, [ebp - 0x10]
call fcn.00404a50
push 0x104
lea eax, [ebp]
push eax
push str._APPDATA_
jmp 0x491062
mov edi, str._TEMP_
xor ecx, ecx
mov edx, edi
lea esi, [ebp + 0x218]
call fcn.00406170
test eax, eax
jl 0x49106d
mov edx, edi
lea edi, [ebp - 0x10]
call fcn.00404a50
push 0x104
lea eax, [ebp]
push eax
push str._TEMP_
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
jmp 0x49120a
mov edi, str._SYSTEM_
xor ecx, ecx
mov edx, edi
lea esi, [ebp + 0x218]
call fcn.00406170
test eax, eax
jl 0x4910a3
mov edx, edi
lea edi, [ebp - 0x10]
call fcn.00404a50
push 0x104
lea eax, [ebp]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
jmp 0x49120a
mov edi, str._WINDOWS_
xor ecx, ecx
mov edx, edi
lea esi, [ebp + 0x218]
call fcn.00406170
test eax, eax
jl 0x4910d9
mov edx, edi
lea edi, [ebp - 0x10]
call fcn.00404a50
push 0x104
lea eax, [ebp]
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
jmp 0x49120a
mov edi, str._QQ_
xor ecx, ecx
mov edx, edi
lea esi, [ebp + 0x218]
call fcn.00406170
test eax, eax
jl 0x491108
mov edx, edi
lea edi, [ebp - 0x10]
call fcn.00404a50
lea ecx, [ebp]
call fcn.00491287
jmp 0x4911cd
mov edi, str._CUR_MODULE_
xor ecx, ecx
mov edx, edi
lea esi, [ebp + 0x218]
call fcn.00406170
test eax, eax
jl 0x49119b
mov edx, edi
lea edi, [ebp - 0x10]
call fcn.00404a50
lea eax, [ebp - 0x1c]
push eax
mov ecx, str.Kernel32.dll
call fcn.00409c00
lea ecx, [ebp - 0x1c]
mov byte [ebp - 4], 3
call fcn.00493187
lea ecx, [ebp - 0x1c]
mov esi, eax
mov byte [ebp - 4], 2
call fcn.004016d0
push str.GetModuleHandleExW
push esi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
cmp eax, ebx
mov dword [ebp - 0x14], ebx
je 0x491172
lea ecx, [ebp - 0x14]
push ecx
push fcn.00490f58
push 4
call eax
push 0x104
lea eax, [ebp]
push eax
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea eax, [ebp]
push eax
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
cmp esi, ebx
jne 0x49120a
push ebx
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
jmp 0x49120a
mov edi, str._CUR_EXE_MODULE_
xor ecx, ecx
mov edx, edi
lea esi, [ebp + 0x218]
call fcn.00406170
test eax, eax
jl 0x4911d9
mov edx, edi
lea edi, [ebp - 0x10]
call fcn.00404a50
push 0x104
lea eax, [ebp]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea eax, [ebp]
push eax
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
jmp 0x49120a
mov edi, str._CUR_DIR_
xor ecx, ecx
mov edx, edi
lea esi, [ebp + 0x218]
call fcn.00406170
test eax, eax
jl 0x49120a
mov edx, edi
lea edi, [ebp - 0x10]
call fcn.00404a50
lea eax, [ebp]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
mov esi, dword [ebp - 0x10]
cmp dword [esi - 0xc], ebx
je 0x491231
lea eax, [ebp]
push eax
call fcn.004c64fc
test eax, eax
pop ecx
jbe 0x491231
lea eax, [ebp]
push eax
push esi
lea eax, [ebp + 0x218]
push eax
call fcn.00407ee0
mov eax, dword [ebp + 0x218]
add eax, 0xfffffff0
call fcn.004012e0
mov esi, dword [ebp - 0x20]
add eax, 0x10
lea ecx, [ebp - 0x10]
mov dword [esi], eax
call fcn.004016d0
lea ecx, [ebp - 0x18]
call fcn.004016d0
lea ecx, [ebp + 0x218]
call fcn.004016d0
mov eax, esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp + 0x208]
xor ecx, ebp
call fcn.004b83ee
add ebp, 0x20c
leave
ret