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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4d9357
mov eax, dword fs:[0]
push eax
sub esp, 0x218
mov eax, dword [0x51352c]
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 ebx, dword [ebp + 8]
mov dword [ebp - 0x224], ebx
call fcn.0042f8b0
mov ecx, eax
test ecx, ecx
je 0x477043
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x21c], eax
push 0x4de194
lea ecx, [ebp - 0x21c]
mov dword [ebp - 4], 0
call fcn.0040f8a0
test al, al
jne 0x476e31
push 0
push 0x4de194
lea ecx, [ebp - 0x21c]
call fcn.0040e030
mov edi, dword [ebp + 0xc]
push edi
mov dword [ebp - 4], 1
call fcn.00478a70
mov esi, dword [0x517700]
add esp, 4
mov edx, eax
mov eax, esi
mov ecx, dword [esi + 4]
cmp byte [ecx + 0xd], 0
jne 0x476e74
cmp dword [ecx + 0x10], edx
jge 0x476e61
mov ecx, dword [ecx + 8]
jmp 0x476e65
mov eax, ecx
mov ecx, dword [ecx]
cmp byte [ecx + 0xd], 0
je 0x476e57
cmp eax, esi
je 0x476e74
cmp edx, dword [eax + 0x10]
jge 0x476e76
mov eax, esi
cmp esi, eax
je 0x476e89
add eax, 0x14
lea ecx, [ebp - 0x21c]
push eax
call fcn.0040f500
mov esi, dword [ebp - 0x21c]
cmp dword [esi - 0xc], 0
jne 0x476ef8
call fcn.0042f8b0
mov ecx, eax
test ecx, ecx
je 0x47704d
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebx], eax
push 0x4de194
mov ecx, ebx
mov byte [ebp - 4], 2
call fcn.0040f8a0
test al, al
jne 0x476ed0
push 0
push 0x4de194
mov ecx, ebx
call fcn.0040e030
mov dword [ebp - 4], 0xffffffff
add esi, 0xfffffff0
or eax, 0xffffffff
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x477025
mov ecx, dword [esi]
push esi
mov edx, dword [ecx]
call dword [edx + 4]
jmp 0x477025
push edi
call fcn.00478a70
push 0x208
mov edi, eax
lea eax, [ebp - 0x218]
push 0
push eax
call fcn.0047cba0
add esp, 0x10
lea eax, [ebp - 0x218]
xor ecx, ecx
cmp edi, 0x3f
sete cl
push 0
lea ecx, [ecx*2 + 0x1a]
push ecx
push eax
push 0
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
push esi
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAppendW]
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x476f65
lea eax, [ebp - 0x218]
push eax
push 0
call dword [sym.imp.SHELL32.dll_SHCreateDirectory]
call fcn.0042f8b0
mov ecx, eax
test ecx, ecx
je 0x477057
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x220], eax
lea eax, [ebp - 0x218]
mov byte [ebp - 4], 3
push eax
lea ecx, [ebp - 0x220]
call fcn.0040f8a0
test al, al
jne 0x476fc7
lea ecx, [ebp - 0x218]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x476fa5
sub ecx, edx
lea eax, [ebp - 0x218]
sar ecx, 1
push ecx
push eax
lea ecx, [ebp - 0x220]
call fcn.0040e030
mov eax, dword [ebp - 0x220]
add eax, 0xfffffff0
mov byte [ebp - 4], 4
push eax
mov dword [ebp - 0x224], eax
call fcn.0040ce60
mov edx, dword [ebp - 0x224]
add eax, 0x10
or edi, 0xffffffff
mov dword [ebx], eax
add esp, 4
mov byte [ebp - 4], 1
mov eax, edi
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x477009
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov dword [ebp - 4], 0xffffffff
add esi, 0xfffffff0
lock xadd dword [esi + 0xc], edi
dec edi
test edi, edi
jg 0x477025
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, ebx
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.0046522d
mov esp, ebp
pop ebp
ret
push 0x80004005
call fcn.0040ce10
push 0x80004005
call fcn.0040ce10
push 0x80004005
call fcn.0040ce10
int3