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

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x624
mov eax, dword [0x425124]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
xor eax, eax
mov dword [ebp - 0x624], ecx
lea edi, [ebp - 0x10]
xor ebx, ebx
stosd dword es:[edi], eax
mov esi, 0x1fc
push esi
push ebx
mov dword [ebp - 0x620], ebx
stosd dword es:[edi], eax
mov dword [ebp - 0x614], ebx
mov dword [ebp - 0x61c], ebx
mov byte [ebp - 0x609], bl
stosw word es:[edi], ax
xor eax, eax
mov word [ebp - 0x608], ax
mov word [ebp - 0x610], ax
lea eax, [ebp - 0x20c]
push eax
mov dword [ebp - 0x618], ebx
call sub.msvcrt.dll_memset
push esi
lea eax, [ebp - 0x408]
push ebx
push eax
call sub.msvcrt.dll_memset
push esi
lea eax, [ebp - 0x604]
push ebx
push eax
call sub.msvcrt.dll_memset
mov edx, 0xfe
lea eax, [ebp - 0x20c]
add esp, 0x24
mov edi, ebx
mov ecx, edx
mov byte [eax], bl
inc eax
sub ecx, 1
jne 0x40afcc
mov ecx, edx
lea eax, [ebp - 0x604]
mov byte [eax], bl
inc eax
sub ecx, 1
jne 0x40afdc
mov ecx, edx
lea eax, [ebp - 0x408]
mov byte [eax], bl
inc eax
sub ecx, 1
jne 0x40afec
push 0xfffffffffffffff6
call dword [sym.imp.api_ms_win_core_processenvironment_l1_1_0.dll_GetStdHandle]
mov esi, eax
cmp esi, 0xffffffff
je 0x40b221
push esi
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_GetFileType]
and eax, 0xffff7fff
cmp eax, 2
jne 0x40b238
lea eax, [ebp - 0x61c]
push eax
push esi
call dword [sym.imp.api_ms_win_core_console_l1_1_0.dll_GetConsoleMode]
test eax, eax
je 0x40b221
push 1
push esi
call dword [sym.imp.api_ms_win_core_console_l1_1_0.dll_SetConsoleMode]
test eax, eax
je 0x40b221
mov ebx, 0x402290
xor eax, eax
push eax
lea eax, [ebp - 0x614]
push eax
push 1
lea eax, [ebp - 0x608]
push eax
push esi
call dword [sym.imp.api_ms_win_core_console_l1_1_0.dll_ReadConsoleW]
test eax, eax
je 0x40b20b
cmp dword [ebp - 0x614], 0
je 0x40b048
mov ax, word [ebp - 0x608]
push 0xd
pop ecx
cmp ax, cx
je 0x40b321
push 8
pop ecx
mov word [ebp - 0x610], ax
cmp ax, cx
je 0x40b100
movzx eax, ax
push eax
push ebx
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 - 0x610], ax
je 0x40b103
xor eax, eax
push eax
lea eax, [ebp - 0x614]
push eax
push 1
lea eax, [ebp - 0x610]
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 0x40b221
inc edi
jmp 0x40b048
push 8
pop eax
test edi, edi
je 0x40b048
push eax
push ebx
lea eax, [ebp - 0x20c]
push 0xfe
push eax
call fcn.0040719d
add esp, 0x10
xor eax, eax
push eax
lea eax, [ebp - 0x618]
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 0x40b221
xor eax, eax
push eax
push ebx
lea eax, [ebp - 0x20c]
push 0xfe
push eax
call fcn.0040719d
add esp, 0x10
xor eax, eax
push eax
lea eax, [ebp - 0x618]
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 0x40b221
push 8
pop eax
push eax
push ebx
lea eax, [ebp - 0x20c]
push 0xfe
push eax
call fcn.0040719d
add esp, 0x10
xor eax, eax
push eax
lea eax, [ebp - 0x618]
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 0x40b221
lea ecx, [ebp - 0x408]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
cmp ax, word [ebp - 0x620]
jne 0x40b1d5
sub ecx, edx
sar ecx, 1
lea ecx, [ecx*2 - 2]
cmp ecx, 0x1fc
jae 0x40b3c8
xor eax, eax
dec edi
mov word [ebp + ecx - 0x408], ax
jmp 0x40b048
call fcn.0041afe7
push dword [ebp - 0x61c]
push esi
call dword [sym.imp.api_ms_win_core_console_l1_1_0.dll_SetConsoleMode]
test eax, eax
jne 0x40b226
call fcn.0041afe7
xor eax, eax
inc eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004201e0
leave
ret
mov ebx, 0x402290
xor eax, eax
push eax
lea eax, [ebp - 0x614]
push eax
push 1
lea eax, [ebp - 0x609]
push eax
push esi
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_ReadFile]
test eax, eax
je 0x40b221
cmp dword [ebp - 0x614], 0
je 0x40b321
push 0xd
pop eax
cmp word [ebp - 0x608], ax
je 0x40b321
cmp word [ebp - 0x608], 0xa
je 0x40b321
cmp word [ebp - 0x608], 9
je 0x40b321
mov al, byte [ebp - 0x609]
lea edx, [ebp - 0x20c]
mov byte [ebp - 0x10], al
lea ecx, [ebp - 0x10]
lea eax, [ebp - 0x614]
mov dword [ebp - 0x614], 0xfe
push eax
call fcn.0041c10a
mov ax, word [ebp - 0x20c]
mov word [ebp - 0x608], ax
xor eax, eax
push eax
lea eax, [ebp - 0x614]
push eax
push 1
lea eax, [ebp - 0x608]
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 0x40b221
mov ax, word [ebp - 0x608]
mov word [ebp - 0x610], ax
movzx eax, ax
push eax
push ebx
lea eax, [ebp - 0x408]
push 0xfe
push eax
call fcn.0040719d
add esp, 0x10
inc edi
jmp 0x40b23d
xor ebx, ebx
inc ebx
push ebx
call fcn.004208bb
pop ecx
mov edx, 0x40228c
mov ecx, eax
call fcn.0041bd93
cmp edi, ebx
jne 0x40b3a4
xor esi, esi
mov ecx, 0xbb
push esi
push ebx
call fcn.0041b2d7
mov edx, eax
lea ecx, [ebp - 0x408]
call fcn.0041bd0c
test eax, eax
jne 0x40b361
xor eax, eax
jmp 0x40b229
push esi
push ebx
mov ecx, 0xbc
call fcn.0041b2d7
mov edx, eax
lea ecx, [ebp - 0x408]
call fcn.0041bd0c
test eax, eax
jne 0x40b3a4
mov eax, dword [ebp - 0x624]
mov ecx, 0x226
mov dword [eax], ebx
call fcn.0041b2d7
push ebx
mov esi, eax
call fcn.004208bb
pop ecx
mov edx, esi
mov ecx, eax
call fcn.0041bd93
jmp 0x40b35a
mov ecx, 0x227
call fcn.0041b2d7
push 2
mov esi, eax
call fcn.004208bb
pop ecx
mov edx, esi
mov ecx, eax
call fcn.0041bd93
mov eax, ebx
jmp 0x40b229
call fcn.00420328
int3