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

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x10
push ebx
push esi
mov esi, dword [sym.imp.KERNEL32.dll_CreateFileA]
push edi
xor ebx, ebx
push ebx
mov edi, 0x80
push edi
push 3
push ebx
push 3
push 0xc0000000
push 0x10015bc
mov byte [0x100945c], bl
call esi
cmp eax, 0xffffffff
mov dword [ebp - 4], eax
jne 0x100661a
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x7d2
push 1
call fcn.010064fd
add esp, 0xc
push 0xffffffffffffffff
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x100670f
push ebx
push edi
push 3
push ebx
push 3
push 0x40000000
push 0x10015b4
call esi
mov esi, eax
cmp esi, 0xffffffff
mov dword [ebp - 0x10], esi
jne 0x1006661
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x7d3
push 1
call fcn.010064fd
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
add esp, 0xc
push dword [ebp - 4]
call esi
push 0xffffffffffffffff
call esi
jmp 0x100670f
mov edi, dword [ebp - 4]
lea eax, [ebp - 0xc]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetConsoleMode]
test eax, eax
jne 0x100668c
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x7d4
push 1
call fcn.010064fd
add esp, 0xc
push edi
jmp 0x1006704
mov eax, dword [ebp - 0xc]
and eax, 0xfffffffb
push eax
push edi
call dword [sym.imp.KERNEL32.dll_SetConsoleMode]
test eax, eax
jne 0x10066ac
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x7d5
jmp 0x100667f
mov edi, dword [ebp + 8]
mov eax, edi
lea ecx, [eax + 1]
mov dl, byte [eax]
inc eax
cmp dl, bl
jne 0x10066b4
sub eax, ecx
push eax
push edi
push edi
mov dword [ebp - 8], eax
call dword [sym.imp.USER32.dll_CharToOemBuffA]
push ebx
lea eax, [ebp - 8]
push eax
push dword [ebp - 8]
push edi
mov edi, dword [sym.imp.KERNEL32.dll_WriteFile]
push esi
call edi
test eax, eax
jne 0x1006719
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x7d6
push 1
call fcn.010064fd
add esp, 0xc
push dword [ebp - 0xc]
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_SetConsoleMode]
push dword [ebp - 4]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call edi
push esi
call edi
mov eax, 0x100945c
jmp 0x10067bc
push ebx
lea eax, [ebp - 8]
push eax
push 0x20
mov esi, 0x100945c
push esi
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x1006749
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x7d7
push 1
call fcn.010064fd
add esp, 0xc
push dword [ebp - 8]
push esi
push esi
call dword [sym.imp.USER32.dll_OemToCharBuffA]
mov eax, dword [ebp - 8]
dec eax
cmp eax, ebx
jl 0x1006773
lea ecx, [eax + 0x100945c]
mov dl, byte [ecx]
cmp dl, 0xa
je 0x100676e
cmp dl, 0xd
jne 0x1006770
mov byte [ecx], bl
dec eax
jns 0x100675c
push dword [ebp - 0xc]
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_SetConsoleMode]
test eax, eax
jne 0x1006799
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x7d8
push 1
call fcn.010064fd
add esp, 0xc
push ebx
lea eax, [ebp - 8]
push eax
push 1
push 0x10014bc
push dword [ebp - 0x10]
call edi
push dword [ebp - 4]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call edi
push dword [ebp - 0x10]
call edi
mov eax, esi
pop edi
pop esi
pop ebx
leave
ret 4