Function at 0x4085ce
Capabilities:
Get common file path

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x554c8e
mov eax, dword fs:[0]
push eax
sub esp, 0x250
mov eax, dword [0x5c21b0]
xor eax, esp
mov dword [esp + 0x248], eax
push ebx
push esi
push edi
mov eax, dword [0x5c21b0]
xor eax, esp
push eax
lea eax, [esp + 0x260]
mov dword fs:[0], eax
mov ebx, ecx
mov esi, dword [ebp + 8]
test esi, esi
je 0x408824
mov eax, dword [esi + 0x14]
test eax, eax
je 0x408626
mov al, byte [eax]
jmp 0x408629
mov al, byte [esi + 0x18]
test al, al
je 0x408824
mov ecx, esi
call fcn.0040a892
mov edi, eax
lea ecx, [esp + 0x1c]
xor eax, eax
mov dword [esp + 0x10], edi
mov dword [esp + 0x30], eax
push eax
mov dword [esp + 0x30], eax
mov dword [esp + 0x34], 7
call fcn.004046d0
xor eax, eax
mov dword [esp + 0x268], eax
lea ecx, [esp + 0x34]
mov dword [esp + 0x48], eax
push eax
mov dword [esp + 0x48], eax
mov dword [esp + 0x4c], 7
call fcn.004046d0
mov byte [esp + 0x268], 1
push edi
call dword [sym.imp.SHLWAPI.dll_PathIsFileSpecW]
lea edi, [ebx + 0xbc]
test eax, eax
je 0x4086bb
push edi
xor eax, eax
push eax
push eax
push 0x8023
push eax
call dword [sym.imp.SHELL32.dll_SHGetFolderPathW]
push edi
lea ecx, [esp + 0x20]
call fcn.00404830
push dword [esp + 0x10]
lea ecx, [esp + 0x38]
jmp 0x4086ea
push dword [esp + 0x10]
push 0x104
push edi
call fcn.00537693
add esp, 0xc
push edi
call dword [sym.imp.SHLWAPI.dll_PathFindFileNameW]
push eax
lea ecx, [esp + 0x38]
call fcn.00404830
push edi
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
push edi
lea ecx, [esp + 0x20]
call fcn.00404830
test dword [esi + 0x10], 0x20000
je 0x40874c
cmp dword [esp + 0x48], 8
lea ecx, [esp + 0x34]
push edi
cmovae ecx, dword [esp + 0x38]
lea eax, [esp + 0x20]
cmp dword [esp + 0x34], 8
push 0
cmovae eax, dword [esp + 0x24]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetTempFileNameW]
test eax, eax
je 0x40874c
push 0x104
lea eax, [esp + 0x50]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetLongPathNameW]
test eax, eax
je 0x40874c
mov ecx, dword [esi + 0x14]
test ecx, ecx
je 0x40874c
lea eax, [esp + 0x4c]
add ecx, 4
push eax
call fcn.00404830
mov ecx, esi
call fcn.0040a892
push eax
mov dword [esp + 0x14], eax
call fcn.005347e9
pop ecx
test eax, eax
je 0x4087ca
xor eax, eax
test dword [esi + 0x10], 0x10000
push eax
push 0x80
je 0x408777
push 2
jmp 0x408779
push 4
push eax
push eax
push 0x40000000
push dword [esp + 0x28]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [esp + 0x14], eax
cmp eax, 0xffffffff
je 0x4087ca
lea eax, [esp + 0x18]
push eax
push edi
push 0x104
push 0
push dword [esp + 0x20]
push 0
call dword [sym.imp.KERNEL32.dll_SearchPathW]
test eax, eax
je 0x4087c0
mov ecx, dword [esi + 0x14]
test ecx, ecx
je 0x4087c0
add ecx, 4
push edi
call fcn.00404830
push dword [esp + 0x14]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test dword [esi + 0xc], 0x40000000
je 0x4087f2
push esi
mov ecx, ebx
call fcn.00408312
test dword [esi + 0x10], 0x100000
je 0x4087f2
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
push eax
mov ecx, ebx
call fcn.00408277
mov eax, dword [esi + 0x14]
test eax, eax
je 0x4087fe
mov byte [eax], 0
jmp 0x408802
mov byte [esi + 0x18], 0
mov byte [esp + 0x268], 0
lea ecx, [esp + 0x34]
call fcn.00404190
or dword [esp + 0x268], 0xffffffff
lea ecx, [esp + 0x1c]
call fcn.00404190
mov ecx, dword [esp + 0x260]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x248]
xor ecx, esp
call fcn.00533be9
mov esp, ebp
pop ebp
ret 4