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

Disassembly:
mov eax, 0x20038
call fcn.00404200
mov eax, dword [esp + 0x20050]
and eax, dword [esp + 0x20054]
push ebx
push ebp
push esi
push edi
mov ebx, ecx
mov byte [esp + 0x13], 1
cmp eax, 0xffffffff
jne 0x401c0d
mov byte [esp + 0x13], 0
mov ecx, dword [esp + 0x2004c]
xor ebp, ebp
push ecx
mov dword [esp + 0x28], ebp
call fcn.00403400
mov dword [esp + 0x34], ebp
mov esi, dword [esp + 0x34]
mov dword [esp + 0x38], ebp
mov edi, dword [esp + 0x38]
add esp, 4
mov dword [esp + 0x14], ebp
mov dword [esp + 0x18], ebp
mov dword [esp + 0x1c], ebp
jmp 0x401c45
mov ebp, dword [esp + 0x28]
cmp ebp, dword [esp + 0x24]
jne 0x401cd8
mov edx, dword [esp + 0x30]
mov eax, dword [esp + 0x34]
mov ecx, edx
add ecx, 0x10000
mov ebp, 0
adc eax, ebp
mov dword [esp + 0x24], 0x10000
cmp eax, dword [esp + 0x2005c]
jb 0x401c91
ja 0x401c82
cmp ecx, dword [esp + 0x20058]
jbe 0x401c91
mov eax, dword [esp + 0x20058]
sub eax, edx
mov dword [esp + 0x24], eax
je 0x401cd8
mov eax, dword [esp + 0x24]
push ebp
lea edx, [esp + 0x24]
push edx
mov edx, dword [esp + 0x2005c]
push eax
mov eax, dword [edx]
lea ecx, [esp + 0x54]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
neg eax
sbb eax, eax
inc eax
cmp eax, ebp
jne 0x401f2b
mov eax, dword [esp + 0x20]
add dword [esp + 0x30], eax
push eax
lea ecx, [esp + 0x4c]
adc dword [esp + 0x38], ebp
push ecx
call fcn.00401ba0
add esp, 8
mov edx, dword [esp + 0x24]
sub edx, ebp
xor eax, eax
mov ecx, 0x10000
mov dword [esp + 0x3c], edx
mov dword [esp + 0x2c], ecx
cmp byte [esp + 0x13], al
je 0x401d17
cmp dword [esp + 0x20064], eax
ja 0x401d17
jb 0x401d07
cmp dword [esp + 0x20060], ecx
jae 0x401d17
mov eax, dword [esp + 0x20060]
mov dword [esp + 0x2c], eax
mov eax, 1
lea ecx, [esp + 0x44]
push ecx
push eax
lea edx, [esp + 0x44]
push edx
lea eax, [esp + ebp + 0x54]
push eax
mov eax, dword [esp + 0x2005c]
lea ecx, [esp + 0x3c]
push ecx
lea edx, [esp + 0x1005c]
push edx
push eax
call fcn.00403780
add ebp, dword [esp + 0x58]
mov dword [esp + 0x5c], eax
mov eax, dword [esp + 0x48]
add esp, 0x1c
sub dword [esp + 0x20060], eax
mov dword [esp + 0x28], ebp
mov ebp, eax
sbb dword [esp + 0x20064], 0
mov dword [esp + 0x38], ebp
lea esp, [esp]
mov ecx, dword [esp + 0x14]
or ecx, dword [esp + 0x18]
jne 0x401e12
mov edx, dword [esp + 0x20050]
push edx
call fcn.00401ad0
add esp, 4
test al, al
jne 0x401f26
mov ecx, dword [ebx]
movzx eax, byte [ecx]
cdq
mov esi, eax
inc ecx
mov dword [ebx], ecx
movzx eax, byte [ecx]
mov edi, edx
cdq
shld edx, eax, 8
shl eax, 8
add esi, eax
adc edi, edx
inc ecx
mov dword [ebx], ecx
movzx eax, byte [ecx]
cdq
shld edx, eax, 0x10
shl eax, 0x10
add esi, eax
adc edi, edx
inc ecx
mov dword [ebx], ecx
movzx eax, byte [ecx]
cdq
shld edx, eax, 0x18
shl eax, 0x18
add esi, eax
adc edi, edx
inc ecx
mov dword [ebx], ecx
movzx eax, byte [ecx]
cdq
add esi, 0
adc edi, eax
inc ecx
mov dword [ebx], ecx
movzx eax, byte [ecx]
cdq
shl eax, 8
add esi, 0
adc edi, eax
inc ecx
mov dword [ebx], ecx
movzx eax, byte [ecx]
cdq
shl eax, 0x10
add esi, 0
adc edi, eax
inc ecx
mov dword [ebx], ecx
movzx eax, byte [ecx]
cdq
shl eax, 0x18
add esi, 0
adc edi, eax
inc ecx
mov dword [ebx], ecx
xor eax, eax
mov ecx, ebp
add ecx, dword [esp + 0x14]
adc eax, dword [esp + 0x18]
cmp eax, edi
jb 0x401e8b
ja 0x401e28
cmp ecx, esi
jbe 0x401e8b
mov ecx, dword [esp + 0x1c]
push 0
mov ebp, esi
sub ebp, dword [esp + 0x18]
lea eax, [esp + 0x24]
push eax
mov eax, dword [esp + 0x20058]
push ebp
lea edx, [esp + ecx + 0x10054]
mov ecx, dword [eax]
push edx
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x401e60
cmp dword [esp + 0x20], ebp
jne 0x401f26
mov edx, dword [esp + 0x20050]
mov eax, dword [edx]
add dword [esp + 0x1c], ebp
sub dword [esp + 0x38], ebp
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ebp, dword [esp + 0x38]
xor eax, eax
mov dword [esp + 0x14], eax
mov dword [esp + 0x18], eax
jmp 0x401d70
mov edx, dword [esp + 0x1c]
push 0
lea ecx, [esp + 0x24]
push ecx
mov ecx, dword [esp + 0x20058]
push ebp
lea eax, [esp + edx + 0x10054]
mov edx, dword [ecx]
push eax
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x401eb9
cmp dword [esp + 0x20], ebp
jne 0x401f26
add dword [esp + 0x14], ebp
mov eax, dword [esp + 0x40]
mov ecx, 0
adc dword [esp + 0x18], ecx
mov dword [esp + 0x1c], ecx
cmp eax, ecx
jne 0x401f2b
cmp byte [esp + 0x13], cl
je 0x401ee8
mov edx, dword [esp + 0x20060]
or edx, dword [esp + 0x20064]
je 0x401f2b
cmp dword [esp + 0x3c], ecx
jne 0x401c41
cmp dword [esp + 0x2c], ecx
jne 0x401c41
cmp byte [esp + 0x13], cl
jne 0x401f16
cmp dword [esp + 0x44], 1
jne 0x401f16
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x20038
ret
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x20038
ret
mov eax, 9
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x20038
ret