Function at 0x4c4114
Capabilities:
Read file on windows

Disassembly:
sub esp, 0x20
mov eax, dword [esp + 0x24]
push ebx
push ebp
push esi
mov esi, dword [esp + 0x38]
xor ebp, ebp
push edi
push 0xfffffffffffffffe
pop ecx
mov dword [esp + 0x28], ebp
mov dword [esp + 0x20], ecx
mov dword [esp + 0x2c], esi
cmp eax, ecx
jne 0x4c414f
call fcn.004bc74e
mov dword [eax], ebp
call fcn.004bc77f
mov dword [eax], 9
jmp 0x4c48b3
test eax, eax
js 0x4c489c
cmp eax, dword [0x521a68]
jae 0x4c489c
mov ecx, eax
mov ebx, eax
sar ecx, 5
and ebx, 0x1f
shl ebx, 6
mov dword [esp + 0x18], ecx
mov edx, dword [ecx*4 + 0x520f18]
mov al, byte [edx + ebx + 4]
test al, 1
je 0x4c489c
cmp esi, 0x7fffffff
jbe 0x4c41a6
call fcn.004bc74e
mov dword [eax], ebp
call fcn.004bc77f
mov dword [eax], 0x16
jmp 0x4c48ae
mov edi, ebp
test esi, esi
je 0x4c4898
test al, 2
jne 0x4c4898
cmp dword [esp + 0x38], edi
je 0x4c418f
mov al, byte [edx + ebx + 0x24]
add al, al
sar al, 1
mov byte [esp + 0x3c], al
movsx eax, al
push 4
pop edx
dec eax
je 0x4c41e7
dec eax
jne 0x4c41e1
mov eax, esi
not eax
test al, 1
je 0x4c418f
and esi, 0xfffffffe
mov ebp, dword [esp + 0x38]
jmp 0x4c4247
mov eax, esi
not eax
test al, 1
je 0x4c418f
shr esi, 1
cmp esi, edx
cmovb esi, edx
push esi
call fcn.004bc66d
mov ebp, eax
pop ecx
test ebp, ebp
jne 0x4c421e
call fcn.004bc77f
mov dword [eax], 0xc
call fcn.004bc74e
mov dword [eax], 8
jmp 0x4c48b3
push 1
push 0
push 0
push dword [esp + 0x40]
call fcn.004c3f8d
mov ecx, dword [esp + 0x28]
add esp, 0x10
mov ecx, dword [ecx*4 + 0x520f18]
mov dword [ecx + ebx + 0x28], eax
mov dword [ecx + ebx + 0x2c], edx
mov ecx, dword [esp + 0x18]
mov eax, dword [ecx*4 + 0x520f18]
push 0xa
mov dword [esp + 0x28], ebp
pop edx
test byte [eax + ebx + 4], 0x48
je 0x4c42ee
mov al, byte [eax + ebx + 5]
cmp al, dl
je 0x4c42ee
test esi, esi
je 0x4c42ee
mov byte [ebp], al
lea edx, [ebp + 1]
mov eax, dword [ecx*4 + 0x520f18]
xor edi, edi
inc edi
mov dword [esp + 0x24], edx
dec esi
cmp byte [esp + 0x3c], 0
mov byte [eax + ebx + 5], 0xa
je 0x4c42ee
mov eax, dword [ecx*4 + 0x520f18]
mov al, byte [eax + ebx + 0x25]
cmp al, 0xa
je 0x4c42ee
test esi, esi
je 0x4c42ee
mov byte [edx], al
inc edx
mov eax, dword [ecx*4 + 0x520f18]
dec esi
cmp byte [esp + 0x3c], 1
push 2
mov dword [esp + 0x28], edx
pop edi
mov byte [eax + ebx + 0x25], 0xa
jne 0x4c42ee
mov eax, dword [ecx*4 + 0x520f18]
mov al, byte [eax + ebx + 0x26]
cmp al, 0xa
je 0x4c42ee
test esi, esi
je 0x4c42ee
push 3
mov byte [edx], al
inc edx
mov eax, dword [ecx*4 + 0x520f18]
dec esi
pop edi
push 0xa
pop ecx
mov dword [esp + 0x24], edx
mov byte [eax + ebx + 0x26], cl
push dword [esp + 0x34]
call fcn.004c745b
test eax, eax
mov eax, dword [esp + 0x1c]
pop ecx
je 0x4c4377
mov ecx, dword [eax*4 + 0x520f18]
test byte [ecx + ebx + 4], 0x80
je 0x4c4377
lea eax, [esp + 0x28]
push eax
push dword [ecx + ebx]
call dword [sym.imp.KERNEL32.dll_GetConsoleMode]
mov dword [esp + 0x28], eax
test eax, eax
je 0x4c4373
cmp byte [esp + 0x3c], 2
jne 0x4c4373
push 0
lea eax, [esp + 0x20]
shr esi, 1
push eax
mov eax, dword [esp + 0x20]
push esi
push dword [esp + 0x30]
mov eax, dword [eax*4 + 0x520f18]
push dword [eax + ebx]
call dword [sym.imp.KERNEL32.dll_ReadConsoleW]
test eax, eax
jne 0x4c4366
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.004bc761
pop ecx
or ebx, 0xffffffff
jmp 0x4c4627
mov eax, dword [esp + 0x1c]
lea ecx, [eax + eax]
mov dword [esp + 0x1c], ecx
jmp 0x4c43af
mov eax, dword [esp + 0x18]
mov eax, dword [eax*4 + 0x520f18]
lea ecx, [esp + 0x1c]
push 0
push ecx
push esi
push dword [esp + 0x30]
push dword [eax + ebx]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x4c4864
mov ecx, dword [esp + 0x1c]
test ecx, ecx
js 0x4c4864
cmp ecx, esi
ja 0x4c4864
mov edx, dword [esp + 0x18]
add edi, ecx
mov esi, dword [edx*4 + 0x520f18]
mov al, byte [esi + ebx + 4]
test al, al
jns 0x4c4623
cmp byte [esp + 0x3c], 2
je 0x4c4641
test ecx, ecx
je 0x4c43e3
push 0xa
pop ecx
cmp byte [ebp], cl
jne 0x4c43e3
or al, 4
jmp 0x4c43e5
and al, 0xfb
mov byte [esi + ebx + 4], al
lea eax, [edi + ebp]
mov dword [esp + 0x24], eax
mov esi, ebp
cmp ebp, eax
jae 0x4c451b
push 0xd
pop ecx
mov edi, ebp
mov al, byte [edi]
cmp al, 0x1a
je 0x4c44ff
cmp al, cl
je 0x4c4416
mov byte [esi], al
inc esi
inc edi
jmp 0x4c44c0
mov eax, dword [esp + 0x24]
dec eax
cmp edi, eax
jae 0x4c443e
lea eax, [edi + 1]
cmp byte [eax], 0xa
jne 0x4c4434
push 0xa
pop eax
add edi, 2
mov byte [esi], al
jmp 0x4c44f0
mov byte [esi], cl
mov edi, eax
inc esi
jmp 0x4c44c0
push 0
lea eax, [esp + 0x20]
inc edi
push eax
push 1
lea eax, [esp + 0x1f]
push eax
mov eax, dword [edx*4 + 0x520f18]
push dword [eax + ebx]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x4c446f
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x4c44f3
cmp dword [esp + 0x1c], 0
je 0x4c44f3
mov edx, dword [esp + 0x18]
mov eax, dword [edx*4 + 0x520f18]
test byte [eax + ebx + 4], 0x48
je 0x4c44ad
push 0xa
pop eax
push 0xd
cmp byte [esp + 0x17], al
jne 0x4c4498
mov byte [esi], al
inc esi
jmp 0x4c44bf
mov byte [esi], 0xd
inc esi
mov ecx, dword [edx*4 + 0x520f18]
mov al, byte [esp + 0x17]
mov byte [ecx + ebx + 5], al
jmp 0x4c44bf
cmp esi, ebp
jne 0x4c44cc
push 0xa
pop eax
cmp byte [esp + 0x13], al
jne 0x4c44cc
mov byte [esi], al
inc esi
push 0xd
pop ecx
cmp edi, dword [esp + 0x24]
jb 0x4c43ff
jmp 0x4c451b
push 1
push 0xffffffffffffffff
push 0xffffffffffffffff
push dword [esp + 0x40]
call fcn.004c3f8d
mov edx, dword [esp + 0x28]
add esp, 0x10
push 0xa
pop eax
cmp byte [esp + 0x13], al
je 0x4c44bd
push 0xd
pop ecx
mov byte [esi], cl
inc esi
jmp 0x4c44c0
mov edx, dword [esp + 0x18]
push 0xd
pop ecx
mov byte [esi], cl
inc esi
jmp 0x4c44c0
mov ecx, dword [edx*4 + 0x520f18]
mov al, byte [ecx + ebx + 4]
test al, 0x40
jne 0x4c4516
or al, 2
mov byte [ecx + ebx + 4], al
jmp 0x4c451b
mov al, byte [edi]
mov byte [esi], al
inc esi
mov edi, esi
sub edi, ebp
cmp byte [esp + 0x3c], 1
jne 0x4c4623
test edi, edi
je 0x4c4623
dec esi
mov al, byte [esi]
test al, al
js 0x4c453f
inc esi
jmp 0x4c45e5
xor edx, edx
movzx eax, al
inc edx
jmp 0x4c4555
cmp edx, 4
jg 0x4c455e
cmp esi, ebp
jb 0x4c455e
dec esi
inc edx
movzx eax, byte [esi]
cmp byte [eax + 0x511798], 0
je 0x4c4547
movzx eax, byte [esi]
movsx eax, byte [eax + 0x511798]
test eax, eax
jne 0x4c457c
call fcn.004bc77f
mov dword [eax], 0x2a
jmp 0x4c435e
inc eax
cmp eax, edx
jne 0x4c4585
add esi, edx
jmp 0x4c45e5
mov eax, dword [esp + 0x18]
mov ecx, dword [eax*4 + 0x520f18]
test byte [ecx + ebx + 4], 0x48
je 0x4c45d0
mov al, byte [esi]
inc esi
mov byte [ecx + ebx + 5], al
mov eax, dword [esp + 0x18]
cmp edx, 2
jl 0x4c45b9
mov ecx, dword [eax*4 + 0x520f18]
mov al, byte [esi]
inc esi
mov byte [ecx + ebx + 0x25], al
mov eax, dword [esp + 0x18]
cmp edx, 3
jne 0x4c45cc
mov ecx, dword [eax*4 + 0x520f18]
mov al, byte [esi]
inc esi
mov byte [ecx + ebx + 0x26], al
sub esi, edx
jmp 0x4c45e5
neg edx
mov eax, edx
push 1
cdq
push edx
push eax
push dword [esp + 0x40]
call fcn.004c3f8d
add esp, 0x10
mov eax, dword [esp + 0x2c]
sub esi, ebp
shr eax, 1
push eax
push dword [esp + 0x3c]
push esi
push ebp
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov edi, eax
test edi, edi
je 0x4c4351
mov eax, dword [esp + 0x18]
xor ecx, ecx
cmp edi, esi
setne cl
add edi, edi
mov eax, dword [eax*4 + 0x520f18]
mov dword [eax + ebx + 0x30], ecx
mov ebx, dword [esp + 0x20]
cmp ebp, dword [esp + 0x38]
je 0x4c4634
push ebp
call fcn.004b592c
pop ecx
cmp ebx, 0xfffffffe
cmove ebx, edi
mov eax, ebx
jmp 0x4c48b6
cmp dword [esp + 0x28], 0
je 0x4c46c4
mov eax, edi
mov esi, ebp
cdq
mov ecx, ebp
sub eax, edx
sar eax, 1
lea edx, [eax*2]
add edx, ebp
cmp ebp, edx
jae 0x4c46b8
push 0xd
mov dword [esp + 0x40], 0x1a
pop edi
movzx eax, word [ecx]
cmp ax, word [esp + 0x3c]
je 0x4c46a8
cmp ax, di
je 0x4c4685
mov word [esi], ax
add esi, 2
add ecx, 2
jmp 0x4c46a2
lea eax, [edx - 2]
cmp ecx, eax
jae 0x4c46a2
add ecx, 2
push 0xa
pop eax
cmp word [ecx], ax
je 0x4c469c
push 0xd
pop eax
push eax
pop edi
mov word [esi], ax
add esi, 2
cmp ecx, edx
jb 0x4c466b
jmp 0x4c46b8
mov eax, dword [esp + 0x18]
mov eax, dword [eax*4 + 0x520f18]
or byte [eax + ebx + 4], 2
mov edi, esi
sub edi, ebp
and edi, 0xfffffffe
jmp 0x4c4623
test ecx, ecx
je 0x4c46d5
push 0xa
pop ecx
cmp word [ebp], cx
jne 0x4c46d5
or al, 4
jmp 0x4c46d7
and al, 0xfb
mov byte [esi + ebx + 4], al
lea eax, [edi + ebp]
mov dword [esp + 0x28], eax
mov esi, ebp
cmp ebp, eax
jae 0x4c485b
push 0xd
pop ecx
mov dword [esp + 0x3c], 0x1a
mov edi, ebp
movzx eax, word [edi]
cmp ax, word [esp + 0x3c]
je 0x4c483b
cmp ax, cx
je 0x4c4711
mov word [esi], ax
jmp 0x4c473a
mov eax, dword [esp + 0x28]
add eax, 0xfffffffe
cmp edi, eax
jae 0x4c4745
push 0xa
pop edx
cmp word [edi + 2], dx
mov edx, dword [esp + 0x18]
jne 0x4c4737
push 0xa
pop eax
add edi, 4
mov word [esi], ax
jmp 0x4c4827
mov word [esi], cx
add esi, 2
add edi, 2
jmp 0x4c47df
push 0
lea eax, [esp + 0x20]
add edi, 2
push eax
push 2
lea eax, [esp + 0x20]
push eax
mov eax, dword [edx*4 + 0x520f18]
push dword [eax + ebx]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x4c4778
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x4c482c
cmp dword [esp + 0x1c], 0
je 0x4c482c
mov edx, dword [esp + 0x18]
mov eax, dword [edx*4 + 0x520f18]
test byte [eax + ebx + 4], 0x48
je 0x4c47eb
push 0xa
pop eax
push 0xd
cmp word [esp + 0x18], ax
jne 0x4c47a9
mov word [esi], ax
add esi, 2
jmp 0x4c47de
pop eax
mov word [esi], ax
add esi, 2
mov ecx, dword [edx*4 + 0x520f18]
mov al, byte [esp + 0x14]
push 0xa
mov byte [ecx + ebx + 5], al
mov ecx, dword [edx*4 + 0x520f18]
mov al, byte [esp + 0x19]
mov byte [ecx + ebx + 0x25], al
mov eax, dword [edx*4 + 0x520f18]
pop ecx
mov byte [eax + ebx + 0x26], cl
push 0xd
pop ecx
cmp edi, dword [esp + 0x28]
jb 0x4c46f9
jmp 0x4c485b
cmp esi, ebp
jne 0x4c4801
push 0xa
pop eax
cmp word [esp + 0x14], ax
jne 0x4c4801
mov word [esi], ax
add esi, 2
jmp 0x4c47dc
push 1
push 0xffffffffffffffff
push 0xfffffffffffffffe
push dword [esp + 0x40]
call fcn.004c3f8d
mov edx, dword [esp + 0x28]
add esp, 0x10
push 0xa
pop eax
cmp word [esp + 0x14], ax
je 0x4c47dc
push 0xd
pop ecx
mov word [esi], cx
add esi, 2
jmp 0x4c47df
mov edx, dword [esp + 0x18]
push 0xd
pop ecx
mov word [esi], cx
add esi, 2
jmp 0x4c47df
mov ecx, dword [edx*4 + 0x520f18]
mov al, byte [ecx + ebx + 4]
test al, 0x40
jne 0x4c4852
or al, 2
mov byte [ecx + ebx + 4], al
jmp 0x4c485b
mov ax, word [edi]
mov word [esi], ax
add esi, 2
mov edi, esi
sub edi, ebp
jmp 0x4c4623
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 5
pop esi
cmp eax, esi
jne 0x4c4888
call fcn.004bc77f
mov dword [eax], 9
call fcn.004bc74e
mov dword [eax], esi
jmp 0x4c435e
cmp eax, 0x6d
jne 0x4c4357
xor ebx, ebx
jmp 0x4c4627
xor eax, eax
jmp 0x4c48b6
call fcn.004bc74e
mov dword [eax], ebp
call fcn.004bc77f
mov dword [eax], 9
call fcn.004bdd46
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x20
ret