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

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x3c
mov ebx, dword [sym.imp.msvcrt.dll__errno]
call ebx
mov dword [eax], 0xdeadbeef
mov dword [esp], 0
call dword [sym.imp.msvcrt.dll__get_osfhandle]
mov dword [esp + 4], 0x698
mov dword [esp], 0x45a2c0
mov esi, eax
call fcn.0044c860
xor eax, eax
cmp esi, 0xfffffffe
mov dword [esp + 8], esi
sete al
mov dword [esp + 4], str.handle___p_n
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp + 4], 0x699
mov dword [esp], 0x45a2c0
call fcn.0044c860
call ebx
mov esi, dword [eax]
call ebx
mov dword [esp + 4], 0x45a2ee
mov dword [esp + 8], esi
cmp dword [eax], 0xdeadbeef
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
mov eax, dword [0x46d7b8]
mov esi, dword [eax]
mov dword [esp + 4], 0x69c
mov dword [esp], 0x45a2c0
call fcn.0044c860
mov eax, dword [esi]
mov dword [esp + 4], str.info__handle___p_n
cmp eax, 0xfffffffe
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp + 4], 0x69d
mov dword [esp], 0x45a2c0
call fcn.0044c860
movzx edx, byte [esi + 4]
xor eax, eax
mov dword [esp + 4], str.info__wxflag___x_n
cmp dl, 0xc1
mov dword [esp + 8], edx
sete al
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp + 4], 0x69f
mov dword [esp], 0x45a2c0
call fcn.0044c860
mov esi, dword [0x44e58c]
mov dword [esp], 0
call esi
mov edi, dword [eax + 0x10]
mov dword [esp], 0
call esi
mov dword [esp + 4], str.stdin___file___d_n
mov dword [esp + 8], edi
cmp dword [eax + 0x10], 0xfffffffe
lea edi, [ebp - 0x19]
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
call ebx
mov dword [eax], 0xdeadbeef
mov dword [esp], 0
call esi
mov dword [esp], edi
mov dword [esp + 0xc], eax
mov dword [esp + 8], 1
mov dword [esp + 4], 1
call dword [sym.imp.msvcrt.dll_fread]
mov dword [esp + 4], 0x6a3
mov dword [esp], 0x45a2c0
mov dword [ebp - 0x2c], eax
call fcn.0044c860
mov eax, dword [ebp - 0x2c]
mov dword [esp + 4], str.fread_stdin__returned__d_n
test eax, eax
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp + 4], 0x6a4
mov dword [esp], 0x45a2c0
call fcn.0044c860
call ebx
mov edx, dword [eax]
mov dword [ebp - 0x2c], edx
call ebx
mov edx, dword [ebp - 0x2c]
mov dword [esp + 4], 0x45a2ee
mov dword [esp + 8], edx
cmp dword [eax], 9
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
call ebx
mov edx, dword [sym.imp.msvcrt.dll__read]
mov dword [eax], 0xdeadbeef
mov dword [ebp - 0x30], edx
mov dword [esp + 4], edi
mov dword [esp + 8], 1
mov dword [esp], 0xfffffffe
call edx
mov dword [esp + 4], 0x6a8
mov dword [esp], 0x45a2c0
mov dword [ebp - 0x2c], eax
call fcn.0044c860
mov eax, dword [ebp - 0x2c]
mov dword [esp + 4], str.read__2__returned__d_n
cmp eax, 0xffffffff
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp + 4], 0x6a9
mov dword [esp], 0x45a2c0
call fcn.0044c860
call ebx
mov ecx, dword [eax]
mov dword [ebp - 0x2c], ecx
call ebx
mov ecx, dword [ebp - 0x2c]
mov dword [esp + 4], 0x45a2ee
mov dword [esp + 8], ecx
cmp dword [eax], 9
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
call ebx
mov edx, dword [ebp - 0x30]
mov dword [eax], 0xdeadbeef
mov dword [esp + 4], edi
mov dword [esp + 8], 1
mov dword [esp], 0
call edx
mov dword [esp + 4], 0x6ad
mov dword [esp], 0x45a2c0
mov dword [ebp - 0x2c], eax
call fcn.0044c860
mov eax, dword [ebp - 0x2c]
mov dword [esp + 4], str.read_STDIN_FILENO__returned__d_n
cmp eax, 0xffffffff
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp + 4], 0x6ae
mov dword [esp], 0x45a2c0
call fcn.0044c860
call ebx
mov edx, dword [eax]
mov dword [ebp - 0x2c], edx
call ebx
mov edx, dword [ebp - 0x2c]
mov dword [esp + 4], 0x45a2ee
mov dword [esp + 8], edx
cmp dword [eax], 9
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
call ebx
mov dword [eax], 0xdeadbeef
mov dword [esp], 0
call esi
mov dword [esp], 0x61
mov dword [esp + 4], eax
call dword [sym.imp.msvcrt.dll__flsbuf]
mov dword [esp + 4], 0x6b2
mov dword [esp], 0x45a2c0
mov dword [ebp - 0x2c], eax
call fcn.0044c860
mov eax, dword [ebp - 0x2c]
mov dword [esp + 4], str._flsbuf_stdin__returned__d_n
cmp eax, 0xffffffff
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp + 4], 0x6b3
mov dword [esp], 0x45a2c0
call fcn.0044c860
call ebx
mov edx, dword [eax]
mov dword [ebp - 0x2c], edx
call ebx
mov edx, dword [ebp - 0x2c]
mov dword [esp + 4], 0x45a2ee
mov dword [esp + 8], edx
cmp dword [eax], 9
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
call ebx
mov dword [eax], 0xdeadbeef
mov dword [esp], 0
call esi
mov dword [esp], edi
mov dword [esp + 0xc], eax
mov dword [esp + 8], 1
mov dword [esp + 4], 1
call dword [sym.imp.msvcrt.dll_fwrite]
mov dword [esp + 4], 0x6b7
mov dword [esp], 0x45a2c0
mov dword [ebp - 0x2c], eax
call fcn.0044c860
mov eax, dword [ebp - 0x2c]
mov dword [esp + 4], str.fwrite_stdin__returned__d_n
test eax, eax
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp + 4], 0x6b8
mov dword [esp], 0x45a2c0
call fcn.0044c860
call ebx
mov edx, dword [eax]
mov dword [ebp - 0x2c], edx
call ebx
mov edx, dword [ebp - 0x2c]
mov dword [esp + 4], 0x45a2ee
mov dword [esp + 8], edx
cmp dword [eax], 9
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
call ebx
mov edx, dword [sym.imp.msvcrt.dll__write]
mov dword [eax], 0xdeadbeef
mov dword [ebp - 0x30], edx
mov dword [esp + 4], edi
mov dword [esp + 8], 1
mov dword [esp], 0xfffffffe
call edx
mov dword [esp + 4], 0x6bc
mov dword [esp], 0x45a2c0
mov dword [ebp - 0x2c], eax
call fcn.0044c860
mov eax, dword [ebp - 0x2c]
mov dword [esp + 4], str.write__2__returned__d_n
cmp eax, 0xffffffff
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp + 4], 0x6bd
mov dword [esp], 0x45a2c0
call fcn.0044c860
call ebx
mov ecx, dword [eax]
mov dword [ebp - 0x2c], ecx
call ebx
mov ecx, dword [ebp - 0x2c]
mov dword [esp + 4], 0x45a2ee
mov dword [esp + 8], ecx
cmp dword [eax], 9
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
call ebx
mov edx, dword [ebp - 0x30]
mov dword [eax], 0xdeadbeef
mov dword [esp + 4], edi
mov dword [esp + 8], 1
mov dword [esp], 0
call edx
mov dword [esp + 4], 0x6c1
mov dword [esp], 0x45a2c0
mov edi, eax
call fcn.0044c860
xor eax, eax
cmp edi, 0xffffffff
mov dword [esp + 8], edi
sete al
mov dword [esp + 4], str.write_STDIN_FILENO__returned__d_n
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp + 4], 0x6c2
mov dword [esp], 0x45a2c0
call fcn.0044c860
call ebx
mov edi, dword [eax]
call ebx
mov dword [esp + 4], 0x45a2ee
mov dword [esp + 8], edi
cmp dword [eax], 9
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
call ebx
mov dword [eax], 0xdeadbeef
mov dword [esp], 0
call esi
mov dword [esp], eax
call dword [sym.imp.msvcrt.dll_fclose]
mov dword [esp + 4], 0x6c6
mov dword [esp], 0x45a2c0
mov esi, eax
call fcn.0044c860
xor eax, eax
cmp esi, 0xffffffff
mov dword [esp + 8], esi
sete al
mov dword [esp + 4], str.fclose_stdin__returned__d_n
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp + 4], 0x6c7
mov dword [esp], 0x45a2c0
call fcn.0044c860
call ebx
mov esi, dword [eax]
call ebx
mov dword [esp + 4], 0x45a2ee
mov dword [esp + 8], esi
cmp dword [eax], 9
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
call ebx
mov esi, dword [sym.imp.msvcrt.dll__close]
mov dword [eax], 0xdeadbeef
mov dword [esp], 0xfffffffe
call esi
mov dword [esp + 4], 0x6cb
mov dword [esp], 0x45a2c0
mov edi, eax
call fcn.0044c860
xor eax, eax
cmp edi, 0xffffffff
mov dword [esp + 8], edi
sete al
mov dword [esp + 4], str.close__2__returned__d_n
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp + 4], 0x6cc
mov dword [esp], 0x45a2c0
call fcn.0044c860
call ebx
mov edi, dword [eax]
call ebx
mov dword [esp + 4], 0x45a2ee
mov dword [esp + 8], edi
cmp dword [eax], 9
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
call ebx
mov dword [eax], 0xdeadbeef
mov dword [esp], 0
call esi
mov dword [esp + 4], 0x6d0
mov dword [esp], 0x45a2c0
mov esi, eax
call fcn.0044c860
lea eax, [esi + 1]
mov dword [esp + 8], esi
cmp eax, 1
mov dword [esp + 4], str.close_STDIN_FILENO__returned__d_n
setbe al
movzx eax, al
mov dword [esp], eax
call fcn.0044cad0
mov dword [esp + 4], 0x6d1
mov dword [esp], 0x45a2c0
call fcn.0044c860
call ebx
mov edi, dword [eax]
cmp esi, 0xffffffff
je 0x40aa90
xor eax, eax
test esi, esi
je 0x40aa80
mov dword [esp + 8], edi
mov dword [esp + 4], 0x45a2ee
mov dword [esp], eax
call fcn.0044cad0
add esp, 0x3c
pop ebx
pop esi
pop edi
pop ebp
ret
call ebx
cmp dword [eax], 0xdeadbeef
sete al
movzx eax, al
jmp 0x40aa64
call ebx
cmp dword [eax], 9
sete al
movzx eax, al
jmp 0x40aa64