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

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0xa20
mov eax, dword [0x425124]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
xor eax, eax
mov dword [ebp - 0xa20], edx
lea edi, [ebp - 0x10]
mov dword [ebp - 0xa10], ecx
stosd dword es:[edi], eax
xor ebx, ebx
mov dword [ebp - 0xa0c], ebx
mov dword [ebp - 0xa14], ebx
mov dword [ebp - 0xa1c], ebx
stosd dword es:[edi], eax
mov byte [ebp - 0xa01], bl
mov dword [ebp - 0xa18], ebx
stosw word es:[edi], ax
xor eax, eax
mov edi, 0x1fc
mov word [ebp - 0xa00], ax
push edi
mov word [ebp - 0xa08], ax
lea eax, [ebp - 0x20c]
push ebx
push eax
call sub.msvcrt.dll_memset
push edi
lea eax, [ebp - 0x408]
push ebx
push eax
call sub.msvcrt.dll_memset
push edi
lea eax, [ebp - 0x604]
push ebx
push eax
call sub.msvcrt.dll_memset
push 0x3f8
lea eax, [ebp - 0x9fc]
push ebx
push eax
call sub.msvcrt.dll_memset
mov edx, 0xfe
lea eax, [ebp - 0x20c]
add esp, 0x30
mov esi, ebx
mov ecx, edx
mov byte [eax], bl
inc eax
sub ecx, 1
jne 0x40ef2f
mov ecx, edx
lea eax, [ebp - 0x604]
mov byte [eax], bl
inc eax
sub ecx, 1
jne 0x40ef3f
mov ecx, edx
lea eax, [ebp - 0x408]
mov byte [eax], bl
inc eax
sub ecx, 1
jne 0x40ef4f
mov ecx, edi
lea eax, [ebp - 0x9fc]
mov byte [eax], bl
inc eax
sub ecx, 1
jne 0x40ef5f
cmp dword [ebp - 0xa10], ebx
je 0x40f3d6
push 0xfffffffffffffff6
call dword [sym.imp.api_ms_win_core_processenvironment_l1_1_0.dll_GetStdHandle]
mov edi, eax
cmp edi, 0xffffffff
je 0x40f3bd
push edi
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_GetFileType]
and eax, 0xffff7fff
cmp eax, 2
je 0x40efa3
mov dword [ebp - 0xa1c], 1
jmp 0x40efca
lea eax, [ebp - 0xa14]
push eax
push edi
call dword [sym.imp.api_ms_win_core_console_l1_1_0.dll_GetConsoleMode]
test eax, eax
je 0x40f3bd
push 1
push edi
call dword [sym.imp.api_ms_win_core_console_l1_1_0.dll_SetConsoleMode]
test eax, eax
je 0x40f3bd
mov ecx, dword [ebp - 0xa10]
mov edx, 0x40229c
push ebx
push 1
call fcn.0041bd0c
test eax, eax
jne 0x40efed
mov ecx, 0xfd
call fcn.0041b2d7
jmp 0x40f018
push dword [ebp - 0xa10]
mov ecx, 0xfe
call fcn.0041b2d7
push eax
lea eax, [ebp - 0x9fc]
push 0x1fc
push eax
call fcn.0040719d
add esp, 0x10
lea eax, [ebp - 0x9fc]
push 1
mov dword [ebp - 0xa10], eax
call fcn.004208bb
mov edx, dword [ebp - 0xa10]
pop ecx
mov ecx, eax
call fcn.0041bd93
cmp dword [ebp - 0xa1c], 1
jne 0x40f127
push ebx
lea eax, [ebp - 0xa0c]
push eax
push 1
lea eax, [ebp - 0xa01]
push eax
push edi
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_ReadFile]
test eax, eax
je 0x40f3bd
cmp dword [ebp - 0xa0c], ebx
je 0x40f2ed
push 0xd
pop eax
cmp word [ebp - 0xa00], ax
je 0x40f2ed
cmp word [ebp - 0xa00], 0xa
je 0x40f2ed
cmp word [ebp - 0xa00], 9
je 0x40f2ed
mov al, byte [ebp - 0xa01]
lea edx, [ebp - 0x20c]
mov byte [ebp - 0x10], al
lea ecx, [ebp - 0x10]
lea eax, [ebp - 0xa0c]
mov dword [ebp - 0xa0c], 0xfe
push eax
call fcn.0041c10a
mov ax, word [ebp - 0x20c]
push ebx
mov word [ebp - 0xa00], ax
lea eax, [ebp - 0xa0c]
push eax
push 1
lea eax, [ebp - 0xa00]
push eax
push 0xfffffffffffffff5
call dword [sym.imp.api_ms_win_core_processenvironment_l1_1_0.dll_GetStdHandle]
push eax
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_WriteFile]
test eax, eax
je 0x40f3bd
mov ax, word [ebp - 0xa00]
mov word [ebp - 0xa08], ax
movzx eax, ax
push eax
push 0x402290
lea eax, [ebp - 0x408]
push 0xfe
push eax
call fcn.0040719d
add esp, 0x10
inc esi
jmp 0x40f040
push ebx
lea eax, [ebp - 0xa0c]
push eax
push 1
lea eax, [ebp - 0xa00]
push eax
push edi
call dword [sym.imp.api_ms_win_core_console_l1_1_0.dll_ReadConsoleW]
test eax, eax
je 0x40f3a7
cmp dword [ebp - 0xa0c], ebx
je 0x40f127
mov ax, word [ebp - 0xa00]
push 0xd
pop ecx
cmp ax, cx
je 0x40f2ed
push 8
pop ecx
mov word [ebp - 0xa08], ax
cmp ax, cx
je 0x40f1de
movzx eax, ax
push eax
push 0x402290
lea eax, [ebp - 0x604]
push 0xfe
push eax
call fcn.0040719d
add esp, 0x10
lea edx, [ebp - 0x604]
lea ecx, [ebp - 0x408]
push 0xfe
call fcn.0041bcc8
push 8
pop eax
cmp word [ebp - 0xa08], ax
je 0x40f1e1
push ebx
lea eax, [ebp - 0xa0c]
push eax
push 1
lea eax, [ebp - 0xa08]
push eax
push 0xfffffffffffffff5
call dword [sym.imp.api_ms_win_core_processenvironment_l1_1_0.dll_GetStdHandle]
push eax
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_WriteFile]
test eax, eax
je 0x40f3bd
inc esi
jmp 0x40f127
push 8
pop eax
test esi, esi
je 0x40f127
push eax
push 0x402290
lea eax, [ebp - 0x20c]
push 0xfe
push eax
call fcn.0040719d
add esp, 0x10
lea eax, [ebp - 0xa18]
push ebx
push eax
push 1
lea eax, [ebp - 0x20c]
push eax
push 0xfffffffffffffff5
call dword [sym.imp.api_ms_win_core_processenvironment_l1_1_0.dll_GetStdHandle]
push eax
call dword [sym.imp.api_ms_win_core_console_l1_1_0.dll_WriteConsoleW]
test eax, eax
je 0x40f3bd
push ebx
push 0x402290
lea eax, [ebp - 0x20c]
push 0xfe
push eax
call fcn.0040719d
add esp, 0x10
lea eax, [ebp - 0xa18]
push ebx
push eax
push 1
lea eax, [ebp - 0x20c]
push eax
push 0xfffffffffffffff5
call dword [sym.imp.api_ms_win_core_processenvironment_l1_1_0.dll_GetStdHandle]
push eax
call dword [sym.imp.api_ms_win_core_console_l1_1_0.dll_WriteConsoleW]
test eax, eax
je 0x40f3bd
push 8
pop eax
push eax
push 0x402290
lea eax, [ebp - 0x20c]
push 0xfe
push eax
call fcn.0040719d
add esp, 0x10
lea eax, [ebp - 0xa18]
push ebx
push eax
push 1
lea eax, [ebp - 0x20c]
push eax
push 0xfffffffffffffff5
call dword [sym.imp.api_ms_win_core_processenvironment_l1_1_0.dll_GetStdHandle]
push eax
call dword [sym.imp.api_ms_win_core_console_l1_1_0.dll_WriteConsoleW]
test eax, eax
je 0x40f3bd
lea ecx, [ebp - 0x408]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
cmp ax, bx
jne 0x40f2bb
sub ecx, edx
sar ecx, 1
lea ecx, [ecx*2 - 2]
cmp ecx, 0x1fc
jae 0x40f3e8
xor eax, eax
dec esi
mov word [ebp + ecx - 0x408], ax
jmp 0x40f127
push 1
call fcn.004208bb
pop ecx
mov edx, 0x40228c
mov ecx, eax
call fcn.0041bd93
cmp esi, 1
jne 0x40f370
push ebx
push esi
mov ecx, 0xbb
call fcn.0041b2d7
mov edx, eax
lea ecx, [ebp - 0x408]
call fcn.0041bd0c
test eax, eax
je 0x40f35f
push ebx
xor ebx, ebx
mov ecx, 0xbc
inc ebx
push ebx
call fcn.0041b2d7
mov edx, eax
lea ecx, [ebp - 0x408]
call fcn.0041bd0c
test eax, eax
jne 0x40f373
mov ecx, 0x226
call fcn.0041b2d7
push ebx
mov esi, eax
call fcn.004208bb
pop ecx
mov edx, esi
mov ecx, eax
call fcn.0041bd93
push dword [ebp - 0xa14]
push edi
call dword [sym.imp.api_ms_win_core_console_l1_1_0.dll_SetConsoleMode]
mov eax, ebx
jmp 0x40f3d9
xor ebx, ebx
inc ebx
mov ecx, 0x92
call fcn.0041b2d7
push 2
mov esi, eax
call fcn.004208bb
pop ecx
mov edx, esi
mov ecx, eax
call fcn.0041bd93
push dword [ebp - 0xa14]
push edi
call dword [sym.imp.api_ms_win_core_console_l1_1_0.dll_SetConsoleMode]
mov ecx, dword [ebp - 0xa20]
mov dword [ecx], ebx
jmp 0x40f36c
call fcn.0041afe7
push dword [ebp - 0xa14]
push edi
call dword [sym.imp.api_ms_win_core_console_l1_1_0.dll_SetConsoleMode]
test eax, eax
jne 0x40f3c2
call fcn.0041afe7
push 2
call fcn.004208bb
pop ecx
mov edx, 0x10001
mov ecx, eax
call fcn.0041b108
xor eax, eax
inc eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004201e0
leave
ret
call fcn.00420328
int3