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

Disassembly:
push ebp
mov ebp, esp
sub esp, 8
call fcn.004013c0
call fcn.00405950
sub esp, 0xc
mov eax, dword [ebp + 8]
push eax
call sub.msvcrt.dll_exit
lea esi, [esi]
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x1c
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x14]
test eax, eax
jle 0x4052bc
xor ebx, ebx
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x18]
mov eax, dword [eax + ebx*4]
push ecx
inc ebx
mov edx, dword [eax + 0xc]
push edx
push 0
mov eax, dword [eax + 8]
push eax
call sub.msvcrt.dll_memset
mov edx, dword [ebp + 8]
add esp, 0x10
mov eax, dword [edx + 0x14]
cmp eax, ebx
jg 0x405295
test eax, eax
je 0x40530e
mov esi, dword [0x422008]
xor eax, eax
test esi, esi
je 0x4052d4
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
sub esp, 0xc
push 0xfffffffffffffff6
call sub.KERNEL32.dll_GetStdHandle
add esp, 0xc
mov edi, eax
cmp eax, 0xffffffff
jne 0x40530e
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
push eax
push 0x21
push 1
push str.Cannot_get_standard_input_handle_n
call sub.msvcrt.dll_fwrite
mov dword [esp], 1
call fcn.00405260
add esp, 0x10
mov edx, dword [ebp + 8]
mov eax, dword [edx + 8]
test eax, eax
jne 0x405475
mov edx, dword [ebp + 8]
mov ecx, dword [edx + 0xc]
test ecx, ecx
je 0x4054ba
sub esp, 0xc
push 0xfffffffffffffff5
call sub.KERNEL32.dll_GetStdHandle
add esp, 0xc
inc eax
je 0x4054ca
mov edx, dword [ebp + 8]
mov eax, dword [edx + 8]
test eax, eax
je 0x405485
mov edx, dword [ebp + 8]
mov eax, dword [edx + 4]
test eax, eax
je 0x405485
push ebx
push ebx
push eax
push 0xd
call fcn.0040be60
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0xc]
add esp, 0x10
test eax, eax
je 0x4054a4
push edx
push edx
push eax
push 0xd
call fcn.0040be60
add esp, 0x10
mov eax, dword [ebp + 8]
mov esi, dword [eax + 0x14]
test esi, esi
je 0x405468
xor esi, esi
jmp 0x4053b0
cmp al, 0xa
je 0x40543f
mov eax, dword [ebp + 8]
inc esi
cmp dword [eax + 0x14], esi
jbe 0x405468
lea esi, [esi]
mov edx, dword [ebp + 8]
mov dword [ebp - 0x14], 0
mov eax, dword [edx + 0x18]
mov ebx, dword [eax + esi*4]
lea eax, [ebp - 0x10]
push ecx
push ecx
push eax
push edi
call sub.KERNEL32.dll_GetConsoleMode
mov eax, dword [ebp - 0x10]
or eax, 3
and eax, 0xfffffffb
push eax
push edi
call sub.KERNEL32.dll_SetConsoleMode
pop eax
mov eax, dword [ebx]
pop edx
push eax
push 0
push str._d_s_n
push 8
call fcn.0040be60
lea edx, [ebp - 0x14]
mov dword [esp], 0
push edx
mov eax, dword [ebx + 0xc]
dec eax
push eax
mov eax, dword [ebx + 8]
push eax
push edi
call sub.KERNEL32.dll_ReadFile
pop eax
mov eax, dword [ebp - 0x10]
push eax
push edi
call sub.KERNEL32.dll_SetConsoleMode
mov eax, dword [ebx + 0xc]
pop edx
cmp eax, dword [ebp - 0x14]
pop ecx
jae 0x405422
dec eax
mov dword [ebp - 0x14], eax
mov edx, dword [ebp - 0x14]
mov ecx, dword [ebx + 8]
lea eax, [edx - 1]
mov byte [ecx + edx], 0
mov dword [ebp - 0x14], eax
lea ebx, [ecx + eax]
mov al, byte [ebx]
cmp al, 0xd
jne 0x405394
lea eax, [edx - 2]
lea edx, [ecx + eax]
mov byte [ebx], 0
mov dword [ebp - 0x14], eax
mov cl, byte [edx]
mov ebx, edx
dec eax
dec edx
cmp cl, 0xd
je 0x405445
cmp cl, 0xa
je 0x405445
mov eax, dword [ebp + 8]
inc esi
cmp dword [eax + 0x14], esi
ja 0x4053b0
lea esp, [ebp - 0xc]
mov eax, 1
pop ebx
pop esi
pop edi
pop ebp
ret
mov ebx, dword [edx + 4]
test ebx, ebx
jne 0x40532a
jmp 0x40531c
push ecx
push ecx
push 0x41cc87
push 0xd
call fcn.0040be60
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0xc]
add esp, 0x10
test eax, eax
jne 0x405375
push ebx
push ebx
push 0x41cc87
push 0xd
call fcn.0040be60
add esp, 0x10
jmp 0x405382
mov esi, dword [edx + 0x14]
test esi, esi
je 0x405344
jmp 0x40532a
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
push eax
push 0x22
push 1
push str.Cannot_get_standard_output_handle_n
call sub.msvcrt.dll_fwrite
mov dword [esp], 1
call fcn.00405260
mov edx, dword [ebp + 8]
add esp, 0x10
mov eax, dword [edx + 8]
jmp 0x405344