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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
mov eax, 0x101c
call fcn.0041fb60
mov eax, dword [0x44a588]
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 0x40fff6
cmp byte [esi], 0
je 0x40fff6
mov eax, dword [ecx + 0x24]
test eax, eax
je 0x40fff6
mov dl, byte [ecx + 0x20]
test dl, dl
je 0x40fe0b
push str.Const_Mode
push 3
jmp 0x40fffd
mov edi, dword [ebp + 8]
push 0
push 0
push edi
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x40fe3b
push edi
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.winErr_d__point_d
push 6
call fcn.00413420
add esp, 0x10
jmp 0x410005
push 0
push 0x8000027
push 3
push 0
push 3
push SysReAllocStringLen
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x40fe77
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push esi
push str.Open_file:__s__WinErr_d
push 3
call fcn.00413420
add esp, 0x10
jmp 0x410005
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 0x40ff66
test eax, eax
je 0x40ff19
mov edi, dword [ebp + 0xc]
lea edx, [esi + ecx]
cmp edx, edi
jbe 0x40fec8
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 0x40ff44
mov eax, dword [esp + 0x1c]
cmp dword [esp + 0x10], eax
jne 0x40ff44
add esi, eax
cmp esi, edi
jae 0x40ff69
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 0x40feb2
jmp 0x40ff69
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x26
je 0x40ff66
mov eax, dword [esp + 0x14]
push eax
push str.file:__s
push 4
call fcn.00413420
add esp, 0xc
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x410005
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.winErr:__d
push 5
call fcn.00413420
add esp, 0xc
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x410005
mov edi, dword [ebp + 0xc]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp esi, edi
jb 0x40ff90
mov al, 1
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x1018]
xor ecx, ebp
call fcn.0041fb44
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 0x40ffa2
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 0x40ffde
mov eax, dword [esp + 0x14]
cmp ebx, eax
jne 0x40ffde
add esi, eax
cmp esi, dword [ebp + 0xc]
jb 0x40ff8d
jmp 0x40ff74
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.winErr:__d
push 5
call fcn.00413420
add esp, 0xc
jmp 0x410005
push 0x4404a8
push 0xa
call fcn.00413420
add esp, 8
mov ecx, dword [esp + 0x1024]
pop edi
pop esi
xor ecx, ebp
xor al, al
pop ebx
call fcn.0041fb44
mov esp, ebp
pop ebp
ret 0xc