Function at 0x405170
Capabilities:
Check if file exists
Create directory
Get common file path

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x57e829
mov eax, dword fs:[0]
push eax
sub esp, 0x50
mov eax, dword [0x634f58]
xor eax, ebp
mov dword [ebp - 0x10], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, ecx
mov dword [ebp - 0x48], edi
mov dword [ebp - 4], 0
xor eax, eax
mov dword [ebp - 0x58], 0
push eax
mov dword [edi + 0x10], 0
mov dword [edi + 0x14], 7
push 0x610bd8
mov dword [ebp - 0x5c], edi
mov word [edi], ax
call fcn.00402ed0
mov dword [ebp - 4], 0
mov dword [ebp - 0x58], 1
mov dword [ebp - 0x4c], 0
call dword [sym.imp.KERNEL32.dll_WTSGetActiveConsoleSessionId]
lea ecx, [ebp - 0x4c]
push ecx
push eax
call dword [sym.imp.WTSAPI32.dll_WTSQueryUserToken]
test eax, eax
jne 0x405271
mov dword [ebp - 0x50], eax
mov dword [ebp - 0x48], eax
lea eax, [ebp - 0x48]
push eax
lea eax, [ebp - 0x50]
push eax
push 1
push 0
push 0
call dword [sym.imp.WTSAPI32.dll_WTSEnumerateSessionsW]
xor ecx, ecx
mov dword [ebp - 0x44], ecx
cmp dword [ebp - 0x48], ecx
jbe 0x405268
xor esi, esi
nop
mov eax, dword [ebp - 0x50]
cmp dword [esi + eax + 8], 0
jne 0x40523e
lea ecx, [ebp - 0x4c]
push ecx
push dword [esi + eax]
call dword [sym.imp.WTSAPI32.dll_WTSQueryUserToken]
test eax, eax
jne 0x405268
mov ecx, dword [ebp - 0x44]
mov eax, dword [ebp - 0x50]
cmp dword [esi + eax + 8], 1
jne 0x40525c
lea ecx, [ebp - 0x4c]
push ecx
push dword [esi + eax]
call dword [sym.imp.WTSAPI32.dll_WTSQueryUserToken]
test eax, eax
jne 0x405268
mov ecx, dword [ebp - 0x44]
inc ecx
add esi, 0xc
mov dword [ebp - 0x44], ecx
cmp ecx, dword [ebp - 0x48]
jb 0x405220
push dword [ebp - 0x50]
call dword [sym.imp.WTSAPI32.dll_WTSFreeMemory]
mov esi, dword [sym.imp.USERENV.dll_GetUserProfileDirectoryW]
lea eax, [ebp - 0x54]
push eax
push 0
push dword [ebp - 0x4c]
mov dword [ebp - 0x54], 0x1000
call esi
mov eax, dword [ebp - 0x54]
xor ecx, ecx
inc eax
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.00413217
mov ecx, eax
mov eax, dword [ebp - 0x54]
inc eax
mov dword [ebp - 0x44], ecx
push eax
push 0
push ecx
call fcn.005552b0
add esp, 0x10
lea eax, [ebp - 0x54]
push eax
push dword [ebp - 0x44]
push dword [ebp - 0x4c]
call esi
mov eax, dword [ebp - 0x4c]
test eax, eax
je 0x4052d7
cmp eax, 0xffffffff
je 0x4052d7
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, dword [ebp - 0x44]
xor eax, eax
mov ecx, esi
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 7
mov word [ebp - 0x28], ax
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x4052f3
sub ecx, edx
sar ecx, 1
push ecx
push esi
lea ecx, [ebp - 0x28]
call fcn.00402ed0
push esi
mov dword [ebp - 0x58], 3
call fcn.00413212
lea eax, [ebp - 0x28]
add esp, 4
cmp edi, eax
je 0x40533d
mov ecx, edi
call fcn.00402560
movups xmm0, xmmword [ebp - 0x28]
movups xmmword [edi], xmm0
movq xmm0, qword [ebp - 0x18]
movq qword [edi + 0x10], xmm0
jmp 0x405377
mov edx, dword [ebp - 0x14]
cmp edx, 8
jb 0x405377
mov ecx, dword [ebp - 0x28]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40536d
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x405526
push edx
push ecx
call fcn.0054cfd9
add esp, 8
push 0x610d88
mov ecx, edi
call fcn.00402a10
push str.Foxit_Software_
mov ecx, edi
call fcn.00402a10
cmp dword [edi + 0x14], 8
mov eax, edi
jb 0x405399
mov eax, dword [edi]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x4053b7
cmp dword [edi + 0x14], 8
mov eax, edi
jb 0x4053ae
mov eax, dword [edi]
push 0
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
xor eax, eax
mov dword [ebp - 0x30], 0
mov dword [ebp - 0x2c], 7
mov word [ebp - 0x40], ax
mov dword [ebp - 4], 1
call fcn.00404e80
test al, al
jne 0x4053e7
mov eax, str.Classic
mov ecx, 7
jmp 0x4053f1
mov eax, str.Continuous
mov ecx, 0xa
push ecx
push eax
lea ecx, [ebp - 0x40]
call fcn.00402ed0
push 0x610a5c
lea edx, [ebp - 0x40]
lea ecx, [ebp - 0x28]
call fcn.00402a90
add esp, 4
mov byte [ebp - 4], 2
mov edx, eax
cmp dword [eax + 0x14], 8
jb 0x40541c
mov edx, dword [eax]
mov ecx, dword [eax + 0x10]
mov esi, dword [edi + 0x10]
mov eax, dword [edi + 0x14]
sub eax, esi
mov dword [ebp - 0x48], esi
cmp ecx, eax
ja 0x405460
cmp dword [edi + 0x14], 8
lea eax, [esi + ecx]
mov dword [ebp - 0x44], eax
mov esi, edi
mov dword [edi + 0x10], eax
jb 0x405441
mov esi, dword [edi]
lea eax, [ecx + ecx]
push eax
mov eax, dword [ebp - 0x48]
push edx
lea eax, [esi + eax*2]
push eax
call fcn.005543e0
mov eax, dword [ebp - 0x44]
add esp, 0xc
xor ecx, ecx
mov word [esi + eax*2], cx
jmp 0x405471
push ecx
push edx
mov byte [ebp - 0x48], 0
push dword [ebp - 0x48]
push ecx
mov ecx, edi
call fcn.00402b90
mov edx, dword [ebp - 0x14]
cmp edx, 8
jb 0x4054ab
mov ecx, dword [ebp - 0x28]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x4054a1
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40552b
push edx
push ecx
call fcn.0054cfd9
add esp, 8
cmp dword [edi + 0x14], 8
mov eax, edi
jb 0x4054b5
mov eax, dword [edi]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x4054d3
cmp dword [edi + 0x14], 8
mov eax, edi
jb 0x4054ca
mov eax, dword [edi]
push 0
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
mov edx, dword [ebp - 0x2c]
cmp edx, 8
jb 0x405509
mov ecx, dword [ebp - 0x40]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x4054ff
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x405530
push edx
push ecx
call fcn.0054cfd9
add esp, 8
mov eax, edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0054cfc8
mov esp, ebp
pop ebp
ret
call fcn.00558f09
call fcn.00558f09
call fcn.00558f09
int3