Function at 0x4128a8
Capabilities:
Read file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x38
mov eax, dword [ebp + 8]
push ebx
push esi
mov esi, dword [ebp + 0x10]
push edi
push 0xfffffffffffffffe
pop ecx
xor edi, edi
mov dword [ebp - 0x24], ecx
mov dword [ebp - 0x2c], edi
mov dword [ebp - 0x30], esi
cmp eax, ecx
jne 0x4128e2
call fcn.0040aa0f
mov dword [eax], edi
call fcn.0040aa45
mov dword [eax], 9
jmp 0x41307d
test eax, eax
js 0x41305e
cmp eax, dword [0x417764]
jae 0x41305e
mov ecx, eax
and eax, 0x1f
sar ecx, 5
imul ebx, eax, 0x24
mov dword [ebp - 0x10], ecx
mov edx, dword [ecx*4 + 0x417780]
mov dword [ebp - 0x20], edx
mov al, byte [ebx + edx + 4]
mov byte [ebp - 2], al
test al, 1
je 0x41305e
cmp esi, 0x7fffffff
jbe 0x41293c
call fcn.0040aa0f
mov dword [eax], edi
call fcn.0040aa45
mov dword [eax], 0x16
jmp 0x413070
test esi, esi
je 0x41305a
test al, 2
jne 0x41305a
cmp dword [ebp + 0xc], edi
jne 0x41296f
call fcn.0040aa0f
xor ebx, ebx
mov dword [eax], ebx
call fcn.0040aa45
push ebx
push ebx
push ebx
push ebx
mov dword [eax], 0x16
push ebx
jmp 0x413075
mov eax, dword [ebx + edx + 8]
and eax, 3
mov dword [ebp - 0x28], eax
sub eax, 1
je 0x412996
sub eax, 1
jne 0x41298e
mov eax, esi
not eax
test al, 1
je 0x412951
and esi, 0xfffffffe
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0xc], eax
jmp 0x4129d7
mov eax, esi
not eax
test al, 1
je 0x412951
shr esi, 1
cmp esi, 4
jae 0x4129a8
push 4
pop esi
push esi
call fcn.0040ae7a
mov dword [ebp - 0xc], eax
pop ecx
test eax, eax
jne 0x4129d1
call fcn.0040aa45
mov dword [eax], 0xc
call fcn.0040aa0f
mov dword [eax], 8
jmp 0x41307d
mov ecx, dword [ebp - 0x10]
mov edx, dword [ebp - 0x20]
test byte [ebp - 2], 0x48
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x14], 0xa
je 0x412a70
mov dl, byte [ebx + edx + 5]
cmp dl, 0xa
je 0x412a70
test esi, esi
je 0x412a70
mov byte [eax], dl
xor edi, edi
lea edx, [eax + 1]
inc edi
mov eax, dword [ecx*4 + 0x417780]
dec esi
cmp dword [ebp - 0x28], 0
mov dword [ebp - 0x1c], edx
mov byte [ebx + eax + 5], 0xa
je 0x412a70
mov eax, dword [ecx*4 + 0x417780]
mov al, byte [ebx + eax + 6]
cmp al, 0xa
je 0x412a70
test esi, esi
je 0x412a70
mov byte [edx], al
inc edx
mov eax, dword [ecx*4 + 0x417780]
dec esi
cmp dword [ebp - 0x28], 1
push 2
mov dword [ebp - 0x1c], edx
pop edi
mov byte [ebx + eax + 6], 0xa
jne 0x412a70
mov eax, dword [ecx*4 + 0x417780]
mov al, byte [ebx + eax + 7]
cmp al, 0xa
je 0x412a70
test esi, esi
je 0x412a70
mov byte [edx], al
inc edx
mov eax, dword [ecx*4 + 0x417780]
dec esi
mov ecx, dword [ebp - 0x14]
push 3
mov dword [ebp - 0x1c], edx
pop edi
mov byte [ebx + eax + 7], cl
push dword [ebp + 8]
call fcn.0040ec97
test eax, eax
mov eax, dword [ebp - 0x10]
pop ecx
je 0x412af1
mov ecx, dword [eax*4 + 0x417780]
cmp byte [ebx + ecx + 4], 0
jge 0x412af1
lea eax, [ebp - 0x38]
push eax
push dword [ebx + ecx]
call dword [sym.imp.KERNEL32.dll_GetConsoleMode]
mov dword [ebp - 0x2c], eax
test eax, eax
je 0x412aee
cmp dword [ebp - 0x28], 2
jne 0x412aee
push 0
lea eax, [ebp - 0x20]
shr esi, 1
push eax
mov eax, dword [ebp - 0x10]
push esi
push dword [ebp - 0x1c]
mov eax, dword [eax*4 + 0x417780]
push dword [ebx + eax]
call dword [sym.imp.KERNEL32.dll_ReadConsoleW]
test eax, eax
jne 0x412ae3
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.0040aa22
pop ecx
or ebx, 0xffffffff
mov ecx, dword [ebp - 0xc]
jmp 0x412d9b
mov eax, dword [ebp - 0x20]
lea ecx, [eax + eax]
mov dword [ebp - 0x20], ecx
jmp 0x412b26
mov eax, dword [ebp - 0x10]
mov eax, dword [eax*4 + 0x417780]
lea ecx, [ebp - 0x20]
push 0
push ecx
push esi
push dword [ebp - 0x1c]
push dword [ebx + eax]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x413026
mov ecx, dword [ebp - 0x20]
test ecx, ecx
js 0x413026
cmp ecx, esi
ja 0x413026
mov edx, dword [ebp - 0x10]
add edi, ecx
mov esi, dword [edx*4 + 0x417780]
mov al, byte [ebx + esi + 4]
test al, al
jns 0x412d95
cmp dword [ebp - 0x28], 2
je 0x412db5
test ecx, ecx
mov ecx, dword [ebp - 0xc]
je 0x412b58
cmp byte [ecx], 0xa
jne 0x412b58
or al, 4
jmp 0x412b5a
and al, 0xfb
mov byte [ebx + esi + 4], al
add edi, ecx
mov dword [ebp - 0x2c], edi
mov eax, ecx
mov dword [ebp - 0x18], eax
mov esi, ecx
cmp ecx, edi
jae 0x412c98
mov dword [ebp - 0x1c], 0xd
mov al, byte [eax]
mov byte [ebp - 2], al
cmp al, 0x1a
je 0x412c7d
mov edi, dword [ebp - 0x18]
inc edi
cmp al, 0xd
je 0x412b9b
mov byte [esi], al
mov eax, edi
inc esi
mov dword [ebp - 0x18], eax
jmp 0x412c72
mov eax, dword [ebp - 0x2c]
dec eax
cmp dword [ebp - 0x18], eax
jae 0x412bcb
mov al, byte [edi]
mov byte [ebp - 3], al
cmp al, 0xa
jne 0x412bb3
mov eax, dword [ebp - 0x14]
mov byte [ebp - 2], al
xor eax, eax
cmp byte [ebp - 3], 0xa
sete al
inc eax
add dword [ebp - 0x18], eax
mov al, byte [ebp - 2]
mov byte [esi], al
inc esi
jmp 0x412c6f
push 0
lea eax, [ebp - 0x20]
mov dword [ebp - 0x18], edi
push eax
push 1
lea eax, [ebp - 1]
push eax
mov eax, dword [edx*4 + 0x417780]
push dword [ebx + eax]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x412bf8
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x412c63
cmp dword [ebp - 0x20], 0
je 0x412c63
mov edx, dword [ebp - 0x10]
mov eax, dword [edx*4 + 0x417780]
test byte [ebx + eax + 4], 0x48
je 0x412c31
mov eax, dword [ebp - 0x14]
cmp byte [ebp - 1], al
jne 0x412c1b
mov byte [esi], al
jmp 0x412c2e
mov eax, dword [ebp - 0x1c]
mov byte [esi], al
mov ecx, dword [edx*4 + 0x417780]
mov al, byte [ebp - 1]
mov byte [ebx + ecx + 5], al
inc esi
jmp 0x412c6c
mov ecx, dword [ebp - 0xc]
cmp esi, ecx
jne 0x412c45
mov eax, dword [ebp - 0x14]
cmp byte [ebp - 1], al
jne 0x412c45
mov byte [esi], al
inc esi
jmp 0x412c6f
push 1
push 0xffffffffffffffff
push 0xffffffffffffffff
push dword [ebp + 8]
call fcn.0040ee09
mov eax, dword [ebp - 0x14]
add esp, 0x10
mov edx, dword [ebp - 0x10]
cmp byte [ebp - 1], al
je 0x412c6c
jmp 0x412c66
mov edx, dword [ebp - 0x10]
mov eax, dword [ebp - 0x1c]
mov byte [esi], al
inc esi
mov ecx, dword [ebp - 0xc]
mov eax, dword [ebp - 0x18]
cmp eax, dword [ebp - 0x2c]
jb 0x412b79
jmp 0x412c98
mov edx, dword [edx*4 + 0x417780]
mov al, byte [ebx + edx + 4]
test al, 0x40
jne 0x412c94
or al, 2
mov byte [ebx + edx + 4], al
jmp 0x412c98
mov byte [esi], 0x1a
inc esi
mov edi, esi
mov edx, esi
sub edi, ecx
cmp dword [ebp - 0x28], 1
jne 0x412d98
test edi, edi
je 0x412d98
dec esi
mov al, byte [esi]
test al, al
js 0x412cbe
mov esi, edx
jmp 0x412d63
xor edx, edx
movzx eax, al
inc edx
jmp 0x412cd4
cmp edx, 4
jg 0x412cdd
cmp esi, ecx
jb 0x412cdd
dec esi
inc edx
movzx eax, byte [esi]
cmp byte [eax + 0x402f98], 0
je 0x412cc6
movzx eax, byte [esi]
movsx eax, byte [eax + 0x402f98]
test eax, eax
jne 0x412cfb
call fcn.0040aa45
mov dword [eax], 0x2a
jmp 0x412ad8
inc eax
cmp eax, edx
jne 0x412d04
add esi, edx
jmp 0x412d63
mov eax, dword [ebp - 0x10]
mov ecx, dword [eax*4 + 0x417780]
test byte [ebx + ecx + 4], 0x48
je 0x412d4c
mov al, byte [esi]
inc esi
mov byte [ebx + ecx + 5], al
mov eax, dword [ebp - 0x10]
cmp edx, 2
jl 0x412d35
mov ecx, dword [eax*4 + 0x417780]
mov al, byte [esi]
inc esi
mov byte [ebx + ecx + 6], al
mov eax, dword [ebp - 0x10]
cmp edx, 3
jne 0x412d48
mov ecx, dword [eax*4 + 0x417780]
mov al, byte [esi]
inc esi
mov byte [ebx + ecx + 7], al
sub esi, edx
jmp 0x412d60
neg edx
mov eax, edx
push 1
cdq
push edx
push eax
push dword [ebp + 8]
call fcn.0040ee09
add esp, 0x10
mov ecx, dword [ebp - 0xc]
mov edi, esi
mov esi, dword [ebp - 0x30]
mov eax, esi
sub edi, ecx
shr eax, 1
push eax
push dword [ebp + 0xc]
push edi
push ecx
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
test eax, eax
je 0x412acb
add eax, eax
cmp eax, esi
ja 0x412acb
mov edi, eax
mov ecx, dword [ebp - 0xc]
mov ebx, dword [ebp - 0x24]
cmp ecx, dword [ebp + 0xc]
je 0x412da7
push ecx
call fcn.0040af8f
pop ecx
cmp ebx, 0xfffffffe
je 0x412dae
mov edi, ebx
mov eax, edi
jmp 0x413080
cmp dword [ebp - 0x2c], 0
je 0x412e4d
mov ecx, dword [ebp - 0xc]
mov eax, edi
cdq
mov esi, ecx
sub eax, edx
mov dword [ebp - 0x18], ecx
sar eax, 1
lea edi, [ecx + eax*2]
cmp ecx, edi
jae 0x412e40
push 0x1a
pop eax
mov dword [ebp - 0x1c], 0xd
mov dword [ebp - 0x28], eax
movzx edx, word [esi]
cmp dx, ax
je 0x412e31
cmp dx, word [ebp - 0x1c]
je 0x412dfe
mov eax, dword [ebp - 0x18]
mov word [eax], dx
add eax, 2
add esi, 2
jmp 0x412e25
lea eax, [edi - 2]
cmp esi, eax
jae 0x412e28
mov eax, dword [ebp - 0x18]
add esi, 2
lea ecx, [eax + 2]
mov dword [ebp - 0x2c], ecx
mov ecx, dword [ebp - 0x14]
cmp word [esi], cx
mov ecx, dword [ebp - 0xc]
jne 0x412e1f
mov edx, dword [ebp - 0x14]
mov word [eax], dx
mov eax, dword [ebp - 0x2c]
mov dword [ebp - 0x18], eax
mov eax, dword [ebp - 0x28]
cmp esi, edi
jb 0x412de2
jmp 0x412e40
mov eax, dword [ebp - 0x10]
mov eax, dword [eax*4 + 0x417780]
or byte [ebx + eax + 4], 2
mov edi, dword [ebp - 0x18]
sub edi, ecx
and edi, 0xfffffffe
jmp 0x412d98
test ecx, ecx
mov ecx, dword [ebp - 0xc]
je 0x412e60
mov edx, dword [ebp - 0x14]
cmp word [ecx], dx
jne 0x412e60
or al, 4
jmp 0x412e62
and al, 0xfb
mov byte [ebx + esi + 4], al
lea edx, [edi - 1]
add edx, ecx
mov eax, ecx
mov dword [ebp - 0x38], edx
cmp ecx, edx
mov edx, dword [ebp - 0x10]
mov esi, ecx
mov dword [ebp - 0x18], eax
jae 0x41301d
mov dword [ebp - 0x1c], 0xd
mov dword [ebp - 0x28], 0x1a
movzx eax, word [eax]
mov dword [ebp - 0x30], eax
cmp ax, word [ebp - 0x28]
je 0x412ffd
mov edx, dword [ebp - 0x18]
add edx, 2
mov dword [ebp - 0x2c], edx
mov edx, dword [ebp - 0x10]
cmp ax, word [ebp - 0x1c]
je 0x412ec1
mov word [esi], ax
add esi, 2
mov eax, dword [ebp - 0x2c]
mov dword [ebp - 0x18], eax
jmp 0x412ff2
lea eax, [edi - 2]
add eax, ecx
cmp dword [ebp - 0x18], eax
mov eax, dword [ebp - 0x2c]
jae 0x412f0c
movzx edx, word [eax]
lea eax, [esi + 2]
mov dword [ebp - 0x34], eax
mov eax, dword [ebp - 0x14]
cmp dx, ax
je 0x412ee5
mov eax, dword [ebp - 0x30]
movzx eax, ax
mov dword [ebp - 0x2c], eax
xor eax, eax
cmp dx, word [ebp - 0x14]
mov edx, dword [ebp - 0x2c]
sete al
mov word [esi], dx
mov esi, dword [ebp - 0x34]
lea eax, [eax*2 + 2]
add eax, dword [ebp - 0x18]
mov dword [ebp - 0x18], eax
jmp 0x412fef
mov dword [ebp - 0x18], eax
lea eax, [ebp - 0x20]
push 0
push eax
push 2
lea eax, [ebp - 8]
push eax
mov eax, dword [edx*4 + 0x417780]
push dword [ebx + eax]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x412f3d
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x412fe0
cmp dword [ebp - 0x20], 0
je 0x412fe0
mov edx, dword [ebp - 0x10]
mov eax, dword [edx*4 + 0x417780]
test byte [ebx + eax + 4], 0x48
je 0x412fa6
mov ecx, dword [ebp - 0x14]
lea eax, [esi + 2]
mov dword [ebp - 0x34], eax
cmp word [ebp - 8], cx
jne 0x412f6c
mov word [esi], cx
jmp 0x412f9f
mov eax, dword [ebp - 0x1c]
mov word [esi], ax
mov ecx, dword [edx*4 + 0x417780]
mov al, byte [ebp - 8]
mov byte [ebx + ecx + 5], al
mov ecx, dword [edx*4 + 0x417780]
mov al, byte [ebp - 7]
mov byte [ebx + ecx + 6], al
mov eax, dword [edx*4 + 0x417780]
mov ecx, dword [ebp - 0x14]
mov byte [ebx + eax + 7], cl
mov eax, dword [ebp - 0x34]
mov ecx, dword [ebp - 0xc]
mov esi, eax
jmp 0x412fbc
mov ecx, dword [ebp - 0xc]
cmp esi, ecx
jne 0x412fc1
mov eax, dword [ebp - 0x14]
cmp word [ebp - 8], ax
jne 0x412fc1
mov word [esi], ax
add esi, 2
mov eax, dword [ebp - 0x18]
jmp 0x412ff2
push 1
push 0xffffffffffffffff
push 0xfffffffffffffffe
push dword [ebp + 8]
call fcn.0040ee09
mov eax, dword [ebp - 0x14]
add esp, 0x10
mov ecx, dword [ebp - 0xc]
cmp word [ebp - 8], ax
je 0x412fec
jmp 0x412fe3
mov ecx, dword [ebp - 0xc]
mov eax, dword [ebp - 0x1c]
mov word [esi], ax
add esi, 2
mov eax, dword [ebp - 0x18]
mov edx, dword [ebp - 0x10]
cmp eax, dword [ebp - 0x38]
jb 0x412e8e
jmp 0x41301d
mov edx, dword [edx*4 + 0x417780]
mov al, byte [ebx + edx + 4]
test al, 0x40
jne 0x413014
or al, 2
mov byte [ebx + edx + 4], al
jmp 0x41301d
mov eax, dword [ebp - 0x28]
mov word [esi], ax
add esi, 2
mov edi, esi
sub edi, ecx
jmp 0x412d98
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 5
pop esi
cmp eax, esi
jne 0x41304a
call fcn.0040aa45
mov dword [eax], 9
call fcn.0040aa0f
mov dword [eax], esi
jmp 0x412ad8
cmp eax, 0x6d
jne 0x412ad1
xor ebx, ebx
jmp 0x412adb
xor eax, eax
jmp 0x413080
call fcn.0040aa0f
mov dword [eax], edi
call fcn.0040aa45
mov dword [eax], 9
push edi
push edi
push edi
push edi
push edi
call fcn.0040aa9b
add esp, 0x14
or eax, 0xffffffff
pop edi
pop esi
pop ebx
leave
ret