Function at 0x4a2eb6
Capabilities:
Read file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x28
push ebx
mov ebx, dword [ebp + 8]
push edi
cmp ebx, 0xfffffffe
jne 0x4a2ee0
call fcn.0049f1f5
and dword [eax], 0
call fcn.0049f208
mov dword [eax], 9
jmp 0x4a3262
test ebx, ebx
js 0x4a324a
cmp ebx, dword [0x4cca80]
jae 0x4a324a
mov eax, ebx
mov dword [ebp - 0x14], 1
and eax, 0x3f
mov edi, ebx
sar edi, 6
imul edx, eax, 0x30
mov dword [ebp - 0x10], edi
mov eax, dword [edi*4 + 0x4cc880]
mov dword [ebp - 0x18], edx
mov cl, byte [edx + eax + 0x28]
mov byte [ebp - 1], cl
test cl, 1
je 0x4a324a
mov ecx, dword [ebp + 0x10]
cmp ecx, 0x7fffffff
jbe 0x4a2f48
call fcn.0049f1f5
and dword [eax], 0
call fcn.0049f208
mov dword [eax], 0x16
jmp 0x4a325d
test ecx, ecx
je 0x4a3246
test byte [ebp - 1], 2
jne 0x4a3246
cmp dword [ebp + 0xc], 0
je 0x4a2f30
push esi
mov esi, dword [edx + eax + 0x18]
mov al, byte [edx + eax + 0x29]
mov byte [ebp - 1], al
mov dword [ebp - 0x1c], esi
xor esi, esi
movsx eax, al
sub eax, 1
je 0x4a2f94
sub eax, 1
jne 0x4a2f86
mov eax, ecx
not eax
test al, 1
je 0x4a2f9f
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0xc], ecx
mov dword [ebp - 8], eax
jmp 0x4a3030
mov edx, dword [ebp - 0x14]
mov eax, ecx
not eax
test dl, al
jne 0x4a2fbb
call fcn.0049f1f5
and dword [eax], esi
call fcn.0049f208
mov dword [eax], 0x16
call fcn.0049f14c
jmp 0x4a317d
push 4
pop eax
shr ecx, 1
mov dword [ebp - 0xc], eax
cmp ecx, eax
jb 0x4a2fcc
mov eax, ecx
mov dword [ebp - 0xc], ecx
push eax
call fcn.0049f317
push 0
mov esi, eax
call fcn.0049f278
push 0
call fcn.0049f278
add esp, 0xc
mov dword [ebp - 8], esi
test esi, esi
jne 0x4a3007
call fcn.0049f208
mov dword [eax], 0xc
call fcn.0049f1f5
mov dword [eax], 8
jmp 0x4a317d
push dword [ebp - 0x14]
push 0
push 0
push ebx
call fcn.004a34ef
mov ecx, dword [edi*4 + 0x4cc880]
add esp, 0x10
mov edi, dword [ebp - 0x18]
mov dword [edi + ecx + 0x20], eax
mov eax, esi
mov dword [edi + ecx + 0x24], edx
mov edx, edi
mov ecx, dword [ebp - 0xc]
mov ebx, dword [ebp - 0x10]
xor edi, edi
mov dword [ebp - 0x24], eax
mov ebx, dword [ebx*4 + 0x4cc880]
mov dword [ebp - 0x20], ebx
test byte [edx + ebx + 0x28], 0x48
mov ebx, dword [ebp + 8]
je 0x4a311e
mov ebx, dword [ebp - 0x20]
mov bl, byte [edx + ebx + 0x2a]
mov byte [ebp - 2], bl
cmp bl, 0xa
mov ebx, dword [ebp + 8]
je 0x4a311e
test ecx, ecx
je 0x4a311e
mov bl, byte [ebp - 2]
mov edi, dword [ebp - 0x14]
mov byte [eax], bl
inc eax
mov ebx, dword [ebp + 8]
dec ecx
cmp byte [ebp - 1], 0
mov dword [ebp - 8], eax
mov eax, dword [ebp - 0x10]
mov dword [ebp - 0xc], ecx
mov eax, dword [eax*4 + 0x4cc880]
mov byte [edx + eax + 0x2a], 0xa
je 0x4a311e
mov eax, dword [ebp - 0x10]
mov eax, dword [eax*4 + 0x4cc880]
mov al, byte [edx + eax + 0x2b]
mov byte [ebp - 2], al
cmp al, 0xa
je 0x4a311e
test ecx, ecx
je 0x4a311e
mov eax, dword [ebp - 8]
mov bl, byte [ebp - 2]
push 2
pop edi
mov byte [eax], bl
inc eax
mov ebx, dword [ebp + 8]
dec ecx
mov dword [ebp - 8], eax
mov eax, dword [ebp - 0x10]
mov dword [ebp - 0xc], ecx
mov eax, dword [eax*4 + 0x4cc880]
mov byte [edx + eax + 0x2b], 0xa
mov al, byte [ebp - 1]
cmp al, byte [ebp - 0x14]
jne 0x4a311e
mov eax, dword [ebp - 0x10]
mov eax, dword [eax*4 + 0x4cc880]
mov al, byte [edx + eax + 0x2c]
mov byte [ebp - 2], al
cmp al, 0xa
je 0x4a311e
test ecx, ecx
je 0x4a311e
mov eax, dword [ebp - 8]
mov bl, byte [ebp - 2]
push 3
pop edi
mov byte [eax], bl
inc eax
mov ebx, dword [ebp + 8]
dec ecx
mov dword [ebp - 8], eax
mov eax, dword [ebp - 0x10]
mov dword [ebp - 0xc], ecx
mov eax, dword [eax*4 + 0x4cc880]
mov byte [edx + eax + 0x2c], 0xa
push ebx
call fcn.004a8e6f
pop ecx
test eax, eax
je 0x4a319a
mov eax, dword [ebp - 0x10]
mov ecx, dword [ebp - 0x18]
mov eax, dword [eax*4 + 0x4cc880]
test byte [ecx + eax + 0x28], 0x80
je 0x4a319a
lea eax, [ebp - 0x28]
push eax
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_GetConsoleMode]
test eax, eax
je 0x4a319a
cmp byte [ebp - 1], 2
jne 0x4a319e
push 0
lea eax, [ebp - 0x20]
push eax
mov eax, dword [ebp - 0xc]
shr eax, 1
push eax
push dword [ebp - 8]
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_ReadConsoleW]
test eax, eax
jne 0x4a318f
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.0049f1d2
pop ecx
or edi, 0xffffffff
push esi
call fcn.0049f278
pop ecx
mov eax, edi
pop esi
jmp 0x4a3265
mov eax, dword [ebp - 0x20]
mov ecx, dword [ebp + 0x10]
lea edi, [edi + eax*2]
jmp 0x4a31c3
mov byte [ebp - 0x14], 0
push 0
lea eax, [ebp - 0x20]
push eax
mov eax, dword [ebp - 0xc]
push eax
push dword [ebp - 8]
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x4a3212
mov ecx, dword [ebp + 0x10]
cmp dword [ebp - 0x20], ecx
ja 0x4a3212
add edi, dword [ebp - 0x20]
mov eax, dword [ebp - 0x10]
mov edx, dword [ebp - 0x18]
mov eax, dword [eax*4 + 0x4cc880]
test byte [edx + eax + 0x28], 0x80
je 0x4a3180
cmp byte [ebp - 1], 2
je 0x4a31f4
shr ecx, 1
push ecx
push dword [ebp + 0xc]
push edi
push dword [ebp - 8]
push ebx
call fcn.004a2bd2
add esp, 0x14
mov edi, eax
jmp 0x4a3180
shr edi, 1
cmp byte [ebp - 0x14], 0
push edi
push dword [ebp - 0x24]
push ebx
je 0x4a320b
call fcn.004a2d22
add esp, 0xc
jmp 0x4a31f0
call fcn.004a2a12
jmp 0x4a3206
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 5
pop edi
cmp eax, edi
jne 0x4a3236
call fcn.0049f208
mov dword [eax], 9
call fcn.0049f1f5
mov dword [eax], edi
jmp 0x4a317d
cmp eax, 0x6d
jne 0x4a3176
xor edi, edi
jmp 0x4a3180
xor eax, eax
jmp 0x4a3265
call fcn.0049f1f5
and dword [eax], 0
call fcn.0049f208
mov dword [eax], 9
call fcn.0049f14c
or eax, 0xffffffff
pop edi
pop ebx
mov esp, ebp
pop ebp
ret