Function at 0x10224cd
Capabilities:
Read file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
mov eax, 0xc01c
call fcn.010267e0
mov eax, dword [0x1032c0c]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
mov esi, ecx
cmp dword [esi + 8], 0xffffffff
mov dword [ebp - 0xc01c], edi
jne 0x102250e
push 0x10037ec
push 0x66e
push 0x1003770
call fcn.01028938
xor ebx, ebx
push 0x8002
lea eax, [ebp - 0x8008]
push ebx
push eax
mov dword [ebp - 0xc018], ebx
mov dword [ebp - 0xc010], ebx
mov dword [edi], ebx
call sub.msvcrt.dll_memset
add esp, 0xc
cmp byte [esi + 0xc], bl
je 0x10226b5
lea eax, [ebp - 0xc018]
push eax
push dword [esi + 8]
call dword [sym.imp.KERNEL32.dll_GetConsoleMode]
test eax, eax
jne 0x102259a
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov eax, dword [0x1032370]
cmp eax, 0x1032370
je 0x1022583
test byte [eax + 0x1c], 8
je 0x1022583
cmp byte [eax + 0x19], 2
jb 0x1022583
push esi
push 0x1003760
push 0x36
push dword [eax + 0x14]
push dword [eax + 0x10]
call fcn.010053b9
cmp esi, ebx
jle 0x1022593
and esi, 0xffff
or esi, 0x80070000
mov eax, esi
jmp 0x1022847
mov eax, dword [ebp - 0xc018]
or eax, 2
cmp byte [ebp + 0xc], bl
jne 0x10225ab
or eax, 4
mov ebx, dword [sym.imp.KERNEL32.dll_SetConsoleMode]
push eax
push dword [esi + 8]
call ebx
test eax, eax
jne 0x10225f2
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov eax, dword [0x1032370]
cmp eax, 0x1032370
je 0x10225ee
test byte [eax + 0x1c], 8
je 0x10225ee
cmp byte [eax + 0x19], 2
jb 0x10225ee
push esi
push 0x1003760
push 0x37
push dword [eax + 0x14]
push dword [eax + 0x10]
call fcn.010053b9
test esi, esi
jmp 0x1022585
push dword [esi + 8]
call dword [sym.imp.KERNEL32.dll_FlushConsoleInputBuffer]
push 0
lea eax, [ebp - 0xc010]
push eax
mov edi, 0x4000
push edi
lea eax, [ebp - 0x8008]
push eax
push dword [esi + 8]
call dword [sym.imp.KERNEL32.dll_ReadConsoleW]
test eax, eax
jne 0x1022648
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov eax, dword [0x1032370]
cmp eax, 0x1032370
je 0x10225ee
test byte [eax + 0x1c], 8
je 0x10225ee
cmp byte [eax + 0x19], 2
jb 0x10225ee
push esi
push 0x1003760
push 0x38
jmp 0x10225e3
push dword [ebp - 0xc018]
push dword [esi + 8]
call ebx
mov eax, dword [ebp - 0xc010]
cmp eax, edi
jbe 0x102267f
push 0x10037c8
push 0x6e7
push 0x1003770
call fcn.01028938
mov eax, dword [ebp - 0xc010]
cmp eax, edi
ja 0x1022833
cmp eax, 2
jb 0x1022691
lea ecx, [ebp + eax*2 - 0x800c]
cmp word [ecx], 0xd
je 0x10226ab
cmp eax, 1
jb 0x1022829
lea ecx, [ebp + eax*2 - 0x800a]
cmp word [ecx], 0xa
jne 0x1022829
xor eax, eax
mov word [ecx], ax
jmp 0x1022833
mov edi, 0x4000
push edi
lea eax, [ebp - 0xc008]
push ebx
push eax
mov byte [ebp - 0xc009], bl
mov dword [ebp - 0xc014], ebx
call sub.msvcrt.dll_memset
add esp, 0xc
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_ReadFile]
jmp 0x1022714
cmp dword [ebp - 0xc014], 0
je 0x1022766
inc dword [ebp - 0xc010]
mov al, byte [ebp - 0xc009]
mov ecx, dword [ebp - 0xc010]
mov byte [ebp + ecx - 0xc009], al
cmp al, 0xa
je 0x10227c4
cmp ecx, edi
je 0x102279a
push 0
lea eax, [ebp - 0xc014]
push eax
push 1
lea eax, [ebp - 0xc009]
push eax
push dword [esi + 8]
call ebx
test eax, eax
jne 0x10226e0
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov eax, dword [0x1032370]
cmp eax, 0x1032370
je 0x10225ee
test byte [eax + 0x1c], 8
je 0x10225ee
cmp byte [eax + 0x19], 2
jb 0x10225ee
push esi
push 0x1003760
push 0x39
jmp 0x10225e3
mov eax, dword [0x1032370]
cmp eax, 0x1032370
je 0x1022790
test byte [eax + 0x1c], 8
je 0x1022790
cmp byte [eax + 0x19], 2
jb 0x1022790
push 0x1003760
push 0x3a
push dword [eax + 0x14]
push dword [eax + 0x10]
call fcn.01005393
mov eax, 0x80070026
jmp 0x1022847
mov eax, dword [0x1032370]
cmp eax, 0x1032370
je 0x10227c4
test byte [eax + 0x1c], 8
je 0x10227c4
cmp byte [eax + 0x19], 4
jb 0x10227c4
push 0x1003760
push 0x3b
push dword [eax + 0x14]
push dword [eax + 0x10]
call fcn.01005393
push edi
lea eax, [ebp - 0x8008]
push eax
push dword [ebp - 0xc010]
lea eax, [ebp - 0xc008]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetConsoleCP]
push eax
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
test eax, eax
jne 0x1022653
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov eax, dword [0x1032370]
cmp eax, 0x1032370
je 0x10225ee
test byte [eax + 0x1c], 8
je 0x10225ee
cmp byte [eax + 0x19], 2
jb 0x10225ee
push esi
push 0x1003760
push 0x3c
jmp 0x10225e3
xor ecx, ecx
mov word [ebp + eax*2 - 0x8008], cx
push 0
push dword [ebp - 0xc01c]
lea eax, [ebp - 0x8008]
push eax
call fcn.01028a2f
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.01026693
leave
ret 8