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

Disassembly:
push edi
push esi
push ebx
sub esp, 0x10
mov ebx, dword [0x4110d8]
test ebx, ebx
mov dword [esp + 8], 0
mov dword [esp + 0xc], 0
jne 0x4036c0
mov ecx, dword [0x4110d0]
test ecx, ecx
je 0x403844
nop
mov edi, dword [0x4110dc]
test edi, edi
jne 0x403824
mov ebx, dword [0x4110e4]
test ebx, ebx
je 0x403824
mov edx, dword [0x4110c0]
test edx, edx
jne 0x40371c
mov eax, dword [0x4110d0]
test eax, eax
jne 0x40371c
mov esi, dword [0x4110dc]
test esi, esi
je 0x403703
mov edi, dword [0x4110e4]
test edi, edi
jne 0x40371c
sub esp, 8
push 0x8000
mov ebx, dword [sym.imp.msvcrt.dll__iob]
push dword [ebx + 0x30]
call sub.msvcrt.dll__setmode
add esp, 0x10
cld
mov edi, 0x4421d0
mov esi, str.stdout
mov ecx, 1
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
sub esp, 8
movsb byte es:[edi], byte [esi]
mov dword [0x432030], 0x69647473
push 0x420fa0
mov word [0x432034], 0x6e
mov ecx, dword [sym.imp.msvcrt.dll__iob]
push dword [ecx + 0x10]
call sub.msvcrt.dll__fstati64
add esp, 0x10
test eax, eax
jne 0x4038e4
movzx edi, word [0x420fa6]
and edi, 0xf000
cmp edi, 0x8000
mov edx, 0xffffffff
mov ecx, 0xffffffff
je 0x403a4b
mov esi, dword [0x40e24c]
test esi, esi
mov dword [0x420fe0], edx
mov dword [0x420fe4], ecx
mov dword [0x432164], 0xffffffff
je 0x4037b2
mov ecx, dword [0x4110d0]
test ecx, ecx
je 0x4037d7
mov eax, dword [0x420fc4]
mov dword [esp + 8], eax
mov dword [esp + 0xc], 0
mov edx, dword [esp + 8]
mov ebx, dword [esp + 0xc]
mov dword [0x432160], edx
mov dword [0x432164], ebx
call fcn.0040a2c0
mov edi, dword [0x4110dc]
test edi, edi
mov dword [0x4110e0], 1
mov dword [0x420ff0], 0
jne 0x403a1b
mov ecx, dword [0x4110d0]
test ecx, ecx
je 0x4039ec
mov edx, dword [0x40e244]
mov eax, dword [0x420fd0]
add esp, 0x10
pop ebx
pop esi
pop edi
jmp fcn.00403178
sub esp, 8
push 0x8000
mov ecx, dword [sym.imp.msvcrt.dll__iob]
push dword [ecx + 0x10]
call sub.msvcrt.dll__setmode
add esp, 0x10
jmp 0x4036dc
mov edx, dword [0x4110dc]
sub esp, 0xc
test edx, edx
mov eax, dword [sym.imp.msvcrt.dll__iob]
je 0x403a13
push dword [eax + 0x10]
call sub.msvcrt.dll__isatty
add esp, 0x10
test eax, eax
je 0x4036c0
mov eax, dword [0x4110dc]
sub esp, 0xc
test eax, eax
mov edx, 0x40f4ce
jne 0x403883
mov edx, 0x40f3e1
test eax, eax
push edx
mov edx, str.read_from
jne 0x403892
mov edx, str.written_to
push edx
push dword [0x414740]
mov esi, dword [sym.imp.msvcrt.dll__iob]
push str._s:_compressed_data_not__s_a_terminal._Use__f_to_force__scompression._n
add esi, 0x40
push esi
call sub.msvcrt.dll_fprintf
add esp, 0x1c
push dword [0x414740]
mov eax, dword [sym.imp.msvcrt.dll__iob]
push str.For_help__type:__s__h_n
add eax, 0x40
push eax
call sub.msvcrt.dll_fprintf
mov eax, dword [0x4110e8]
add esp, 0x10
test eax, eax
je 0x403933
lea esi, [esi]
sub esp, 0xc
push 1
call sub.msvcrt.dll_exit
nop
call sub.msvcrt.dll__errno
mov ebx, dword [eax]
push esi
push dword [0x414740]
mov edx, dword [sym.imp.msvcrt.dll__iob]
add edx, 0x40
push 0x40f546
push edx
call sub.msvcrt.dll_fprintf
add esp, 0x10
call sub.msvcrt.dll__errno
sub esp, 0xc
mov dword [eax], ebx
push str.standard_input
call sub.msvcrt.dll_perror
mov eax, dword [0x4110e8]
add esp, 0x10
test eax, eax
mov dword [0x4110b8], 1
jne 0x4038d8
mov eax, dword [0x432140]
test eax, eax
mov dword [0x4110e8], 1
jne 0x403b41
mov eax, dword [0x4110b4]
test eax, eax
je 0x4038d8
sub esp, 0xc
push eax
call sub.msvcrt.dll_free
add esp, 0x10
sub esp, 0xc
push 1
mov dword [0x4110b4], 0
jmp 0x4038dd
mov edx, dword [0x4110dc]
test edx, edx
je 0x403a98
mov eax, dword [0x4622e0]
test eax, eax
jne 0x403a98
mov eax, dword [0x432170]
cmp eax, dword [0x421000]
jne 0x4039c5
cmp eax, 0x8000
jne 0x403a98
sub esp, 0xc
push 1
call fcn.0040a964
add esp, 0x10
inc eax
je 0x403a98
mov dword [0x432170], 0
mov eax, dword [0x420fd0]
call fcn.00402704
test eax, eax
mov dword [0x40e244], eax
js 0x403a0c
mov dword [0x418f50], 0
mov dword [0x418f54], 0
sub esp, 8
mov ebx, dword [sym.imp.msvcrt.dll__iob]
push dword [ebx + 0x30]
push dword [ebx + 0x10]
call dword [0x40e080]
add esp, 0x10
test eax, eax
je 0x403974
add esp, 0x10
pop ebx
pop esi
pop edi
ret
add eax, 0x20
jmp 0x40385a
mov eax, dword [0x420fd0]
call fcn.00402704
test eax, eax
mov dword [0x40e244], eax
jns 0x4037fe
mov esi, dword [0x4110e8]
test esi, esi
mov ebx, dword [0x4110b8]
je 0x403a5c
sub esp, 0xc
push ebx
call sub.msvcrt.dll_exit
mov edx, dword [0x420fb8]
mov ecx, dword [0x420fbc]
jmp 0x403788
mov eax, dword [0x432140]
test eax, eax
mov dword [0x4110e8], 1
jne 0x403b5c
mov eax, dword [0x4110b4]
test eax, eax
je 0x403a42
sub esp, 0xc
push eax
call sub.msvcrt.dll_free
add esp, 0x10
sub esp, 0xc
push ebx
mov dword [0x4110b4], 0
jmp 0x403a46
mov edi, dword [0x4110cc]
test edi, edi
je 0x403a0c
mov esi, dword [0x4110c0]
test esi, esi
jne 0x403b21
mov ebx, dword [0x4110dc]
test ebx, ebx
jne 0x403a0c
mov ebx, dword [sym.imp.msvcrt.dll__iob]
sub esp, 0xc
add ebx, 0x40
mov ecx, dword [0x418f50]
push ebx
sub ecx, dword [0x462360]
mov esi, dword [0x418f54]
mov eax, dword [0x421010]
push dword [0x421014]
sbb esi, dword [0x462364]
mov edi, dword [0x421014]
sub eax, ecx
sbb edi, esi
push dword [0x421010]
push edi
push eax
call fcn.0040acc4
mov edx, dword [sym.imp.msvcrt.dll__iob]
add esp, 0x18
add edx, 0x40
push edx
push 0xa
call sub.msvcrt.dll_fputc
add esp, 0x10
jmp 0x403a0c
mov ecx, dword [sym.imp.msvcrt.dll__iob]
add ecx, 0x40
push ecx
push 4
push 1
push str._OK_n
call sub.msvcrt.dll_fwrite
add esp, 0x10
jmp 0x403a0c
sub esp, 0xc
push eax
call sub.msvcrt.dll_free
add esp, 0x10
mov dword [0x432140], 0
jmp 0x40394a
sub esp, 0xc
push eax
call sub.msvcrt.dll_free
add esp, 0x10
mov dword [0x432140], 0
jmp 0x403a73