Function at 0x401994
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 0x401bc2
test ebx, ebx
je 0x401bc2
mov eax, dword [edi + 0x58]
test eax, eax
push esi
je 0x4019e7
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 0x4019e7
call eax
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x401a02
and eax, 0xfffffffa
push eax
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
mov ecx, 0x10000
call fcn.004017a6
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 0x401a4d
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 4], eax
jmp 0x401b62
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], 0x4018b1
mov dword [ebp - 0x20], edi
mov dword [ebp - 0x18], ecx
ja 0x401a72
cmp eax, esi
jbe 0x401b6f
mov esi, dword [ebp - 0x28]
mov ebx, dword [ebp - 0x2c]
xor ecx, ecx
sub esi, ebx
cmp ecx, dword [ebp - 0x18]
jb 0x401a89
ja 0x401a87
cmp esi, eax
jbe 0x401a89
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.00401f61
add esp, 0x14
test eax, eax
jne 0x401b49
cmp dword [ebp - 0xc], esi
jne 0x401b52
mov eax, dword [ebp - 0x34]
add ebx, esi
mov dword [ebp - 0x2c], ebx
sub ebx, eax
mov dword [ebp - 0x30], eax
je 0x401aef
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 0x401b35
mov eax, dword [ebp - 0x10]
test eax, eax
je 0x401b40
add dword [ebp - 0x30], eax
sub ebx, eax
jne 0x401ac7
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 0x401b62
mov eax, dword [edi + 0x58]
xor ebx, ebx
cmp eax, ebx
je 0x401b23
push esi
push ebx
push 0x1402
push eax
call dword [sym.imp.USER32.dll_PostMessageW]
mov eax, dword [edi + 0x5c]
cmp eax, ebx
je 0x401b23
call eax
test eax, eax
je 0x401b5b
cmp dword [ebp - 0x18], ebx
ja 0x401b2d
cmp dword [ebp - 0x1c], ebx
jbe 0x401b6c
mov eax, dword [ebp - 0x1c]
jmp 0x401a72
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 4], eax
jmp 0x401af9
mov dword [ebp - 4], 0x27
jmp 0x401b62
mov dword [ebp - 4], 0x1e
jmp 0x401b62
mov dword [ebp - 4], 0x26
jmp 0x401b62
mov dword [ebp - 4], 0x4c7
lea esi, [ebp - 0x38]
call fcn.004017e2
jmp 0x401b9b
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.004017e2
test eax, eax
mov dword [ebp - 4], eax
jne 0x401b9b
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 0x401bbd
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 0x401bbd
call edi
mov eax, dword [ebp - 4]
jmp 0x401bc5
push 0x57
pop eax
pop edi
pop ebx
leave
ret 4