Function at 0x10051f96
Capabilities:
Read file on windows

Disassembly:
push ebp
lea ebp, [esp - 0xfa0]
mov eax, 0x1020
call fcn.10042c60
mov eax, dword [0x10086e84]
xor eax, ebp
mov dword [ebp + 0xf9c], eax
push ebx
push esi
mov esi, dword [ebp + 0xfa8]
push edi
push esi
call fcn.1005171a
mov ebx, eax
xor eax, eax
cmp dword [esi + 4], eax
pop ecx
mov dword [ebp - 0x78], ebx
jge 0x10051fd4
mov dword [esi + 4], eax
push 1
push eax
push eax
push ebx
call fcn.1005d83a
add esp, 0x10
test edx, edx
mov edi, eax
mov dword [ebp - 0x74], edi
mov dword [ebp - 0x70], edx
jg 0x10051ffd
jl 0x10051ff3
test edi, edi
jae 0x10051ffd
or eax, 0xffffffff
or edx, eax
jmp 0x10052258
mov eax, ebx
sar eax, 5
lea eax, [eax*4 + 0x1008a120]
and ebx, 0x1f
mov dword [ebp - 0x7c], eax
mov eax, dword [eax]
shl ebx, 6
add eax, ebx
mov cl, byte [eax + 0x24]
add cl, cl
sar cl, 1
test word [esi + 0xc], 0x108
mov byte [ebp - 0x65], cl
jne 0x1005203c
mov eax, dword [esi + 4]
mov ecx, dword [ebp - 0x70]
cdq
sub edi, eax
sbb ecx, edx
mov eax, edi
mov edx, ecx
jmp 0x10052258
mov ecx, dword [esi]
mov edx, dword [esi + 8]
mov edi, ecx
sub edi, edx
mov edx, dword [esi + 0xc]
test dl, 3
mov dword [ebp - 0x6c], edi
je 0x10052172
cmp byte [ebp - 0x65], 1
jne 0x1005214a
xor edx, edx
cmp dword [eax + 0x30], edx
je 0x1005214a
shr edi, 1
cmp dword [esi + 4], edx
mov dword [ebp - 0x80], edi
jne 0x1005207e
mov eax, dword [ebp - 0x74]
mov edx, dword [ebp - 0x70]
jmp 0x10052258
push edx
push dword [eax + 0x2c]
push dword [eax + 0x28]
push dword [ebp - 0x78]
call fcn.1005d83a
mov esi, eax
mov eax, dword [ebp - 0x7c]
mov eax, dword [eax]
add eax, ebx
add esp, 0x10
cmp esi, dword [eax + 0x28]
mov edi, edx
jne 0x10051ff3
cmp edi, dword [eax + 0x2c]
jne 0x10051ff3
push 0
lea ecx, [ebp - 0x6c]
push ecx
push 0x1000
lea ecx, [ebp - 0x64]
push ecx
push dword [eax]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x10051ff3
push 0
push dword [ebp - 0x70]
push dword [ebp - 0x74]
push dword [ebp - 0x78]
call fcn.1005d83a
add esp, 0x10
test edx, edx
jg 0x100520f1
jl 0x10051ff3
test eax, eax
jb 0x10051ff3
mov ecx, dword [ebp - 0x6c]
mov ebx, dword [ebp - 0x80]
cmp ebx, ecx
ja 0x10051ff3
test ebx, ebx
lea eax, [ebp - 0x64]
je 0x1005213a
lea edx, [ebp + ecx - 0x64]
dec ebx
cmp eax, edx
jae 0x1005213a
mov cl, byte [eax]
cmp cl, 0xd
jne 0x10052129
lea ecx, [edx - 1]
cmp eax, ecx
jae 0x10052135
lea ecx, [eax + 1]
cmp byte [ecx], 0xa
jne 0x10052135
mov eax, ecx
jmp 0x10052135
movzx ecx, cl
movsx ecx, byte [ecx + 0x10087df0]
add eax, ecx
inc eax
test ebx, ebx
jne 0x1005210a
lea ecx, [ebp - 0x64]
sub eax, ecx
xor edx, edx
add eax, esi
adc edx, edi
jmp 0x10052258
test byte [eax + 4], 0x80
je 0x10052162
mov edx, dword [esi + 8]
jmp 0x1005215e
cmp byte [edx], 0xa
jne 0x1005215d
inc dword [ebp - 0x6c]
inc edx
cmp edx, ecx
jb 0x10052155
mov edx, dword [ebp - 0x74]
or edx, dword [ebp - 0x70]
jne 0x10052186
mov eax, dword [ebp - 0x6c]
jmp 0x10052258
test dl, dl
js 0x10052162
call fcn.10049277
mov dword [eax], 0x16
jmp 0x10051ff3
test byte [esi + 0xc], 1
je 0x10052244
mov edx, dword [esi + 4]
test edx, edx
jne 0x1005219f
and dword [ebp - 0x6c], edx
jmp 0x10052244
sub ecx, dword [esi + 8]
add ecx, edx
test byte [eax + 4], 0x80
mov edi, ecx
je 0x10052235
push 2
push 0
push 0
push dword [ebp - 0x78]
call fcn.1005d83a
add esp, 0x10
cmp eax, dword [ebp - 0x74]
jne 0x100521e6
cmp edx, dword [ebp - 0x70]
jne 0x100521e6
mov eax, dword [esi + 8]
lea ecx, [eax + edi]
jmp 0x100521da
cmp byte [eax], 0xa
jne 0x100521d9
inc edi
inc eax
cmp eax, ecx
jb 0x100521d3
test word [esi + 0xc], 0x2000
jmp 0x10052232
push 0
push dword [ebp - 0x70]
push dword [ebp - 0x74]
push dword [ebp - 0x78]
call fcn.1005d83a
add esp, 0x10
test edx, edx
jg 0x1005220b
jl 0x10051ff3
test eax, eax
jb 0x10051ff3
mov eax, 0x200
cmp edi, eax
ja 0x10052225
mov ecx, dword [esi + 0xc]
test cl, 8
je 0x10052225
test cx, 0x400
mov edi, eax
je 0x10052228
mov edi, dword [esi + 0x18]
mov eax, dword [ebp - 0x7c]
mov eax, dword [eax]
test byte [eax + ebx + 4], 4
je 0x10052235
inc edi
cmp byte [ebp - 0x65], 1
jne 0x1005223d
shr edi, 1
sub dword [ebp - 0x74], edi
sbb dword [ebp - 0x70], 0
cmp byte [ebp - 0x65], 1
jne 0x1005224d
shr dword [ebp - 0x6c], 1
mov eax, dword [ebp - 0x6c]
xor edx, edx
add eax, dword [ebp - 0x74]
adc edx, dword [ebp - 0x70]
mov ecx, dword [ebp + 0xf9c]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.10041ffa
add ebp, 0xfa0
leave
ret