Function at 0x512af0
Capabilities:
Read file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
mov eax, 0x1048
call fcn.0046a9b0
mov eax, dword [0x576040]
xor eax, ebp
mov dword [ebp - 4], eax
push esi
lea ecx, [ebp + 8]
call fcn.0046a34d
push eax
call fcn.0046d8a9
add esp, 4
mov dword [ebp - 0x100c], eax
lea ecx, [ebp + 8]
call fcn.0046ac2b
cmp dword [eax + 8], 0
jne 0x512b3a
mov eax, dword [ebp + 0xc]
mov edx, dword [ebp + 0x10]
jmp 0x512dfa
lea ecx, [ebp + 8]
call fcn.0046ac2b
mov esi, eax
lea ecx, [ebp + 8]
call fcn.0046ac2b
mov ecx, dword [esi]
sub ecx, dword [eax + 4]
mov eax, ecx
cdq
push 0
push 2
push edx
push eax
call fcn.0046d99e
mov dword [ebp - 0x1030], eax
mov dword [ebp - 0x102c], edx
mov edx, dword [ebp + 0x14]
push edx
push 0
mov eax, dword [ebp - 0x100c]
sar eax, 6
mov ecx, dword [ebp - 0x100c]
and ecx, 0x3f
imul edx, ecx, 0x38
mov eax, dword [eax*4 + 0x5796c8]
mov ecx, dword [eax + edx + 0x24]
push ecx
mov edx, dword [eax + edx + 0x20]
push edx
mov eax, dword [ebp - 0x100c]
push eax
call fcn.0046b892
add esp, 0x14
mov dword [ebp - 0x1038], eax
mov dword [ebp - 0x1034], edx
mov ecx, dword [ebp - 0x100c]
sar ecx, 6
mov edx, dword [ebp - 0x100c]
and edx, 0x3f
imul eax, edx, 0x38
mov ecx, dword [ecx*4 + 0x5796c8]
mov dword [ebp - 0x101c], ecx
mov dword [ebp - 0x1018], eax
mov edx, dword [ebp - 0x1018]
mov eax, dword [ebp - 0x101c]
mov ecx, dword [ebp - 0x1038]
cmp ecx, dword [eax + edx + 0x20]
jne 0x512c0a
mov edx, dword [ebp - 0x1018]
mov eax, dword [ebp - 0x101c]
mov ecx, dword [ebp - 0x1034]
cmp ecx, dword [eax + edx + 0x24]
je 0x512c15
or eax, 0xffffffff
or edx, 0xffffffff
jmp 0x512dfa
push 0
lea edx, [ebp - 0x1020]
push edx
push 0x1000
lea eax, [ebp - 0x1004]
push eax
mov ecx, dword [ebp - 0x100c]
sar ecx, 6
mov edx, dword [ebp - 0x100c]
and edx, 0x3f
imul eax, edx, 0x38
mov ecx, dword [ecx*4 + 0x5796c8]
mov edx, dword [ecx + eax + 0x18]
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x512c60
or eax, 0xffffffff
or edx, 0xffffffff
jmp 0x512dfa
mov eax, dword [ebp + 0x14]
push eax
push 0
mov ecx, dword [ebp + 0x10]
push ecx
mov edx, dword [ebp + 0xc]
push edx
mov eax, dword [ebp - 0x100c]
push eax
call fcn.0046b892
add esp, 0x14
mov dword [ebp - 0x1040], eax
mov dword [ebp - 0x103c], edx
cmp dword [ebp - 0x103c], 0
jg 0x512ca8
jl 0x512c9d
cmp dword [ebp - 0x1040], 0
jae 0x512ca8
or eax, 0xffffffff
or edx, 0xffffffff
jmp 0x512dfa
mov ecx, dword [ebp - 0x1020]
xor edx, edx
mov dword [ebp - 0x1048], ecx
mov dword [ebp - 0x1044], edx
mov eax, dword [ebp - 0x102c]
cmp eax, dword [ebp - 0x1044]
jl 0x512ce5
jg 0x512cda
mov ecx, dword [ebp - 0x1030]
cmp ecx, dword [ebp - 0x1048]
jbe 0x512ce5
or eax, 0xffffffff
or edx, 0xffffffff
jmp 0x512dfa
lea edx, [ebp - 0x1004]
mov dword [ebp - 0x1028], edx
mov eax, dword [ebp - 0x1020]
lea ecx, [ebp + eax - 0x1004]
mov dword [ebp - 0x1024], ecx
mov edx, dword [ebp - 0x1028]
mov dword [ebp - 0x1008], edx
xor eax, eax
xor ecx, ecx
mov dword [ebp - 0x1014], eax
mov dword [ebp - 0x1010], ecx
jmp 0x512d4f
mov edx, dword [ebp - 0x1014]
add edx, 1
mov eax, dword [ebp - 0x1010]
adc eax, 0
mov dword [ebp - 0x1014], edx
mov dword [ebp - 0x1010], eax
mov ecx, dword [ebp - 0x1008]
add ecx, 1
mov dword [ebp - 0x1008], ecx
mov edx, dword [ebp - 0x1014]
cmp edx, dword [ebp - 0x1030]
jne 0x512d6b
mov eax, dword [ebp - 0x1010]
cmp eax, dword [ebp - 0x102c]
je 0x512de1
mov ecx, dword [ebp - 0x1008]
cmp ecx, dword [ebp - 0x1024]
jae 0x512de1
mov edx, dword [ebp - 0x1008]
movsx eax, byte [edx]
cmp eax, 0xd
jne 0x512db8
mov ecx, dword [ebp - 0x1024]
sub ecx, 1
cmp dword [ebp - 0x1008], ecx
jae 0x512db6
mov edx, dword [ebp - 0x1008]
movsx eax, byte [edx + 1]
cmp eax, 0xa
jne 0x512db6
mov ecx, dword [ebp - 0x1008]
add ecx, 1
mov dword [ebp - 0x1008], ecx
jmp 0x512ddc
lfence
mov edx, dword [ebp - 0x1008]
movzx eax, byte [edx]
push eax
call fcn.0046c17f
add esp, 4
movsx ecx, al
add ecx, dword [ebp - 0x1008]
mov dword [ebp - 0x1008], ecx
jmp 0x512d22
mov eax, dword [ebp - 0x1008]
sub eax, dword [ebp - 0x1028]
cdq
add eax, dword [ebp - 0x1038]
adc edx, dword [ebp - 0x1034]
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0046b6ee
mov esp, ebp
pop ebp
ret