Function at 0x4c6075
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 0x4c60b0
call fcn.004c2a4e
mov dword [eax], ebp
call fcn.004c2a7f
mov dword [eax], 9
jmp 0x4c6814
test eax, eax
js 0x4c67fd
cmp eax, dword [0x529ce8]
jae 0x4c67fd
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 + 0x5297b8]
mov al, byte [edx + ebx + 4]
test al, 1
je 0x4c67fd
cmp esi, 0x7fffffff
jbe 0x4c6107
call fcn.004c2a4e
mov dword [eax], ebp
call fcn.004c2a7f
mov dword [eax], 0x16
jmp 0x4c680f
mov edi, ebp
test esi, esi
je 0x4c67f9
test al, 2
jne 0x4c67f9
cmp dword [esp + 0x38], edi
je 0x4c60f0
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 0x4c6148
dec eax
jne 0x4c6142
mov eax, esi
not eax
test al, 1
je 0x4c60f0
and esi, 0xfffffffe
mov ebp, dword [esp + 0x38]
jmp 0x4c61a8
mov eax, esi
not eax
test al, 1
je 0x4c60f0
shr esi, 1
cmp esi, edx
cmovb esi, edx
push esi
call fcn.004c296d
mov ebp, eax
pop ecx
test ebp, ebp
jne 0x4c617f
call fcn.004c2a7f
mov dword [eax], 0xc
call fcn.004c2a4e
mov dword [eax], 8
jmp 0x4c6814
push 1
push 0
push 0
push dword [esp + 0x40]
call fcn.004cae55
mov ecx, dword [esp + 0x28]
add esp, 0x10
mov ecx, dword [ecx*4 + 0x5297b8]
mov dword [ecx + ebx + 0x28], eax
mov dword [ecx + ebx + 0x2c], edx
mov ecx, dword [esp + 0x18]
mov eax, dword [ecx*4 + 0x5297b8]
push 0xa
mov dword [esp + 0x28], ebp
pop edx
test byte [eax + ebx + 4], 0x48
je 0x4c624f
mov al, byte [eax + ebx + 5]
cmp al, dl
je 0x4c624f
test esi, esi
je 0x4c624f
mov byte [ebp], al
lea edx, [ebp + 1]
mov eax, dword [ecx*4 + 0x5297b8]
xor edi, edi
inc edi
mov dword [esp + 0x24], edx
dec esi
cmp byte [esp + 0x3c], 0
mov byte [eax + ebx + 5], 0xa
je 0x4c624f
mov eax, dword [ecx*4 + 0x5297b8]
mov al, byte [eax + ebx + 0x25]
cmp al, 0xa
je 0x4c624f
test esi, esi
je 0x4c624f
mov byte [edx], al
inc edx
mov eax, dword [ecx*4 + 0x5297b8]
dec esi
cmp byte [esp + 0x3c], 1
push 2
mov dword [esp + 0x28], edx
pop edi
mov byte [eax + ebx + 0x25], 0xa
jne 0x4c624f
mov eax, dword [ecx*4 + 0x5297b8]
mov al, byte [eax + ebx + 0x26]
cmp al, 0xa
je 0x4c624f
test esi, esi
je 0x4c624f
push 3
mov byte [edx], al
inc edx
mov eax, dword [ecx*4 + 0x5297b8]
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.004cd1ea
test eax, eax
mov eax, dword [esp + 0x1c]
pop ecx
je 0x4c62d8
mov ecx, dword [eax*4 + 0x5297b8]
test byte [ecx + ebx + 4], 0x80
je 0x4c62d8
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 0x4c62d4
cmp byte [esp + 0x3c], 2
jne 0x4c62d4
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 + 0x5297b8]
push dword [eax + ebx]
call dword [sym.imp.KERNEL32.dll_ReadConsoleW]
test eax, eax
jne 0x4c62c7
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.004c2a61
pop ecx
or ebx, 0xffffffff
jmp 0x4c6588
mov eax, dword [esp + 0x1c]
lea ecx, [eax + eax]
mov dword [esp + 0x1c], ecx
jmp 0x4c6310
mov eax, dword [esp + 0x18]
mov eax, dword [eax*4 + 0x5297b8]
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 0x4c67c5
mov ecx, dword [esp + 0x1c]
test ecx, ecx
js 0x4c67c5
cmp ecx, esi
ja 0x4c67c5
mov edx, dword [esp + 0x18]
add edi, ecx
mov esi, dword [edx*4 + 0x5297b8]
mov al, byte [esi + ebx + 4]
test al, al
jns 0x4c6584
cmp byte [esp + 0x3c], 2
je 0x4c65a2
test ecx, ecx
je 0x4c6344
push 0xa
pop ecx
cmp byte [ebp], cl
jne 0x4c6344
or al, 4
jmp 0x4c6346
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 0x4c647c
push 0xd
pop ecx
mov edi, ebp
mov al, byte [edi]
cmp al, 0x1a
je 0x4c6460
cmp al, cl
je 0x4c6377
mov byte [esi], al
inc esi
inc edi
jmp 0x4c6421
mov eax, dword [esp + 0x24]
dec eax
cmp edi, eax
jae 0x4c639f
lea eax, [edi + 1]
cmp byte [eax], 0xa
jne 0x4c6395
push 0xa
pop eax
add edi, 2
mov byte [esi], al
jmp 0x4c6451
mov byte [esi], cl
mov edi, eax
inc esi
jmp 0x4c6421
push 0
lea eax, [esp + 0x20]
inc edi
push eax
push 1
lea eax, [esp + 0x1f]
push eax
mov eax, dword [edx*4 + 0x5297b8]
push dword [eax + ebx]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x4c63d0
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x4c6454
cmp dword [esp + 0x1c], 0
je 0x4c6454
mov edx, dword [esp + 0x18]
mov eax, dword [edx*4 + 0x5297b8]
test byte [eax + ebx + 4], 0x48
je 0x4c640e
push 0xa
pop eax
push 0xd
cmp byte [esp + 0x17], al
jne 0x4c63f9
mov byte [esi], al
inc esi
jmp 0x4c6420
mov byte [esi], 0xd
inc esi
mov ecx, dword [edx*4 + 0x5297b8]
mov al, byte [esp + 0x17]
mov byte [ecx + ebx + 5], al
jmp 0x4c6420
cmp esi, ebp
jne 0x4c642d
push 0xa
pop eax
cmp byte [esp + 0x13], al
jne 0x4c642d
mov byte [esi], al
inc esi
push 0xd
pop ecx
cmp edi, dword [esp + 0x24]
jb 0x4c6360
jmp 0x4c647c
push 1
push 0xffffffffffffffff
push 0xffffffffffffffff
push dword [esp + 0x40]
call fcn.004cae55
mov edx, dword [esp + 0x28]
add esp, 0x10
push 0xa
pop eax
cmp byte [esp + 0x13], al
je 0x4c641e
push 0xd
pop ecx
mov byte [esi], cl
inc esi
jmp 0x4c6421
mov edx, dword [esp + 0x18]
push 0xd
pop ecx
mov byte [esi], cl
inc esi
jmp 0x4c6421
mov ecx, dword [edx*4 + 0x5297b8]
mov al, byte [ecx + ebx + 4]
test al, 0x40
jne 0x4c6477
or al, 2
mov byte [ecx + ebx + 4], al
jmp 0x4c647c
mov al, byte [edi]
mov byte [esi], al
inc esi
mov edi, esi
sub edi, ebp
cmp byte [esp + 0x3c], 1
jne 0x4c6584
test edi, edi
je 0x4c6584
dec esi
mov al, byte [esi]
test al, al
js 0x4c64a0
inc esi
jmp 0x4c6546
xor edx, edx
movzx eax, al
inc edx
jmp 0x4c64b6
cmp edx, 4
jg 0x4c64bf
cmp esi, ebp
jb 0x4c64bf
dec esi
inc edx
movzx eax, byte [esi]
cmp byte [eax + 0x517c30], 0
je 0x4c64a8
movzx eax, byte [esi]
movsx eax, byte [eax + 0x517c30]
test eax, eax
jne 0x4c64dd
call fcn.004c2a7f
mov dword [eax], 0x2a
jmp 0x4c62bf
inc eax
cmp eax, edx
jne 0x4c64e6
add esi, edx
jmp 0x4c6546
mov eax, dword [esp + 0x18]
mov ecx, dword [eax*4 + 0x5297b8]
test byte [ecx + ebx + 4], 0x48
je 0x4c6531
mov al, byte [esi]
inc esi
mov byte [ecx + ebx + 5], al
mov eax, dword [esp + 0x18]
cmp edx, 2
jl 0x4c651a
mov ecx, dword [eax*4 + 0x5297b8]
mov al, byte [esi]
inc esi
mov byte [ecx + ebx + 0x25], al
mov eax, dword [esp + 0x18]
cmp edx, 3
jne 0x4c652d
mov ecx, dword [eax*4 + 0x5297b8]
mov al, byte [esi]
inc esi
mov byte [ecx + ebx + 0x26], al
sub esi, edx
jmp 0x4c6546
neg edx
mov eax, edx
push 1
cdq
push edx
push eax
push dword [esp + 0x40]
call fcn.004cae55
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 0x4c62b2
mov eax, dword [esp + 0x18]
xor ecx, ecx
cmp edi, esi
setne cl
add edi, edi
mov eax, dword [eax*4 + 0x5297b8]
mov dword [eax + ebx + 0x30], ecx
mov ebx, dword [esp + 0x20]
cmp ebp, dword [esp + 0x38]
je 0x4c6595
push ebp
call fcn.004bb566
pop ecx
cmp ebx, 0xfffffffe
cmove ebx, edi
mov eax, ebx
jmp 0x4c6817
cmp dword [esp + 0x28], 0
je 0x4c6625
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 0x4c6619
push 0xd
mov dword [esp + 0x40], 0x1a
pop edi
movzx eax, word [ecx]
cmp ax, word [esp + 0x3c]
je 0x4c6609
cmp ax, di
je 0x4c65e6
mov word [esi], ax
add esi, 2
add ecx, 2
jmp 0x4c6603
lea eax, [edx - 2]
cmp ecx, eax
jae 0x4c6603
add ecx, 2
push 0xa
pop eax
cmp word [ecx], ax
je 0x4c65fd
push 0xd
pop eax
push eax
pop edi
mov word [esi], ax
add esi, 2
cmp ecx, edx
jb 0x4c65cc
jmp 0x4c6619
mov eax, dword [esp + 0x18]
mov eax, dword [eax*4 + 0x5297b8]
or byte [eax + ebx + 4], 2
mov edi, esi
sub edi, ebp
and edi, 0xfffffffe
jmp 0x4c6584
test ecx, ecx
je 0x4c6636
push 0xa
pop ecx
cmp word [ebp], cx
jne 0x4c6636
or al, 4
jmp 0x4c6638
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 0x4c67bc
push 0xd
pop ecx
mov dword [esp + 0x3c], 0x1a
mov edi, ebp
movzx eax, word [edi]
cmp ax, word [esp + 0x3c]
je 0x4c679c
cmp ax, cx
je 0x4c6672
mov word [esi], ax
jmp 0x4c669b
mov eax, dword [esp + 0x28]
add eax, 0xfffffffe
cmp edi, eax
jae 0x4c66a6
push 0xa
pop edx
cmp word [edi + 2], dx
mov edx, dword [esp + 0x18]
jne 0x4c6698
push 0xa
pop eax
add edi, 4
mov word [esi], ax
jmp 0x4c6788
mov word [esi], cx
add esi, 2
add edi, 2
jmp 0x4c6740
push 0
lea eax, [esp + 0x20]
add edi, 2
push eax
push 2
lea eax, [esp + 0x20]
push eax
mov eax, dword [edx*4 + 0x5297b8]
push dword [eax + ebx]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x4c66d9
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x4c678d
cmp dword [esp + 0x1c], 0
je 0x4c678d
mov edx, dword [esp + 0x18]
mov eax, dword [edx*4 + 0x5297b8]
test byte [eax + ebx + 4], 0x48
je 0x4c674c
push 0xa
pop eax
push 0xd
cmp word [esp + 0x18], ax
jne 0x4c670a
mov word [esi], ax
add esi, 2
jmp 0x4c673f
pop eax
mov word [esi], ax
add esi, 2
mov ecx, dword [edx*4 + 0x5297b8]
mov al, byte [esp + 0x14]
push 0xa
mov byte [ecx + ebx + 5], al
mov ecx, dword [edx*4 + 0x5297b8]
mov al, byte [esp + 0x19]
mov byte [ecx + ebx + 0x25], al
mov eax, dword [edx*4 + 0x5297b8]
pop ecx
mov byte [eax + ebx + 0x26], cl
push 0xd
pop ecx
cmp edi, dword [esp + 0x28]
jb 0x4c665a
jmp 0x4c67bc
cmp esi, ebp
jne 0x4c6762
push 0xa
pop eax
cmp word [esp + 0x14], ax
jne 0x4c6762
mov word [esi], ax
add esi, 2
jmp 0x4c673d
push 1
push 0xffffffffffffffff
push 0xfffffffffffffffe
push dword [esp + 0x40]
call fcn.004cae55
mov edx, dword [esp + 0x28]
add esp, 0x10
push 0xa
pop eax
cmp word [esp + 0x14], ax
je 0x4c673d
push 0xd
pop ecx
mov word [esi], cx
add esi, 2
jmp 0x4c6740
mov edx, dword [esp + 0x18]
push 0xd
pop ecx
mov word [esi], cx
add esi, 2
jmp 0x4c6740
mov ecx, dword [edx*4 + 0x5297b8]
mov al, byte [ecx + ebx + 4]
test al, 0x40
jne 0x4c67b3
or al, 2
mov byte [ecx + ebx + 4], al
jmp 0x4c67bc
mov ax, word [edi]
mov word [esi], ax
add esi, 2
mov edi, esi
sub edi, ebp
jmp 0x4c6584
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 5
pop esi
cmp eax, esi
jne 0x4c67e9
call fcn.004c2a7f
mov dword [eax], 9
call fcn.004c2a4e
mov dword [eax], esi
jmp 0x4c62bf
cmp eax, 0x6d
jne 0x4c62b8
xor ebx, ebx
jmp 0x4c6588
xor eax, eax
jmp 0x4c6817
call fcn.004c2a4e
mov dword [eax], ebp
call fcn.004c2a7f
mov dword [eax], 9
call fcn.004c40ce
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x20
ret