Function at 0x460f1d
Capabilities:
Read file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x28
mov ecx, dword [ebp + 8]
push ebx
push esi
mov esi, dword [ebp + 0x10]
push edi
push 0xfffffffffffffffe
pop eax
xor ebx, ebx
mov dword [ebp - 0x24], ebx
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x28], esi
cmp ecx, eax
jne 0x460f57
call fcn.00454181
mov dword [eax], ebx
call fcn.00454169
mov dword [eax], 9
jmp 0x46167f
test ecx, ecx
js 0x461660
cmp ecx, dword [0x56ab04]
jae 0x461660
mov eax, ecx
and ecx, 0x1f
imul ecx, ecx, 0x24
sar eax, 5
mov edx, dword [eax*4 + 0x56ab20]
mov dword [ebp - 0xc], eax
mov al, byte [ecx + edx + 4]
mov dword [ebp - 0x10], ecx
mov dword [ebp - 0x18], edx
mov byte [ebp + 0x13], al
test al, 1
je 0x461660
cmp esi, 0x7fffffff
jbe 0x460fb4
call fcn.00454181
mov dword [eax], ebx
call fcn.00454169
mov dword [eax], 0x16
jmp 0x461672
mov edi, ebx
test esi, esi
je 0x46165c
test al, 2
jne 0x46165c
cmp dword [ebp + 0xc], ebx
je 0x460f9d
mov eax, dword [ecx + edx + 8]
and eax, 3
mov dword [ebp - 0x20], eax
dec eax
je 0x460feb
dec eax
jne 0x460fe6
mov eax, esi
not eax
test al, 1
je 0x460f9d
and esi, 0xfffffffe
mov ebx, dword [ebp + 0xc]
jmp 0x46102b
mov eax, esi
not eax
test al, 1
je 0x460f9d
shr esi, 1
cmp esi, 4
jae 0x460ffd
push 4
pop esi
push esi
call fcn.0045328d
mov ebx, eax
pop ecx
test ebx, ebx
jne 0x461025
call fcn.00454169
mov dword [eax], 0xc
call fcn.00454181
mov dword [eax], 8
jmp 0x46167f
mov ecx, dword [ebp - 0x10]
mov edx, dword [ebp - 0x18]
test byte [ebp + 0x13], 0x48
mov dword [ebp - 0x18], ebx
je 0x4610d6
mov al, byte [ecx + edx + 5]
push 0xa
pop edx
cmp al, dl
je 0x4610d6
test esi, esi
je 0x4610d6
mov byte [ebx], al
mov eax, dword [ebp - 0xc]
mov eax, dword [eax*4 + 0x56ab20]
xor edi, edi
inc edi
lea edx, [ebx + 1]
dec esi
cmp dword [ebp - 0x20], 0
mov dword [ebp - 0x18], edx
mov byte [ecx + eax + 5], 0xa
je 0x4610d6
mov eax, dword [ebp - 0xc]
mov eax, dword [eax*4 + 0x56ab20]
mov al, byte [ecx + eax + 6]
cmp al, 0xa
je 0x4610d6
test esi, esi
je 0x4610d6
mov byte [edx], al
mov eax, dword [ebp - 0xc]
mov eax, dword [eax*4 + 0x56ab20]
inc edx
push 2
dec esi
cmp dword [ebp - 0x20], 1
mov dword [ebp - 0x18], edx
pop edi
mov byte [ecx + eax + 6], 0xa
jne 0x4610d6
mov eax, dword [ebp - 0xc]
mov eax, dword [eax*4 + 0x56ab20]
mov al, byte [ecx + eax + 7]
cmp al, 0xa
je 0x4610d6
test esi, esi
je 0x4610d6
mov byte [edx], al
mov eax, dword [ebp - 0xc]
mov eax, dword [eax*4 + 0x56ab20]
push 3
inc edx
pop edi
push 0xa
mov dword [ebp - 0x18], edx
pop edx
dec esi
mov byte [ecx + eax + 7], dl
push dword [ebp + 8]
call fcn.00460c9c
pop ecx
test eax, eax
je 0x461157
mov eax, dword [ebp - 0xc]
mov ecx, dword [eax*4 + 0x56ab20]
mov eax, dword [ebp - 0x10]
test byte [eax + ecx + 4], 0x80
je 0x461157
lea edx, [ebp - 0x24]
push edx
push dword [eax + ecx]
call dword [sym.imp.KERNEL32.dll_GetConsoleMode]
mov dword [ebp - 0x24], eax
test eax, eax
je 0x461157
cmp dword [ebp - 0x20], 2
jne 0x461157
mov ecx, dword [ebp - 0x10]
push 0
lea eax, [ebp - 0x14]
push eax
mov eax, dword [ebp - 0xc]
mov eax, dword [eax*4 + 0x56ab20]
shr esi, 1
push esi
push dword [ebp - 0x18]
push dword [ecx + eax]
call dword [sym.imp.KERNEL32.dll_ReadConsoleW]
test eax, eax
jne 0x46114c
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.00454199
pop ecx
or esi, 0xffffffff
jmp 0x4613f9
mov eax, dword [ebp - 0x14]
lea ecx, [eax + eax]
mov dword [ebp - 0x14], ecx
jmp 0x461192
mov ecx, dword [ebp - 0x10]
push 0
lea eax, [ebp - 0x14]
push eax
mov eax, dword [ebp - 0xc]
mov eax, dword [eax*4 + 0x56ab20]
push esi
push dword [ebp - 0x18]
push dword [ecx + eax]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x461628
mov ecx, dword [ebp - 0x14]
test ecx, ecx
js 0x461628
cmp ecx, esi
ja 0x461628
mov eax, dword [ebp - 0xc]
mov eax, dword [eax*4 + 0x56ab20]
mov edx, dword [ebp - 0x10]
add eax, edx
add edi, ecx
test byte [eax + 4], 0x80
je 0x4613f6
cmp dword [ebp - 0x20], 2
je 0x461413
test ecx, ecx
je 0x4611c8
push 0xa
pop ecx
cmp byte [ebx], cl
jne 0x4611c8
or byte [eax + 4], 4
jmp 0x4611cc
and byte [eax + 4], 0xfb
lea eax, [ebx + edi]
mov esi, ebx
mov dword [ebp - 0x18], eax
cmp ebx, eax
jae 0x4612ad
push 0xd
pop ecx
mov edi, ebx
mov al, byte [edi]
cmp al, 0x1a
je 0x461302
cmp al, cl
je 0x4611f8
mov byte [esi], al
inc esi
inc edi
jmp 0x4612a4
mov eax, dword [ebp - 0x18]
dec eax
cmp edi, eax
jae 0x46121f
lea eax, [edi + 1]
cmp byte [eax], 0xa
jne 0x461215
push 0xa
pop eax
add edi, 2
mov byte [esi], al
jmp 0x4612f4
mov byte [esi], cl
inc esi
mov edi, eax
jmp 0x4612a4
push 0
lea eax, [ebp - 0x14]
push eax
push 1
lea eax, [ebp + 0x13]
push eax
mov eax, dword [ebp - 0xc]
mov eax, dword [eax*4 + 0x56ab20]
push dword [edx + eax]
inc edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x461251
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x4612f7
cmp dword [ebp - 0x14], 0
je 0x4612f7
mov ecx, dword [ebp - 0xc]
mov eax, dword [ecx*4 + 0x56ab20]
mov edx, dword [ebp - 0x10]
test byte [edx + eax + 4], 0x48
je 0x461292
push 0xa
pop eax
push 0xd
cmp byte [ebp + 0x13], al
jne 0x46127e
mov byte [esi], al
inc esi
jmp 0x4612a3
mov byte [esi], 0xd
mov ecx, dword [ecx*4 + 0x56ab20]
mov al, byte [ebp + 0x13]
inc esi
mov byte [edx + ecx + 5], al
jmp 0x4612a3
cmp esi, ebx
jne 0x4612d3
push 0xa
pop eax
cmp byte [ebp + 0x13], al
jne 0x4612d3
mov byte [esi], al
inc esi
push 0xd
pop ecx
cmp edi, dword [ebp - 0x18]
jb 0x4611e1
mov ecx, dword [ebp - 0xc]
mov edi, esi
sub edi, ebx
cmp dword [ebp - 0x20], 1
jne 0x4613f6
test edi, edi
je 0x4613f6
dec esi
mov al, byte [esi]
test al, al
js 0x461322
inc esi
jmp 0x4613c4
push 1
push 0xffffffffffffffff
push 0xffffffffffffffff
push dword [ebp + 8]
call fcn.00460104
mov edx, dword [ebp - 0x10]
add esp, 0x10
push 0xa
pop eax
cmp byte [ebp + 0x13], al
je 0x4612a1
push 0xd
pop ecx
mov byte [esi], cl
inc esi
jmp 0x4612a4
mov edx, dword [ebp - 0x10]
push 0xd
pop ecx
mov byte [esi], cl
inc esi
jmp 0x4612a4
mov ecx, dword [ebp - 0xc]
mov eax, dword [ecx*4 + 0x56ab20]
add eax, 4
add eax, edx
test byte [eax], 0x40
jne 0x46131b
or byte [eax], 2
jmp 0x4612b0
mov al, byte [edi]
mov byte [esi], al
inc esi
jmp 0x4612b0
xor edx, edx
inc edx
movzx eax, al
jmp 0x461338
cmp edx, 4
jg 0x461341
cmp esi, ebx
jb 0x461341
dec esi
movzx eax, byte [esi]
inc edx
cmp byte [eax + 0x403910], 0
je 0x46132a
movzx eax, byte [esi]
movsx eax, byte [eax + 0x403910]
test eax, eax
jne 0x46135f
call fcn.00454169
mov dword [eax], 0x2a
jmp 0x461144
inc eax
cmp eax, edx
jne 0x461368
add esi, edx
jmp 0x4613c4
mov eax, dword [ecx*4 + 0x56ab20]
mov edi, dword [ebp - 0x10]
test byte [edi + eax + 4], 0x48
je 0x4613b0
mov cl, byte [esi]
inc esi
mov byte [edi + eax + 5], cl
mov ecx, dword [ebp - 0xc]
cmp edx, 2
jl 0x461399
mov ecx, dword [ecx*4 + 0x56ab20]
mov al, byte [esi]
mov byte [edi + ecx + 6], al
mov ecx, dword [ebp - 0xc]
inc esi
cmp edx, 3
jne 0x4613ac
mov al, byte [esi]
mov ecx, dword [ecx*4 + 0x56ab20]
mov byte [edi + ecx + 7], al
inc esi
sub esi, edx
jmp 0x4613c4
neg edx
mov eax, edx
cdq
push 1
push edx
push eax
push dword [ebp + 8]
call fcn.00460104
add esp, 0x10
mov edi, esi
mov esi, dword [ebp - 0x28]
mov eax, esi
shr eax, 1
push eax
push dword [ebp + 0xc]
sub edi, ebx
push edi
push ebx
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
test eax, eax
je 0x461137
add eax, eax
cmp eax, esi
ja 0x461137
mov edi, eax
mov esi, dword [ebp - 0x1c]
cmp ebx, dword [ebp + 0xc]
je 0x461405
push ebx
call fcn.0045126a
pop ecx
cmp esi, 0xfffffffe
je 0x46140c
mov edi, esi
mov eax, edi
jmp 0x461682
cmp dword [ebp - 0x24], 0
je 0x46148c
mov eax, edi
cdq
sub eax, edx
sar eax, 1
lea edx, [ebx + eax*2]
mov esi, ebx
mov ecx, ebx
cmp ebx, edx
jae 0x46147f
push 0x1a
pop edi
movzx eax, word [ecx]
cmp ax, di
je 0x46146d
push 0xd
pop edi
cmp ax, di
je 0x461449
mov word [esi], ax
add esi, 2
add ecx, 2
jmp 0x461464
lea eax, [edx - 2]
cmp ecx, eax
jae 0x461464
push 0xa
add ecx, 2
pop eax
cmp word [ecx], ax
je 0x46145e
push 0xd
pop eax
mov word [esi], ax
add esi, 2
push 0x1a
pop edi
cmp ecx, edx
jb 0x46142e
jmp 0x46147f
mov eax, dword [ebp - 0xc]
mov eax, dword [eax*4 + 0x56ab20]
mov ecx, dword [ebp - 0x10]
or byte [eax + ecx + 4], 2
mov edi, esi
sub edi, ebx
sar edi, 1
add edi, edi
jmp 0x4613f6
test ecx, ecx
je 0x46149e
push 0xa
pop ecx
cmp word [ebx], cx
jne 0x46149e
or byte [eax + 4], 4
jmp 0x4614a2
and byte [eax + 4], 0xfb
lea eax, [edi - 1]
add eax, ebx
mov esi, ebx
mov ecx, ebx
cmp ebx, eax
jae 0x46161f
mov dword [ebp - 0x24], 0xd
mov dword [ebp - 0x28], 0x1a
movzx eax, word [ecx]
cmp ax, word [ebp - 0x28]
je 0x4615fe
cmp ax, word [ebp - 0x24]
je 0x4614e2
mov word [esi], ax
add esi, 2
add ecx, 2
jmp 0x4615ef
lea eax, [edi - 2]
add eax, ebx
cmp ecx, eax
jae 0x46151e
push 0xa
lea eax, [ecx + 2]
pop edx
cmp word [eax], dx
mov edx, dword [ebp - 0x10]
mov dword [ebp - 0x20], eax
jne 0x46150d
push 0xa
pop eax
add ecx, 4
mov word [esi], ax
add esi, 2
jmp 0x4615ef
mov ecx, dword [ebp - 0x20]
push 0xd
pop eax
mov word [esi], ax
add esi, 2
jmp 0x4615ef
push 0
lea eax, [ebp - 0x14]
push eax
push 2
lea eax, [ebp - 8]
push eax
mov eax, dword [ebp - 0xc]
mov eax, dword [eax*4 + 0x56ab20]
push dword [edx + eax]
add ecx, 2
mov dword [ebp - 0x18], ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x461555
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x4615e0
cmp dword [ebp - 0x14], 0
je 0x4615e0
mov ecx, dword [ebp - 0xc]
mov eax, dword [ecx*4 + 0x56ab20]
mov edx, dword [ebp - 0x10]
test byte [edx + eax + 4], 0x48
je 0x4615b4
push 0xa
pop eax
cmp word [ebp - 8], ax
je 0x4615e6
push 0xd
pop eax
mov word [esi], ax
mov ecx, dword [ecx*4 + 0x56ab20]
mov al, byte [ebp - 8]
mov byte [edx + ecx + 5], al
mov eax, dword [ebp - 0xc]
mov ecx, dword [eax*4 + 0x56ab20]
mov al, byte [ebp - 7]
mov byte [edx + ecx + 6], al
mov eax, dword [ebp - 0xc]
mov eax, dword [eax*4 + 0x56ab20]
push 0xa
pop ecx
mov byte [edx + eax + 7], cl
jmp 0x4615e9
cmp esi, ebx
jne 0x4615c1
push 0xa
pop eax
cmp word [ebp - 8], ax
je 0x4615e6
push 1
push 0xffffffffffffffff
push 0xfffffffffffffffe
push dword [ebp + 8]
call fcn.00460104
mov edx, dword [ebp - 0x10]
add esp, 0x10
push 0xa
pop eax
cmp word [ebp - 8], ax
je 0x4615ec
jmp 0x4615e3
mov edx, dword [ebp - 0x10]
push 0xd
pop eax
mov word [esi], ax
add esi, 2
mov ecx, dword [ebp - 0x18]
lea eax, [edi - 1]
add eax, ebx
cmp ecx, eax
jb 0x4614c1
jmp 0x46161f
mov eax, dword [ebp - 0xc]
mov eax, dword [eax*4 + 0x56ab20]
test byte [eax + edx + 4], 0x40
jne 0x461616
or byte [eax + edx + 4], 2
jmp 0x46161f
mov ax, word [ecx]
mov word [esi], ax
add esi, 2
mov edi, esi
sub edi, ebx
jmp 0x4613f6
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 5
pop esi
cmp eax, esi
jne 0x46164c
call fcn.00454169
mov dword [eax], 9
call fcn.00454181
mov dword [eax], esi
jmp 0x461144
cmp eax, 0x6d
jne 0x46113d
xor esi, esi
jmp 0x4613f9
xor eax, eax
jmp 0x461682
call fcn.00454181
mov dword [eax], ebx
call fcn.00454169
mov dword [eax], 9
push ebx
push ebx
push ebx
push ebx
push ebx
call fcn.00457682
add esp, 0x14
or eax, 0xffffffff
pop edi
pop esi
pop ebx
leave
ret