Function at 0x409e90
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
mov eax, 0x101c
call fcn.0040f540
mov eax, dword [0x4255e0]
push ebx
push esi
mov esi, dword [ebp + 0x10]
xor eax, ebp
test esi, esi
mov dword [esp + 0x1020], eax
push edi
mov dword [esp + 0x18], ecx
mov dword [esp + 0x14], esi
je 0x40a0d6
cmp byte [esi], 0
je 0x40a0d6
mov eax, dword [ecx + 0x24]
test eax, eax
je 0x40a0d6
mov dl, byte [ecx + 0x20]
test dl, dl
je 0x409eeb
push str.Const_Mode
push 3
jmp 0x40a0dd
mov edi, dword [ebp + 8]
push 0
push 0
push edi
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x409f1b
push edi
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.winErr_d__point_d
push 6
call fcn.00408d90
add esp, 0x10
jmp 0x40a0e5
push 0
push 0x8000027
push 3
push 0
push 3
push 0x80000000
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x409f57
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push esi
push str.Open_file:__s__WinErr_d
push 3
call fcn.00408d90
add esp, 0x10
jmp 0x40a0e5
xor eax, eax
mov byte [esp + 0x20], 0
mov ecx, 0x3ff
lea edi, [esp + 0x21]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
push 0
stosb byte es:[edi], al
lea eax, [esp + 0x14]
push eax
push 0x1000
lea ecx, [esp + 0x2c]
push ecx
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov ecx, dword [esp + 0x10]
xor esi, esi
test ecx, ecx
je 0x40a046
test eax, eax
je 0x409ff9
mov edi, dword [ebp + 0xc]
lea edx, [esi + ecx]
cmp edx, edi
jbe 0x409fa8
mov ecx, edi
sub ecx, esi
mov dword [esp + 0x10], ecx
mov edx, dword [esp + 0x18]
push 0
lea eax, [esp + 0x20]
push eax
mov eax, dword [edx + 0x24]
push ecx
lea ecx, [esp + 0x2c]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40a024
mov eax, dword [esp + 0x1c]
cmp dword [esp + 0x10], eax
jne 0x40a024
add esi, eax
cmp esi, edi
jae 0x40a049
push 0
lea ecx, [esp + 0x14]
push ecx
push 0x1000
lea edx, [esp + 0x2c]
push edx
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov ecx, dword [esp + 0x10]
test ecx, ecx
jne 0x409f92
jmp 0x40a049
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x26
je 0x40a046
mov eax, dword [esp + 0x14]
push eax
push str.file:__s
push 4
call fcn.00408d90
add esp, 0xc
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x40a0e5
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.winErr:__d
push 5
call fcn.00408d90
add esp, 0xc
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x40a0e5
mov edi, dword [ebp + 0xc]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp esi, edi
jb 0x40a070
mov al, 1
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x1018]
xor ecx, ebp
call fcn.0040e9b5
mov esp, ebp
pop ebp
ret 0xc
mov edi, dword [ebp + 0xc]
mov eax, edi
sub eax, esi
cmp eax, 0x1000
mov ebx, 0x1000
ja 0x40a082
mov ebx, eax
xor eax, eax
push eax
mov ecx, 0x400
lea edi, [esp + 0x24]
rep stosd dword es:[edi], eax
mov eax, dword [esp + 0x1c]
lea ecx, [esp + 0x18]
push ecx
mov ecx, dword [eax + 0x24]
push ebx
lea edx, [esp + 0x2c]
push edx
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40a0be
mov eax, dword [esp + 0x14]
cmp ebx, eax
jne 0x40a0be
add esi, eax
cmp esi, dword [ebp + 0xc]
jb 0x40a06d
jmp 0x40a054
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.winErr:__d
push 5
call fcn.00408d90
add esp, 0xc
jmp 0x40a0e5
push 0x41e67c
push 0xa
call fcn.00408d90
add esp, 8
mov ecx, dword [esp + 0x1024]
pop edi
pop esi
xor ecx, ebp
xor al, al
pop ebx
call fcn.0040e9b5
mov esp, ebp
pop ebp
ret 0xc