Function at 0x402ce0
Capabilities:
Check if file exists
Delete file
Set file attributes
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x54f2d3
mov eax, dword fs:[0]
push eax
sub esp, 0xb4
mov eax, dword [0x5a7110]
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 edi, ecx
mov dword [ebp - 0x14], 0
call fcn.0041bf47
xor edx, edx
mov ecx, eax
test ecx, ecx
setne dl
test edx, edx
jne 0x402d33
push 0x80004005
call fcn.00404b60
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x14], eax
mov dword [ebp - 4], 0
or esi, 0xffffffff
cmp dword [edi + 0x140], 1
jne 0x402f04
push dword [edi + 0x134]
lea ebx, [edi + 0x134]
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x402e07
push 0x5c
push dword [ebx]
call fcn.00528d27
add esp, 8
test eax, eax
jne 0x402d83
or eax, esi
jmp 0x402d87
sub eax, dword [ebx]
sar eax, 1
push eax
lea eax, [ebp - 0x34]
push eax
mov ecx, ebx
call fcn.00403460
push dword [eax]
push 0
call dword [sym.imp.SHELL32.dll_SHCreateDirectory]
mov edx, dword [ebp - 0x34]
add edx, 0xfffffff0
mov ecx, esi
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x402db9
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
cmp dword [edi + 0x138], 0
jne 0x402e07
mov eax, dword [ebx]
push 0x5845bc
mov esi, dword [eax - 0xc]
call dword [sym.imp.KERNEL32.dll_lstrlenW]
sub esi, eax
push esi
lea eax, [ebp - 0x34]
push eax
mov ecx, ebx
call fcn.00403460
push 2
push dword [eax]
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
mov edx, dword [ebp - 0x34]
add edx, 0xfffffff0
or ecx, 0xffffffff
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x402e07
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
lea eax, [ebp - 0x14]
push eax
lea ecx, [edi + 0xbc]
call fcn.00416c4d
push ecx
push dword [ebp - 0x14]
lea eax, [ebp - 0xbc]
lea ecx, [ebp - 0xc0]
mov dword [ebp - 0xc0], eax
call fcn.00403a30
mov byte [ebp - 4], 1
mov edx, dword [ebp - 0xc0]
mov dword [ebp - 0x18], 0xf
mov dword [ebp - 0x1c], 0
mov byte [ebp - 0x2c], 0
cmp byte [edx], 0
jne 0x402e56
xor ecx, ecx
jmp 0x402e69
mov ecx, edx
lea esi, [ecx + 1]
jmp 0x402e60
mov al, byte [ecx]
inc ecx
test al, al
jne 0x402e60
sub ecx, esi
push ecx
push edx
lea ecx, [ebp - 0x2c]
call fcn.004016f0
mov eax, dword [ebp - 0xc0]
lea ecx, [ebp - 0xbc]
cmp eax, ecx
je 0x402e8c
push eax
call fcn.0052876e
add esp, 4
mov edi, dword [ebp - 0x1c]
push 0
push 2
push 2
push 0
push 0
push 0x40000000
push dword [ebx]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
push 0
push 0
mov esi, eax
push 0
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp dword [ebp - 0x18], 0x10
push 0
lea eax, [ebp - 0x30]
push eax
lea ecx, [ebp - 0x2c]
cmovae ecx, dword [ebp - 0x2c]
push edi
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
call dword [sym.imp.KERNEL32.dll_GetLastError]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 0x18], 0x10
jb 0x402eed
push dword [ebp - 0x2c]
call fcn.00404c96
add esp, 4
mov dword [ebp - 0x18], 0xf
mov dword [ebp - 0x1c], 0
mov byte [ebp - 0x2c], 0
or esi, 0xffffffff
jmp 0x402f20
push dword [edi + 0x134]
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x402f20
push dword [edi + 0x134]
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
mov dword [ebp - 4], 0xffffffff
mov edx, dword [ebp - 0x14]
add edx, 0xfffffff0
lea eax, [edx + 0xc]
lock xadd dword [eax], esi
dec esi
test esi, esi
jg 0x402f41
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, 1
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.00527e41
mov esp, ebp
pop ebp
ret