Function at 0x412490
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x20
mov eax, dword [ebp + 8]
cmp eax, dword [0x419cac]
jae 0x4124be
mov ecx, dword [ebp + 8]
sar ecx, 5
mov edx, dword [ebp + 8]
and edx, 0x1f
mov eax, dword [ecx*4 + 0x419cc0]
movsx ecx, byte [eax + edx*8 + 4]
and ecx, 1
jne 0x4124da
mov dword [0x41876c], 9
mov dword [0x418770], 0
or eax, 0xffffffff
jmp 0x4128d8
mov dword [ebp - 0x18], 0
mov edx, dword [ebp + 0xc]
mov dword [ebp - 0x1c], edx
cmp dword [ebp + 0x10], 0
je 0x41250a
mov eax, dword [ebp + 8]
sar eax, 5
mov ecx, dword [ebp + 8]
and ecx, 0x1f
mov edx, dword [eax*4 + 0x419cc0]
movsx eax, byte [edx + ecx*8 + 4]
and eax, 2
je 0x412511
xor eax, eax
jmp 0x4128d8
mov ecx, dword [ebp + 8]
sar ecx, 5
mov edx, dword [ebp + 8]
and edx, 0x1f
mov eax, dword [ecx*4 + 0x419cc0]
movsx ecx, byte [eax + edx*8 + 4]
and ecx, 0x48
je 0x41259a
mov edx, dword [ebp + 8]
sar edx, 5
mov eax, dword [ebp + 8]
and eax, 0x1f
mov ecx, dword [edx*4 + 0x419cc0]
movsx edx, byte [ecx + eax*8 + 5]
cmp edx, 0xa
je 0x41259a
mov eax, dword [ebp + 8]
sar eax, 5
mov ecx, dword [ebp + 8]
and ecx, 0x1f
mov edx, dword [eax*4 + 0x419cc0]
mov eax, dword [ebp - 0x1c]
mov cl, byte [edx + ecx*8 + 5]
mov byte [eax], cl
mov edx, dword [ebp - 0x1c]
add edx, 1
mov dword [ebp - 0x1c], edx
mov eax, dword [ebp - 0x18]
add eax, 1
mov dword [ebp - 0x18], eax
mov ecx, dword [ebp + 0x10]
sub ecx, 1
mov dword [ebp + 0x10], ecx
mov edx, dword [ebp + 8]
sar edx, 5
mov eax, dword [ebp + 8]
and eax, 0x1f
mov ecx, dword [edx*4 + 0x419cc0]
mov byte [ecx + eax*8 + 5], 0xa
push 0
lea edx, [ebp - 0xc]
push edx
mov eax, dword [ebp + 0x10]
push eax
mov ecx, dword [ebp - 0x1c]
push ecx
mov edx, dword [ebp + 8]
sar edx, 5
mov eax, dword [ebp + 8]
and eax, 0x1f
mov ecx, dword [edx*4 + 0x419cc0]
mov edx, dword [ecx + eax*8]
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x412613
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 5
jne 0x4125f2
mov dword [0x41876c], 9
mov eax, dword [ebp - 0x10]
mov dword [0x418770], eax
or eax, 0xffffffff
jmp 0x4128d8
cmp dword [ebp - 0x10], 0x6d
jne 0x4125ff
xor eax, eax
jmp 0x4128d8
mov ecx, dword [ebp - 0x10]
push ecx
call fcn.0040e9c0
add esp, 4
or eax, 0xffffffff
jmp 0x4128d8
mov edx, dword [ebp - 0x18]
add edx, dword [ebp - 0xc]
mov dword [ebp - 0x18], edx
mov eax, dword [ebp + 8]
sar eax, 5
mov ecx, dword [ebp + 8]
and ecx, 0x1f
mov edx, dword [eax*4 + 0x419cc0]
movsx eax, byte [edx + ecx*8 + 4]
and eax, 0x80
je 0x4128d5
cmp dword [ebp - 0xc], 0
je 0x412684
mov ecx, dword [ebp + 0xc]
movsx edx, byte [ecx]
cmp edx, 0xa
jne 0x412684
mov eax, dword [ebp + 8]
sar eax, 5
mov ecx, dword [ebp + 8]
and ecx, 0x1f
mov edx, dword [eax*4 + 0x419cc0]
movsx eax, byte [edx + ecx*8 + 4]
or eax, 4
mov ecx, dword [ebp + 8]
sar ecx, 5
mov edx, dword [ebp + 8]
and edx, 0x1f
mov ecx, dword [ecx*4 + 0x419cc0]
mov byte [ecx + edx*8 + 4], al
jmp 0x4126b6
mov edx, dword [ebp + 8]
sar edx, 5
mov eax, dword [ebp + 8]
and eax, 0x1f
mov ecx, dword [edx*4 + 0x419cc0]
movsx edx, byte [ecx + eax*8 + 4]
and edx, 0xfffffffb
mov eax, dword [ebp + 8]
sar eax, 5
mov ecx, dword [ebp + 8]
and ecx, 0x1f
mov eax, dword [eax*4 + 0x419cc0]
mov byte [eax + ecx*8 + 4], dl
mov ecx, dword [ebp + 0xc]
mov dword [ebp - 0x14], ecx
mov edx, dword [ebp - 0x14]
mov dword [ebp - 4], edx
mov eax, dword [ebp + 0xc]
add eax, dword [ebp - 0x18]
cmp dword [ebp - 4], eax
jae 0x4128cc
mov ecx, dword [ebp - 4]
movsx edx, byte [ecx]
cmp edx, 0x1a
jne 0x412730
mov eax, dword [ebp + 8]
sar eax, 5
mov ecx, dword [ebp + 8]
and ecx, 0x1f
mov edx, dword [eax*4 + 0x419cc0]
movsx eax, byte [edx + ecx*8 + 4]
and eax, 0x40
jne 0x41272b
mov ecx, dword [ebp + 8]
sar ecx, 5
mov edx, dword [ebp + 8]
and edx, 0x1f
mov eax, dword [ecx*4 + 0x419cc0]
movsx ecx, byte [eax + edx*8 + 4]
or ecx, 2
mov edx, dword [ebp + 8]
sar edx, 5
mov eax, dword [ebp + 8]
and eax, 0x1f
mov edx, dword [edx*4 + 0x419cc0]
mov byte [edx + eax*8 + 4], cl
jmp 0x4128cc
mov eax, dword [ebp - 4]
movsx ecx, byte [eax]
cmp ecx, 0xd
je 0x41275c
mov edx, dword [ebp - 0x14]
mov eax, dword [ebp - 4]
mov cl, byte [eax]
mov byte [edx], cl
mov edx, dword [ebp - 0x14]
add edx, 1
mov dword [ebp - 0x14], edx
mov eax, dword [ebp - 4]
add eax, 1
mov dword [ebp - 4], eax
jmp 0x4128c7
mov ecx, dword [ebp - 0x18]
mov edx, dword [ebp + 0xc]
lea eax, [edx + ecx - 1]
cmp dword [ebp - 4], eax
jae 0x4127b2
mov ecx, dword [ebp - 4]
movsx edx, byte [ecx + 1]
cmp edx, 0xa
jne 0x412791
mov eax, dword [ebp - 4]
add eax, 2
mov dword [ebp - 4], eax
mov ecx, dword [ebp - 0x14]
mov byte [ecx], 0xa
mov edx, dword [ebp - 0x14]
add edx, 1
mov dword [ebp - 0x14], edx
jmp 0x4127ad
mov eax, dword [ebp - 0x14]
mov ecx, dword [ebp - 4]
mov dl, byte [ecx]
mov byte [eax], dl
mov eax, dword [ebp - 0x14]
add eax, 1
mov dword [ebp - 0x14], eax
mov ecx, dword [ebp - 4]
add ecx, 1
mov dword [ebp - 4], ecx
jmp 0x4128c7
mov edx, dword [ebp - 4]
add edx, 1
mov dword [ebp - 4], edx
mov dword [ebp - 0x10], 0
push 0
lea eax, [ebp - 0xc]
push eax
push 1
lea ecx, [ebp - 5]
push ecx
mov edx, dword [ebp + 8]
sar edx, 5
mov eax, dword [ebp + 8]
and eax, 0x1f
mov ecx, dword [edx*4 + 0x419cc0]
mov edx, dword [ecx + eax*8]
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x4127f8
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
jne 0x412804
cmp dword [ebp - 0xc], 0
jne 0x412818
mov eax, dword [ebp - 0x14]
mov byte [eax], 0xd
mov ecx, dword [ebp - 0x14]
add ecx, 1
mov dword [ebp - 0x14], ecx
jmp 0x4128c7
mov edx, dword [ebp + 8]
sar edx, 5
mov eax, dword [ebp + 8]
and eax, 0x1f
mov ecx, dword [edx*4 + 0x419cc0]
movsx edx, byte [ecx + eax*8 + 4]
and edx, 0x48
je 0x41287a
movsx eax, byte [ebp - 5]
cmp eax, 0xa
jne 0x41284f
mov ecx, dword [ebp - 0x14]
mov byte [ecx], 0xa
mov edx, dword [ebp - 0x14]
add edx, 1
mov dword [ebp - 0x14], edx
jmp 0x412878
mov eax, dword [ebp - 0x14]
mov byte [eax], 0xd
mov ecx, dword [ebp - 0x14]
add ecx, 1
mov dword [ebp - 0x14], ecx
mov edx, dword [ebp + 8]
sar edx, 5
mov eax, dword [ebp + 8]
and eax, 0x1f
mov ecx, dword [edx*4 + 0x419cc0]
mov dl, byte [ebp - 5]
mov byte [ecx + eax*8 + 5], dl
jmp 0x4128c7
mov eax, dword [ebp - 0x14]
cmp eax, dword [ebp + 0xc]
jne 0x41289c
movsx ecx, byte [ebp - 5]
cmp ecx, 0xa
jne 0x41289c
mov edx, dword [ebp - 0x14]
mov byte [edx], 0xa
mov eax, dword [ebp - 0x14]
add eax, 1
mov dword [ebp - 0x14], eax
jmp 0x4128c7
push 1
push 0xffffffffffffffff
mov ecx, dword [ebp + 8]
push ecx
call fcn.004120d0
add esp, 0xc
mov dword [ebp - 0x20], eax
movsx edx, byte [ebp - 5]
cmp edx, 0xa
je 0x4128c7
mov eax, dword [ebp - 0x14]
mov byte [eax], 0xd
mov ecx, dword [ebp - 0x14]
add ecx, 1
mov dword [ebp - 0x14], ecx
jmp 0x4126c2
mov edx, dword [ebp - 0x14]
sub edx, dword [ebp + 0xc]
mov dword [ebp - 0x18], edx
mov eax, dword [ebp - 0x18]
mov esp, ebp
pop ebp
ret