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

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x14
mov ebx, dword [esp + 0x2c]
mov eax, dword [0x4c0018]
xor eax, esp
mov dword [esp + 0x10], eax
mov eax, dword [ebx + 0x14]
test eax, eax
jle 0x403dcd
xor esi, esi
nop
mov eax, dword [ebx + 0x1c]
push 0x4b44a6
push dword [eax + esi*4]
call fcn.00417bf0
add esp, 8
add esi, 1
mov eax, dword [ebx + 0x14]
cmp esi, eax
jl 0x403db0
test eax, eax
je 0x403dfe
cmp byte [0x4c0c58], 0
je 0x403e05
push str.Cannot_answer_interactive_prompts_in_batch_mode
mov esi, dword [esp + 0x2c]
push esi
call fcn.00416ea0
add esp, 8
mov ecx, dword [esp + 0x10]
xor ecx, esp
call fcn.0046c560
mov eax, esi
jmp 0x4040a0
mov edi, 0xffffffff
jmp 0x403e18
push 0xfffffffffffffff6
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov edi, eax
cmp eax, 0xffffffff
je 0x4040d2
mov al, byte [ebx + 8]
test al, al
je 0x403e25
cmp dword [ebx + 4], 0
jne 0x403e35
cmp dword [ebx + 0xc], 0
jne 0x403e35
cmp dword [ebx + 0x14], 0
je 0x4040a8
push 0xfffffffffffffff5
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov dword [esp], eax
cmp eax, 0xffffffff
je 0x4040bc
mov al, byte [ebx + 8]
test al, al
je 0x403ea4
mov eax, dword [esp + 0x2c]
mov esi, dword [eax + 4]
test esi, esi
je 0x403ea4
push esi
call fcn.00480740
add esp, 4
mov ebp, eax
lea ebx, [esp + 0xc]
push 0
push ebx
push eax
push esi
push dword [esp + 0x10]
call dword [sym.imp.KERNEL32.dll_WriteFile]
push 0
push 1
push 0x4b4422
push ebp
push esi
call fcn.00417d90
add esp, 0x14
test al, al
jne 0x403ea4
push 0
push ebx
push 1
push 0x4b4422
push dword [esp + 0x10]
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [esp + 0x2c]
mov esi, dword [eax + 0xc]
test esi, esi
je 0x403ef8
push esi
call fcn.00480740
add esp, 4
mov ebp, eax
lea ebx, [esp + 0xc]
push 0
push ebx
push eax
push esi
push dword [esp + 0x10]
call dword [sym.imp.KERNEL32.dll_WriteFile]
push 0
push 1
push 0x4b4422
push ebp
push esi
call fcn.00417d90
add esp, 0x14
test al, al
jne 0x403ef8
push 0
push ebx
push 1
push 0x4b4422
push dword [esp + 0x10]
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [esp + 0x2c]
cmp dword [eax + 0x14], 0
je 0x404080
xor ecx, ecx
nop
nop
nop
nop
nop
nop
nop
nop
mov eax, dword [eax + 0x1c]
mov dword [esp + 4], ecx
mov esi, dword [eax + ecx*4]
lea eax, [esp + 8]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetConsoleMode]
mov eax, dword [esp + 8]
mov ecx, eax
or ecx, 7
and eax, 0xfffffff8
or eax, 3
cmp byte [esi + 4], 0
cmovne eax, ecx
push eax
push edi
call dword [sym.imp.KERNEL32.dll_SetConsoleMode]
mov ebx, dword [esi]
push ebx
call fcn.00480740
add esp, 4
push 0
mov ebp, edi
lea edi, [esp + 0x10]
push edi
push eax
push ebx
push dword [esp + 0x10]
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [esi + 8]
mov ebx, dword [eax + 8]
push 0x4000
push eax
call fcn.00413750
add esp, 8
mov dword [esp + 0xc], 0
push 0
push edi
mov edi, ebp
mov ebp, dword [sym.imp.KERNEL32.dll_ReadFile]
nop
nop
nop
nop
nop
push 0x4000
push eax
push edi
call ebp
test eax, eax
je 0x403ff0
mov eax, dword [esp + 0xc]
test eax, eax
je 0x404010
add eax, ebx
push eax
push dword [esi + 8]
call fcn.00413790
add esp, 8
push 0xa
push dword [esi + 8]
call fcn.00413800
add esp, 8
test al, al
jne 0x404030
mov eax, dword [esi + 8]
mov ebx, dword [eax + 8]
push 0x4000
push eax
call fcn.00413750
add esp, 8
mov dword [esp + 0xc], 0
push 0
lea ecx, [esp + 0x10]
push ecx
jmp 0x403f90
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Error_reading_from_console
push dword [esp + 0x30]
call fcn.00417fb0
add esp, 0xc
xor ebx, ebx
jmp 0x40403f
mov eax, dword [esp + 0x28]
mov dword [eax], 1
mov dword [eax + 8], 0
xor ebx, ebx
jmp 0x40403f
push 0xd
push dword [esi + 8]
call fcn.00413800
add esp, 8
mov bl, 1
push dword [esp + 8]
push edi
call dword [sym.imp.KERNEL32.dll_SetConsoleMode]
cmp byte [esi + 4], 0
jne 0x404068
push 0
lea eax, [esp + 0x10]
push eax
push 2
push 0x4b4421
push dword [esp + 0x10]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test bl, bl
je 0x404091
mov ecx, dword [esp + 4]
add ecx, 1
mov eax, dword [esp + 0x2c]
cmp ecx, dword [eax + 0x14]
jb 0x403f10
mov eax, dword [esp + 0x28]
mov dword [eax], 3
mov dword [eax + 8], 0
mov ecx, dword [esp + 0x10]
xor ecx, esp
call fcn.0046c560
mov eax, dword [esp + 0x28]
add esp, 0x14
pop esi
pop edi
pop ebx
pop ebp
mov dword [esp], 0xffffffff
test al, al
jne 0x403e50
jmp 0x403ea4
push 2
call fcn.0046fa27
add esp, 4
push eax
push 1
push 0x22
push str.Cannot_get_standard_output_handle_n
jmp 0x4040e6
push 2
call fcn.0046fa27
add esp, 4
push eax
push 1
push 0x21
push str.Cannot_get_standard_input_handle_n
call fcn.0047eb82
add esp, 0x10
push 1
call fcn.004035b0
int3