Function at 0x401afd
Capabilities:
Check if file exists
Get file attributes
Set file attributes
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x38
push ebx
push edi
mov edi, ecx
test edi, edi
mov ebx, edx
mov dword [ebp - 0x14], ebx
je 0x401d2b
test ebx, ebx
je 0x401d2b
mov eax, dword [edi + 0x58]
test eax, eax
push esi
je 0x401b50
push dword [ebp + 8]
mov esi, dword [sym.imp.USER32.dll_PostMessageW]
push 0
push 0x1400
push eax
call esi
lea eax, [ebx + 0x10]
push eax
push 0
push 0x1401
push dword [edi + 0x58]
call esi
mov eax, dword [edi + 0x5c]
test eax, eax
je 0x401b50
call eax
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x401b6b
and eax, 0xfffffffa
push eax
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
mov ecx, 0x10000
call fcn.0040190f
xor esi, esi
push esi
push 0x80
push 2
push esi
push esi
push 0x40000000
push dword [ebp + 8]
mov dword [ebp - 0x34], eax
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x30], eax
add eax, 0x10000
mov dword [ebp - 0x28], eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
cmp eax, 0xffffffff
mov dword [ebp - 0x38], eax
jne 0x401bb6
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 4], eax
jmp 0x401ccb
mov eax, dword [edi + 0x54]
mov ecx, dword [ebx + 0x14]
cmp ecx, esi
mov dword [ebp - 8], eax
mov eax, dword [ebx + 0x10]
mov dword [ebp - 0x24], 0x401a1a
mov dword [ebp - 0x20], edi
mov dword [ebp - 0x18], ecx
ja 0x401bdb
cmp eax, esi
jbe 0x401cd8
mov esi, dword [ebp - 0x28]
mov ebx, dword [ebp - 0x2c]
xor ecx, ecx
sub esi, ebx
cmp ecx, dword [ebp - 0x18]
jb 0x401bf2
ja 0x401bf0
cmp esi, eax
jbe 0x401bf2
mov esi, eax
sub eax, esi
sbb dword [ebp - 0x18], 0
mov dword [ebp - 0x1c], eax
lea eax, [ebp - 0xc]
push eax
push esi
push ebx
lea eax, [ebp - 0x24]
push eax
push dword [ebp - 8]
call fcn.004020ca
add esp, 0x14
test eax, eax
jne 0x401cb2
cmp dword [ebp - 0xc], esi
jne 0x401cbb
mov eax, dword [ebp - 0x34]
add ebx, esi
mov dword [ebp - 0x2c], ebx
sub ebx, eax
mov dword [ebp - 0x30], eax
je 0x401c58
push 0
lea eax, [ebp - 0x10]
push eax
push ebx
push dword [ebp - 0x30]
push dword [ebp - 0x38]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x401c9e
mov eax, dword [ebp - 0x10]
test eax, eax
je 0x401ca9
add dword [ebp - 0x30], eax
sub ebx, eax
jne 0x401c30
mov eax, dword [ebp - 0x34]
and dword [ebp - 4], 0
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x30], eax
cmp dword [ebp - 4], 0
jne 0x401ccb
mov eax, dword [edi + 0x58]
xor ebx, ebx
cmp eax, ebx
je 0x401c8c
push esi
push ebx
push 0x1402
push eax
call dword [sym.imp.USER32.dll_PostMessageW]
mov eax, dword [edi + 0x5c]
cmp eax, ebx
je 0x401c8c
call eax
test eax, eax
je 0x401cc4
cmp dword [ebp - 0x18], ebx
ja 0x401c96
cmp dword [ebp - 0x1c], ebx
jbe 0x401cd5
mov eax, dword [ebp - 0x1c]
jmp 0x401bdb
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 4], eax
jmp 0x401c62
mov dword [ebp - 4], 0x27
jmp 0x401ccb
mov dword [ebp - 4], 0x1e
jmp 0x401ccb
mov dword [ebp - 4], 0x26
jmp 0x401ccb
mov dword [ebp - 4], 0x4c7
lea esi, [ebp - 0x38]
call fcn.0040194b
jmp 0x401d04
mov ebx, dword [ebp - 0x14]
lea eax, [ebx + 0x20]
push eax
push 0
push 0
push dword [ebp - 0x38]
call dword [sym.imp.KERNEL32.dll_SetFileTime]
lea esi, [ebp - 0x38]
call fcn.0040194b
test eax, eax
mov dword [ebp - 4], eax
jne 0x401d04
push dword [ebx + 0x28]
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
mov eax, dword [edi + 0x58]
test eax, eax
pop esi
je 0x401d26
push dword [ebp - 4]
push 0
push 0x1403
push eax
call dword [sym.imp.USER32.dll_PostMessageW]
mov edi, dword [edi + 0x5c]
test edi, edi
je 0x401d26
call edi
mov eax, dword [ebp - 4]
jmp 0x401d2e
push 0x57
pop eax
pop edi
pop ebx
leave
ret 4