Function at 0x4c6624
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 0x4c665f
call fcn.004c2ffe
mov dword [eax], ebp
call fcn.004c302f
mov dword [eax], 9
jmp 0x4c6dc3
test eax, eax
js 0x4c6dac
cmp eax, dword [0x52aca8]
jae 0x4c6dac
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 + 0x52a778]
mov al, byte [edx + ebx + 4]
test al, 1
je 0x4c6dac
cmp esi, 0x7fffffff
jbe 0x4c66b6
call fcn.004c2ffe
mov dword [eax], ebp
call fcn.004c302f
mov dword [eax], 0x16
jmp 0x4c6dbe
mov edi, ebp
test esi, esi
je 0x4c6da8
test al, 2
jne 0x4c6da8
cmp dword [esp + 0x38], edi
je 0x4c669f
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 0x4c66f7
dec eax
jne 0x4c66f1
mov eax, esi
not eax
test al, 1
je 0x4c669f
and esi, 0xfffffffe
mov ebp, dword [esp + 0x38]
jmp 0x4c6757
mov eax, esi
not eax
test al, 1
je 0x4c669f
shr esi, 1
cmp esi, edx
cmovb esi, edx
push esi
call fcn.004c2f1d
mov ebp, eax
pop ecx
test ebp, ebp
jne 0x4c672e
call fcn.004c302f
mov dword [eax], 0xc
call fcn.004c2ffe
mov dword [eax], 8
jmp 0x4c6dc3
push 1
push 0
push 0
push dword [esp + 0x40]
call fcn.004cb3f6
mov ecx, dword [esp + 0x28]
add esp, 0x10
mov ecx, dword [ecx*4 + 0x52a778]
mov dword [ecx + ebx + 0x28], eax
mov dword [ecx + ebx + 0x2c], edx
mov ecx, dword [esp + 0x18]
mov eax, dword [ecx*4 + 0x52a778]
push 0xa
mov dword [esp + 0x28], ebp
pop edx
test byte [eax + ebx + 4], 0x48
je 0x4c67fe
mov al, byte [eax + ebx + 5]
cmp al, dl
je 0x4c67fe
test esi, esi
je 0x4c67fe
mov byte [ebp], al
lea edx, [ebp + 1]
mov eax, dword [ecx*4 + 0x52a778]
xor edi, edi
inc edi
mov dword [esp + 0x24], edx
dec esi
cmp byte [esp + 0x3c], 0
mov byte [eax + ebx + 5], 0xa
je 0x4c67fe
mov eax, dword [ecx*4 + 0x52a778]
mov al, byte [eax + ebx + 0x25]
cmp al, 0xa
je 0x4c67fe
test esi, esi
je 0x4c67fe
mov byte [edx], al
inc edx
mov eax, dword [ecx*4 + 0x52a778]
dec esi
cmp byte [esp + 0x3c], 1
push 2
mov dword [esp + 0x28], edx
pop edi
mov byte [eax + ebx + 0x25], 0xa
jne 0x4c67fe
mov eax, dword [ecx*4 + 0x52a778]
mov al, byte [eax + ebx + 0x26]
cmp al, 0xa
je 0x4c67fe
test esi, esi
je 0x4c67fe
push 3
mov byte [edx], al
inc edx
mov eax, dword [ecx*4 + 0x52a778]
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.004cd78a
test eax, eax
mov eax, dword [esp + 0x1c]
pop ecx
je 0x4c6887
mov ecx, dword [eax*4 + 0x52a778]
test byte [ecx + ebx + 4], 0x80
je 0x4c6887
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 0x4c6883
cmp byte [esp + 0x3c], 2
jne 0x4c6883
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 + 0x52a778]
push dword [eax + ebx]
call dword [sym.imp.KERNEL32.dll_ReadConsoleW]
test eax, eax
jne 0x4c6876
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.004c3011
pop ecx
or ebx, 0xffffffff
jmp 0x4c6b37
mov eax, dword [esp + 0x1c]
lea ecx, [eax + eax]
mov dword [esp + 0x1c], ecx
jmp 0x4c68bf
mov eax, dword [esp + 0x18]
mov eax, dword [eax*4 + 0x52a778]
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 0x4c6d74
mov ecx, dword [esp + 0x1c]
test ecx, ecx
js 0x4c6d74
cmp ecx, esi
ja 0x4c6d74
mov edx, dword [esp + 0x18]
add edi, ecx
mov esi, dword [edx*4 + 0x52a778]
mov al, byte [esi + ebx + 4]
test al, al
jns 0x4c6b33
cmp byte [esp + 0x3c], 2
je 0x4c6b51
test ecx, ecx
je 0x4c68f3
push 0xa
pop ecx
cmp byte [ebp], cl
jne 0x4c68f3
or al, 4
jmp 0x4c68f5
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 0x4c6a2b
push 0xd
pop ecx
mov edi, ebp
mov al, byte [edi]
cmp al, 0x1a
je 0x4c6a0f
cmp al, cl
je 0x4c6926
mov byte [esi], al
inc esi
inc edi
jmp 0x4c69d0
mov eax, dword [esp + 0x24]
dec eax
cmp edi, eax
jae 0x4c694e
lea eax, [edi + 1]
cmp byte [eax], 0xa
jne 0x4c6944
push 0xa
pop eax
add edi, 2
mov byte [esi], al
jmp 0x4c6a00
mov byte [esi], cl
mov edi, eax
inc esi
jmp 0x4c69d0
push 0
lea eax, [esp + 0x20]
inc edi
push eax
push 1
lea eax, [esp + 0x1f]
push eax
mov eax, dword [edx*4 + 0x52a778]
push dword [eax + ebx]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x4c697f
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x4c6a03
cmp dword [esp + 0x1c], 0
je 0x4c6a03
mov edx, dword [esp + 0x18]
mov eax, dword [edx*4 + 0x52a778]
test byte [eax + ebx + 4], 0x48
je 0x4c69bd
push 0xa
pop eax
push 0xd
cmp byte [esp + 0x17], al
jne 0x4c69a8
mov byte [esi], al
inc esi
jmp 0x4c69cf
mov byte [esi], 0xd
inc esi
mov ecx, dword [edx*4 + 0x52a778]
mov al, byte [esp + 0x17]
mov byte [ecx + ebx + 5], al
jmp 0x4c69cf
cmp esi, ebp
jne 0x4c69dc
push 0xa
pop eax
cmp byte [esp + 0x13], al
jne 0x4c69dc
mov byte [esi], al
inc esi
push 0xd
pop ecx
cmp edi, dword [esp + 0x24]
jb 0x4c690f
jmp 0x4c6a2b
push 1
push 0xffffffffffffffff
push 0xffffffffffffffff
push dword [esp + 0x40]
call fcn.004cb3f6
mov edx, dword [esp + 0x28]
add esp, 0x10
push 0xa
pop eax
cmp byte [esp + 0x13], al
je 0x4c69cd
push 0xd
pop ecx
mov byte [esi], cl
inc esi
jmp 0x4c69d0
mov edx, dword [esp + 0x18]
push 0xd
pop ecx
mov byte [esi], cl
inc esi
jmp 0x4c69d0
mov ecx, dword [edx*4 + 0x52a778]
mov al, byte [ecx + ebx + 4]
test al, 0x40
jne 0x4c6a26
or al, 2
mov byte [ecx + ebx + 4], al
jmp 0x4c6a2b
mov al, byte [edi]
mov byte [esi], al
inc esi
mov edi, esi
sub edi, ebp
cmp byte [esp + 0x3c], 1
jne 0x4c6b33
test edi, edi
je 0x4c6b33
dec esi
mov al, byte [esi]
test al, al
js 0x4c6a4f
inc esi
jmp 0x4c6af5
xor edx, edx
movzx eax, al
inc edx
jmp 0x4c6a65
cmp edx, 4
jg 0x4c6a6e
cmp esi, ebp
jb 0x4c6a6e
dec esi
inc edx
movzx eax, byte [esi]
cmp byte [eax + 0x518bf0], 0
je 0x4c6a57
movzx eax, byte [esi]
movsx eax, byte [eax + 0x518bf0]
test eax, eax
jne 0x4c6a8c
call fcn.004c302f
mov dword [eax], 0x2a
jmp 0x4c686e
inc eax
cmp eax, edx
jne 0x4c6a95
add esi, edx
jmp 0x4c6af5
mov eax, dword [esp + 0x18]
mov ecx, dword [eax*4 + 0x52a778]
test byte [ecx + ebx + 4], 0x48
je 0x4c6ae0
mov al, byte [esi]
inc esi
mov byte [ecx + ebx + 5], al
mov eax, dword [esp + 0x18]
cmp edx, 2
jl 0x4c6ac9
mov ecx, dword [eax*4 + 0x52a778]
mov al, byte [esi]
inc esi
mov byte [ecx + ebx + 0x25], al
mov eax, dword [esp + 0x18]
cmp edx, 3
jne 0x4c6adc
mov ecx, dword [eax*4 + 0x52a778]
mov al, byte [esi]
inc esi
mov byte [ecx + ebx + 0x26], al
sub esi, edx
jmp 0x4c6af5
neg edx
mov eax, edx
push 1
cdq
push edx
push eax
push dword [esp + 0x40]
call fcn.004cb3f6
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 0x4c6861
mov eax, dword [esp + 0x18]
xor ecx, ecx
cmp edi, esi
setne cl
add edi, edi
mov eax, dword [eax*4 + 0x52a778]
mov dword [eax + ebx + 0x30], ecx
mov ebx, dword [esp + 0x20]
cmp ebp, dword [esp + 0x38]
je 0x4c6b44
push ebp
call fcn.004bbb16
pop ecx
cmp ebx, 0xfffffffe
cmove ebx, edi
mov eax, ebx
jmp 0x4c6dc6
cmp dword [esp + 0x28], 0
je 0x4c6bd4
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 0x4c6bc8
push 0xd
mov dword [esp + 0x40], 0x1a
pop edi
movzx eax, word [ecx]
cmp ax, word [esp + 0x3c]
je 0x4c6bb8
cmp ax, di
je 0x4c6b95
mov word [esi], ax
add esi, 2
add ecx, 2
jmp 0x4c6bb2
lea eax, [edx - 2]
cmp ecx, eax
jae 0x4c6bb2
add ecx, 2
push 0xa
pop eax
cmp word [ecx], ax
je 0x4c6bac
push 0xd
pop eax
push eax
pop edi
mov word [esi], ax
add esi, 2
cmp ecx, edx
jb 0x4c6b7b
jmp 0x4c6bc8
mov eax, dword [esp + 0x18]
mov eax, dword [eax*4 + 0x52a778]
or byte [eax + ebx + 4], 2
mov edi, esi
sub edi, ebp
and edi, 0xfffffffe
jmp 0x4c6b33
test ecx, ecx
je 0x4c6be5
push 0xa
pop ecx
cmp word [ebp], cx
jne 0x4c6be5
or al, 4
jmp 0x4c6be7
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 0x4c6d6b
push 0xd
pop ecx
mov dword [esp + 0x3c], 0x1a
mov edi, ebp
movzx eax, word [edi]
cmp ax, word [esp + 0x3c]
je 0x4c6d4b
cmp ax, cx
je 0x4c6c21
mov word [esi], ax
jmp 0x4c6c4a
mov eax, dword [esp + 0x28]
add eax, 0xfffffffe
cmp edi, eax
jae 0x4c6c55
push 0xa
pop edx
cmp word [edi + 2], dx
mov edx, dword [esp + 0x18]
jne 0x4c6c47
push 0xa
pop eax
add edi, 4
mov word [esi], ax
jmp 0x4c6d37
mov word [esi], cx
add esi, 2
add edi, 2
jmp 0x4c6cef
push 0
lea eax, [esp + 0x20]
add edi, 2
push eax
push 2
lea eax, [esp + 0x20]
push eax
mov eax, dword [edx*4 + 0x52a778]
push dword [eax + ebx]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x4c6c88
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x4c6d3c
cmp dword [esp + 0x1c], 0
je 0x4c6d3c
mov edx, dword [esp + 0x18]
mov eax, dword [edx*4 + 0x52a778]
test byte [eax + ebx + 4], 0x48
je 0x4c6cfb
push 0xa
pop eax
push 0xd
cmp word [esp + 0x18], ax
jne 0x4c6cb9
mov word [esi], ax
add esi, 2
jmp 0x4c6cee
pop eax
mov word [esi], ax
add esi, 2
mov ecx, dword [edx*4 + 0x52a778]
mov al, byte [esp + 0x14]
push 0xa
mov byte [ecx + ebx + 5], al
mov ecx, dword [edx*4 + 0x52a778]
mov al, byte [esp + 0x19]
mov byte [ecx + ebx + 0x25], al
mov eax, dword [edx*4 + 0x52a778]
pop ecx
mov byte [eax + ebx + 0x26], cl
push 0xd
pop ecx
cmp edi, dword [esp + 0x28]
jb 0x4c6c09
jmp 0x4c6d6b
cmp esi, ebp
jne 0x4c6d11
push 0xa
pop eax
cmp word [esp + 0x14], ax
jne 0x4c6d11
mov word [esi], ax
add esi, 2
jmp 0x4c6cec
push 1
push 0xffffffffffffffff
push 0xfffffffffffffffe
push dword [esp + 0x40]
call fcn.004cb3f6
mov edx, dword [esp + 0x28]
add esp, 0x10
push 0xa
pop eax
cmp word [esp + 0x14], ax
je 0x4c6cec
push 0xd
pop ecx
mov word [esi], cx
add esi, 2
jmp 0x4c6cef
mov edx, dword [esp + 0x18]
push 0xd
pop ecx
mov word [esi], cx
add esi, 2
jmp 0x4c6cef
mov ecx, dword [edx*4 + 0x52a778]
mov al, byte [ecx + ebx + 4]
test al, 0x40
jne 0x4c6d62
or al, 2
mov byte [ecx + ebx + 4], al
jmp 0x4c6d6b
mov ax, word [edi]
mov word [esi], ax
add esi, 2
mov edi, esi
sub edi, ebp
jmp 0x4c6b33
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 5
pop esi
cmp eax, esi
jne 0x4c6d98
call fcn.004c302f
mov dword [eax], 9
call fcn.004c2ffe
mov dword [eax], esi
jmp 0x4c686e
cmp eax, 0x6d
jne 0x4c6867
xor ebx, ebx
jmp 0x4c6b37
xor eax, eax
jmp 0x4c6dc6
call fcn.004c2ffe
mov dword [eax], ebp
call fcn.004c302f
mov dword [eax], 9
call fcn.004c467e
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x20
ret