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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x10105b64
mov eax, dword fs:[0]
push eax
sub esp, 0x218
mov eax, dword [0x1014b520]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 8]
or edi, 0xffffffff
mov dword [ebp - 4], 2
cmp dword [eax - 0xc], 0
je 0x1003142f
mov eax, dword [ebp + 0xc]
cmp dword [eax - 0xc], 0
je 0x1003142f
lea eax, [ebp - 0x220]
push eax
lea ecx, [ebp - 0x219]
call fcn.10030ab0
mov ecx, dword [eax]
test ecx, ecx
jne 0x100311de
or ebx, edi
jmp 0x10031206
mov eax, dword [ebp + 8]
cmp dword [eax - 0xc], 0
jge 0x100311ec
or ebx, 0xffffffff
jmp 0x10031206
push ecx
push eax
call fcn.100d73cc
mov ebx, eax
add esp, 8
test ebx, ebx
jne 0x10031201
or ebx, 0xffffffff
jmp 0x10031206
sub ebx, dword [ebp + 8]
sar ebx, 1
mov edx, dword [ebp - 0x220]
mov eax, edi
shr ebx, 0x1f
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x10031226
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
test bl, bl
je 0x1003126a
lea eax, [ebp - 0x220]
push eax
lea ecx, [ebp - 0x219]
call fcn.10030ab0
push eax
lea ecx, [ebp + 8]
mov byte [ebp - 4], 3
call fcn.10030f40
mov edx, dword [ebp - 0x220]
mov eax, edi
mov byte [ebp - 4], 2
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x1003126a
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
push 0x208
lea eax, [ebp - 0x218]
push 0
push eax
call fcn.100d6e30
add esp, 0xc
lea eax, [ebp - 0x218]
push 1
push 0x19
push eax
push 0
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
push dword [ebp + 8]
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAppendW]
lea eax, [ebp - 0x224]
push eax
lea ecx, [ebp - 0x219]
call fcn.10030ec0
mov esi, eax
lea eax, [ebp - 0x220]
mov byte [ebp - 4], 4
push eax
lea ecx, [ebp - 0x219]
call fcn.10030b40
mov ebx, dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringW]
lea ecx, [ebp - 0x218]
push ecx
push dword [ebp + 0xc]
push dword [esi]
push dword [eax]
call ebx
mov edx, dword [ebp - 0x220]
mov eax, edi
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x10031300
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [ebp - 0x224]
mov eax, edi
mov byte [ebp - 4], 2
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x10031321
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, dword [ebp + 0x10]
cmp dword [eax - 0xc], 0
je 0x1003142f
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x1003142f
lea eax, [ebp - 0x220]
push eax
lea ecx, [ebp - 0x219]
call fcn.10030bf0
mov esi, eax
lea eax, [ebp - 0x224]
mov byte [ebp - 4], 5
push eax
lea ecx, [ebp - 0x219]
call fcn.10030b40
lea ecx, [ebp - 0x218]
push ecx
push dword [ebp + 0x10]
push dword [esi]
push dword [eax]
call ebx
mov edx, dword [ebp - 0x224]
mov eax, edi
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x10031394
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [ebp - 0x220]
mov eax, edi
mov byte [ebp - 4], 2
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x100313b5
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
lea eax, [ebp - 0x220]
push eax
lea ecx, [ebp - 0x219]
call fcn.10030c90
mov esi, eax
lea eax, [ebp - 0x224]
mov byte [ebp - 4], 6
push eax
lea ecx, [ebp - 0x219]
call fcn.10030b40
lea ecx, [ebp - 0x218]
push ecx
push 0x1010e2b8
push dword [esi]
push dword [eax]
call ebx
mov edx, dword [ebp - 0x224]
mov eax, edi
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x1003140e
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [ebp - 0x220]
mov eax, edi
mov byte [ebp - 4], 2
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x1003142f
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [ebp + 8]
mov eax, edi
mov byte [ebp - 4], 1
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x1003144d
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [ebp + 0xc]
mov eax, edi
mov byte [ebp - 4], 0
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x1003146b
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [ebp + 0x10]
mov dword [ebp - 4], 0xffffffff
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], edi
dec edi
test edi, edi
jg 0x1003148a
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.100bb073
mov esp, ebp
pop ebp
ret