Function at 0x406490
Capabilities:
Check if file exists
Delete file
Get file attributes
Set file attributes

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x50674e
mov eax, dword fs:[0]
push eax
sub esp, 0x490
mov eax, dword [0x551580]
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, ecx
mov esi, dword [ebp + 8]
mov edi, dword [ebp + 0xc]
cmp dword [esi + 0x10], 0
je 0x406778
push 0x512b1c
push esi
call fcn.004035f0
add esp, 8
test al, al
je 0x406636
test edi, edi
jns 0x406501
mov eax, edi
neg eax
push eax
lea eax, [ebp - 0x13]
push eax
call fcn.00404bd0
mov byte [eax - 1], 0x2d
lea ecx, [eax - 1]
jmp 0x40650d
lea eax, [ebp - 0x13]
push edi
push eax
call fcn.00404bd0
mov ecx, eax
lea eax, [ebp - 0x13]
mov dword [ebp - 0x488], 0
add esp, 8
mov dword [ebp - 0x484], 0xf
mov byte [ebp - 0x498], 0
cmp ecx, eax
je 0x406541
sub eax, ecx
push eax
push ecx
lea ecx, [ebp - 0x498]
call fcn.00408ce0
push 4
push 0x512b6c
lea ecx, [ebp - 0x480]
mov dword [ebp - 4], 0
mov dword [ebp - 0x470], 0
mov dword [ebp - 0x46c], 0xf
mov byte [ebp - 0x480], 0
call fcn.00408ce0
push 0
push 0x5129bd
lea ecx, [ebp - 0x468]
mov byte [ebp - 4], 1
mov dword [ebp - 0x458], 0
mov dword [ebp - 0x454], 0xf
mov byte [ebp - 0x468], 0
call fcn.00408ce0
push 4
push 0x512b1c
lea ecx, [ebp - 0x450]
mov byte [ebp - 4], 2
mov dword [ebp - 0x440], 0
mov dword [ebp - 0x43c], 0xf
mov byte [ebp - 0x450], 0
call fcn.00408ce0
lea eax, [ebp - 0x480]
mov byte [ebp - 4], 3
push eax
lea eax, [ebp - 0x468]
push eax
lea eax, [ebp - 0x498]
push eax
lea eax, [ebp - 0x450]
push eax
call fcn.00406ba0
mov ecx, eax
call fcn.00408100
lea ecx, [ebp - 0x450]
call fcn.00405230
lea ecx, [ebp - 0x468]
call fcn.00405230
lea ecx, [ebp - 0x480]
call fcn.00405230
lea ecx, [ebp - 0x498]
mov dword [ebp - 4], 0xffffffff
call fcn.00405230
push 0x208
lea eax, [ebp - 0x438]
push 0
push eax
call fcn.004cfda0
add esp, 0xc
cmp dword [esi + 0x14], 0x10
jb 0x406654
mov esi, dword [esi]
push esi
lea eax, [ebp - 0x438]
push 0x512bc8
push eax
call fcn.00404c10
push 0x208
lea eax, [ebp - 0x230]
push 0
push eax
call fcn.004cfda0
add esp, 0x18
lea eax, [ebp - 0x438]
push eax
push ebx
lea eax, [ebp - 0x230]
push eax
call dword [sym.imp.SHLWAPI.dll_PathCombineW]
test edi, edi
je 0x406744
mov ecx, dword [0x5576b0]
test ecx, ecx
jne 0x406705
push 0x551074
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [0x5576b0], 0
jne 0x4066f4
push 8
call fcn.0043b047
add esp, 4
mov dword [ebp - 0x49c], eax
mov dword [ebp - 4], 4
test eax, eax
je 0x4066db
mov ecx, eax
call fcn.00412bc0
jmp 0x4066dd
xor eax, eax
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x49c]
xor edx, edx
lock or dword [ecx], edx
mov dword [0x5576b0], eax
push 0x551074
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [0x5576b0]
call fcn.00412ed0
test eax, eax
je 0x406744
lea eax, [ebp - 0x230]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x406778
push eax
push 0x80
push 2
push eax
push eax
push 0x40000000
lea eax, [ebp - 0x230]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x406778
lea eax, [ebp - 0x230]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x40676b
test al, 1
je 0x40676b
and eax, 0xfffffffe
push eax
lea eax, [ebp - 0x230]
push eax
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
lea eax, [ebp - 0x230]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
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.0043b31f
mov esp, ebp
pop ebp
ret 8