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

Disassembly:
push ebp
lea ebp, [esp - 0x594]
sub esp, 0x614
mov eax, dword [0x1008008]
push ebx
mov dword [ebp + 0x590], eax
xor eax, eax
push esi
mov esi, 0xfe
mov dword [ebp - 0x6c], eax
mov dword [ebp - 0x80], eax
mov dword [ebp - 0x74], eax
mov dword [ebp - 0x70], eax
mov dword [ebp - 0x78], eax
mov dword [ebp - 0x68], eax
push edi
lea eax, [ebp + 0x198]
mov ecx, esi
mov byte [eax], 0
inc eax
dec ecx
jne 0x1001e16
lea eax, [ebp - 0x64]
mov ecx, esi
mov byte [eax], 0
inc eax
dec ecx
jne 0x1001e22
lea eax, [ebp + 0x394]
mov ecx, esi
mov byte [eax], 0
inc eax
dec ecx
jne 0x1001e31
mov ebx, dword [sym.imp.KERNEL32.dll_GetStdHandle]
push 0xfffffffffffffff6
call ebx
mov edi, eax
cmp edi, 0xffffffff
mov dword [ebp - 0x7c], edi
jne 0x1001e59
call fcn.01002d77
xor eax, eax
inc eax
jmp 0x1002134
push 0x30
call dword [sym.imp.USER32.dll_MessageBeep]
push 0xcc
call fcn.01004b9e
push eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x20
push eax
call fcn.01004834
cmp edi, 0xf
je 0x1001e88
cmp edi, 3
jne 0x1001fd4
lea eax, [ebp - 0x80]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetConsoleMode]
test eax, eax
je 0x1001e4c
push 1
push edi
call dword [sym.imp.KERNEL32.dll_SetConsoleMode]
test eax, eax
je 0x1001e4c
mov edi, 0x100131c
push 0
lea eax, [ebp - 0x6c]
push eax
push 1
lea eax, [ebp - 0x70]
push eax
push dword [ebp - 0x7c]
call dword [sym.imp.KERNEL32.dll_ReadConsoleW]
test eax, eax
je 0x1002071
cmp dword [ebp - 0x6c], 0
je 0x1001ea9
mov eax, dword [ebp - 0x70]
cmp ax, 0xd
je 0x100208f
cmp ax, 8
mov dword [ebp - 0x74], eax
je 0x1001f10
movzx eax, ax
push eax
push edi
lea eax, [ebp - 0x64]
push esi
push eax
call fcn.010036c1
add esp, 0x10
push esi
lea eax, [ebp - 0x64]
push eax
lea eax, [ebp + 0x394]
push eax
call fcn.01003b09
cmp word [ebp - 0x74], 8
jne 0x100204a
cmp dword [ebp - 0x68], 0
je 0x1001ea9
push 8
push edi
lea eax, [ebp + 0x198]
push esi
push eax
call fcn.010036c1
add esp, 0x10
push 0
lea eax, [ebp - 0x78]
push eax
push 1
lea eax, [ebp + 0x198]
push eax
push 0xfffffffffffffff5
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_WriteConsoleW]
test eax, eax
je 0x1001e4c
push 0
push edi
lea eax, [ebp + 0x198]
push esi
push eax
call fcn.010036c1
add esp, 0x10
push 0
lea eax, [ebp - 0x78]
push eax
push 1
lea eax, [ebp + 0x198]
push eax
push 0xfffffffffffffff5
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_WriteConsoleW]
test eax, eax
je 0x1001e4c
push 8
push edi
lea eax, [ebp + 0x198]
push esi
push eax
call fcn.010036c1
add esp, 0x10
push 0
lea eax, [ebp - 0x78]
push eax
push 1
lea eax, [ebp + 0x198]
push eax
push 0xfffffffffffffff5
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_WriteConsoleW]
test eax, eax
je 0x1001e4c
push 0
lea eax, [ebp + 0x394]
push eax
call fcn.01002fa4
and word [ebp + eax*2 + 0x392], 0
dec dword [ebp - 0x68]
jmp 0x1001ea9
mov edi, 0x100131c
push 0
lea eax, [ebp - 0x6c]
push eax
push 1
lea eax, [ebp - 0x70]
push eax
push dword [ebp - 0x7c]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x1001e4c
cmp dword [ebp - 0x6c], 0
je 0x100208f
cmp word [ebp - 0x70], 0xd
je 0x100208f
push 0
lea eax, [ebp - 0x6c]
push eax
push 1
lea eax, [ebp - 0x70]
push eax
push 0xfffffffffffffff5
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x1001e4c
mov eax, dword [ebp - 0x70]
mov dword [ebp - 0x74], eax
movzx eax, ax
push eax
push edi
lea eax, [ebp + 0x394]
push esi
push eax
call fcn.010036c1
add esp, 0x10
inc dword [ebp - 0x68]
jmp 0x1001fd9
push 0
lea eax, [ebp - 0x6c]
push eax
push 1
lea eax, [ebp - 0x74]
push eax
push 0xfffffffffffffff5
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x1001e4c
inc dword [ebp - 0x68]
jmp 0x1001ea9
call fcn.01002d77
push dword [ebp - 0x80]
push dword [ebp - 0x7c]
call dword [sym.imp.KERNEL32.dll_SetConsoleMode]
test eax, eax
jne 0x1001e51
jmp 0x1001e4c
mov eax, dword [sym.imp.msvcrt.dll__iob]
push 0x10012e4
add eax, 0x20
push eax
call fcn.01004834
xor esi, esi
inc esi
cmp dword [ebp - 0x68], esi
jne 0x100210f
push 0
push esi
push 0x107
call fcn.01004b9e
push eax
lea eax, [ebp + 0x394]
push eax
call fcn.01002fbc
test eax, eax
jne 0x10020cc
xor eax, eax
jmp 0x1002134
push 0
push esi
push 0x108
call fcn.01004b9e
push eax
lea eax, [ebp + 0x394]
push eax
call fcn.01002fbc
test eax, eax
jne 0x100210f
push 0xd0
call fcn.01004b9e
push eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x20
push eax
call fcn.01004834
mov dword [0x100801c], 3
jmp 0x10020c8
push 0xcb
call fcn.01004b9e
push eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
push eax
call fcn.01004834
mov dword [0x100801c], 4
mov eax, esi
mov ecx, dword [ebp + 0x590]
pop edi
pop esi
pop ebx
call fcn.01006d7a
add ebp, 0x594
leave
ret