Function at 0x407860
Capabilities:
Check if file exists
Get common file path

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x5b6b92
mov eax, dword fs:[0]
push eax
sub esp, 0x260
mov eax, dword [0x629688]
xor eax, esp
mov dword [esp + 0x258], eax
push ebx
push esi
push edi
mov eax, dword [0x629688]
xor eax, esp
push eax
lea eax, [esp + 0x270]
mov dword fs:[0], eax
mov esi, ecx
mov edi, dword [ebp + 8]
xor eax, eax
mov dword [esi + 0x64], edi
mov dword [esp + 0x28], 7
mov dword [esp + 0x24], 0
mov word [esp + 0x14], ax
mov dword [esp + 0x278], eax
lea eax, [esp + 0x5c]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
test eax, eax
je 0x407aef
cmp word [esp + 0x5c], 0
jne 0x4078ea
xor ecx, ecx
jmp 0x407900
lea ecx, [esp + 0x5c]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x4078f1
sub ecx, edx
sar ecx, 1
push ecx
lea eax, [esp + 0x60]
push eax
lea ecx, [esp + 0x1c]
call fcn.00408410
xor eax, eax
push 0xffffffffffffffff
push eax
mov word [esp + 0x4c], ax
lea eax, [esi + 0x34]
push eax
lea ecx, [esp + 0x50]
mov dword [esp + 0x64], 7
mov dword [esp + 0x60], 0
call fcn.00408170
push str..trace
lea ecx, [esp + 0x30]
mov byte [esp + 0x27c], 1
call fcn.00407fb0
lea edx, [esp + 0x2c]
lea ecx, [esp + 0x44]
mov byte [esp + 0x278], 2
call fcn.00415e50
mov byte [esp + 0x278], 1
cmp dword [esp + 0x40], 8
mov bl, al
jb 0x40797e
push dword [esp + 0x2c]
call fcn.0058603b
add esp, 4
test bl, bl
je 0x407ac5
lea edx, [esp + 0x44]
lea ecx, [esp + 0x14]
call fcn.00415c60
test al, al
je 0x407ac5
cmp dword [esp + 0x28], 8
lea eax, [esp + 0x14]
cmovae eax, dword [esp + 0x14]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
cmp eax, 1
jne 0x4079c1
mov dword [esi + 0x64], 0xa
jmp 0x407ac5
push str..debug
lea ecx, [esp + 0x30]
call fcn.00407fb0
lea edx, [esp + 0x2c]
lea ecx, [esp + 0x14]
mov byte [esp + 0x278], 3
call fcn.00415e50
lea ecx, [esp + 0x2c]
mov bl, al
mov byte [esp + 0x278], 1
call fcn.00408010
test bl, bl
je 0x407a0c
lea ecx, [esp + 0x14]
call fcn.00415bb0
test al, al
jne 0x407ab9
lea ecx, [esp + 0x14]
call fcn.00415f00
test al, al
je 0x407ac5
push str.asu.trace
lea ecx, [esp + 0x30]
call fcn.00407fb0
lea edx, [esp + 0x2c]
lea ecx, [esp + 0x14]
mov byte [esp + 0x278], 4
call fcn.00415c60
lea ecx, [esp + 0x2c]
mov bl, al
mov byte [esp + 0x278], 1
call fcn.00408010
test bl, bl
je 0x407ac5
lea ecx, [esp + 0x14]
call fcn.00415bb0
test al, al
je 0x407a6d
mov dword [esi + 0x64], 0xa
jmp 0x407ac5
lea ecx, [esp + 0x14]
call fcn.00415f00
test al, al
je 0x407ac5
push str.asu.debug
lea ecx, [esp + 0x30]
call fcn.00407fb0
lea edx, [esp + 0x2c]
lea ecx, [esp + 0x14]
mov byte [esp + 0x278], 5
call fcn.00415c60
lea ecx, [esp + 0x2c]
mov bl, al
call fcn.00408010
test bl, bl
je 0x407ac5
lea ecx, [esp + 0x14]
call fcn.00415bb0
test al, al
je 0x407ac5
cmp edi, 0x14
jle 0x407ac5
mov dword [esi + 0x64], 0x14
cmp dword [esp + 0x58], 8
jb 0x407ad8
push dword [esp + 0x44]
call fcn.0058603b
add esp, 4
xor eax, eax
mov dword [esp + 0x58], 7
mov dword [esp + 0x54], 0
mov word [esp + 0x44], ax
cmp dword [esp + 0x28], 8
jb 0x407b02
push dword [esp + 0x14]
call fcn.0058603b
add esp, 4
mov ecx, dword [esp + 0x270]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x258]
xor ecx, esp
call fcn.00586d1b
mov esp, ebp
pop ebp
ret 4