Function at 0x10051970
Capabilities:
Read file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x28
push esi
lea ecx, [ebp + 8]
call fcn.1002c150
movzx eax, al
test eax, eax
je 0x10051991
mov dword [ebp - 4], 1
jmp 0x10051998
mov dword [ebp - 4], 0
mov ecx, dword [ebp - 4]
mov dword [ebp - 8], ecx
cmp dword [ebp - 8], 0
jne 0x100519c7
push str.stream.valid__
push 0x1006e254
push 0
push 0x7e
push str.minkernelcrtsucrt_src_appcrt_stdio_filbuf.cpp
push 2
call fcn.1002a270
add esp, 0x18
cmp eax, 1
jne 0x100519c7
int3
cmp dword [ebp - 8], 0
jne 0x100519fb
call fcn.10043280
mov dword [eax], 0x16
push 0
push 0x7e
push str.minkernelcrtsucrt_src_appcrt_stdio_filbuf.cpp
push str.common_refill_and_read_nolock
push str.stream.valid__
call fcn.1002ae80
add esp, 0x14
or eax, 0xffffffff
jmp 0x10051c3d
lea ecx, [ebp + 8]
call fcn.1002c600
movzx eax, al
test eax, eax
je 0x10051a19
lea ecx, [ebp + 8]
call fcn.1002a9c0
movzx ecx, al
test ecx, ecx
je 0x10051a21
or eax, 0xffffffff
jmp 0x10051c3d
push 2
lea ecx, [ebp + 8]
call fcn.1002bfe0
movzx edx, al
test edx, edx
je 0x10051a44
push 0x10
lea ecx, [ebp + 8]
call fcn.1002c0b0
or eax, 0xffffffff
jmp 0x10051c3d
push 1
lea ecx, [ebp + 8]
call fcn.1002c0b0
lea ecx, [ebp + 8]
call fcn.100383c0
movzx eax, al
test eax, eax
jne 0x10051a6e
lea ecx, [ebp + 8]
call fcn.1002a5f0
push eax
call fcn.10053910
add esp, 4
push 0
mov ecx, dword [ebp + 8]
push ecx
call fcn.1002a950
add esp, 8
mov dword [ebp - 0x28], eax
lea ecx, [ebp + 8]
call fcn.1002a5f0
mov edx, dword [eax + 4]
mov dword [ebp - 0x14], edx
lea ecx, [ebp + 8]
call fcn.1002a5f0
mov ecx, dword [ebp - 0x14]
mov dword [eax], ecx
lea ecx, [ebp + 8]
call fcn.1002a5f0
mov edx, dword [eax + 0x18]
mov dword [ebp - 0x18], edx
lea ecx, [ebp + 8]
call fcn.1002a5f0
mov eax, dword [eax + 4]
mov dword [ebp - 0x1c], eax
lea ecx, [ebp + 8]
call fcn.1002a5f0
push eax
call fcn.10048c20
add esp, 4
mov dword [ebp - 0x20], eax
mov ecx, dword [ebp - 0x18]
push ecx
mov edx, dword [ebp - 0x1c]
push edx
mov eax, dword [ebp - 0x20]
push eax
call fcn.10054470
add esp, 0xc
mov dword [ebp - 0x24], eax
lea ecx, [ebp + 8]
call fcn.1002a5f0
mov ecx, dword [ebp - 0x24]
mov dword [eax + 8], ecx
push 0
mov edx, dword [ebp + 8]
push edx
call fcn.10051f70
add esp, 8
movzx eax, al
test eax, eax
jne 0x10051b45
lea ecx, [ebp + 8]
call fcn.1002a5f0
cmp dword [eax + 8], 0
je 0x10051b1b
mov dword [ebp - 0xc], 0x10
jmp 0x10051b22
mov dword [ebp - 0xc], 8
mov ecx, dword [ebp - 0xc]
push ecx
lea ecx, [ebp + 8]
call fcn.1002c0b0
lea ecx, [ebp + 8]
call fcn.1002a5f0
mov dword [eax + 8], 0
or eax, 0xffffffff
jmp 0x10051c3d
push 6
lea ecx, [ebp + 8]
call fcn.100383e0
movzx edx, al
test edx, edx
jne 0x10051be5
lea ecx, [ebp + 8]
call fcn.1002a5f0
push eax
call fcn.10048c20
add esp, 4
cmp eax, 0xffffffff
je 0x10051bbf
lea ecx, [ebp + 8]
call fcn.1002a5f0
push eax
call fcn.10048c20
add esp, 4
cmp eax, 0xfffffffe
je 0x10051bbf
lea ecx, [ebp + 8]
call fcn.1002a5f0
push eax
call fcn.10048c20
add esp, 4
mov esi, eax
sar esi, 6
lea ecx, [ebp + 8]
call fcn.1002a5f0
push eax
call fcn.10048c20
add esp, 4
and eax, 0x3f
imul eax, eax, 0x38
add eax, dword [esi*4 + 0x10090c10]
mov dword [ebp - 0x10], eax
jmp 0x10051bc6
mov dword [ebp - 0x10], 0x1008f370
mov ecx, dword [ebp - 0x10]
movzx edx, byte [ecx + 0x28]
and edx, 0x82
cmp edx, 0x82
jne 0x10051be5
push 0x20
lea ecx, [ebp + 8]
call fcn.1002c0b0
lea ecx, [ebp + 8]
call fcn.1002a5f0
cmp dword [eax + 0x18], 0x200
jne 0x10051c28
lea ecx, [ebp + 8]
call fcn.1003d910
movzx eax, al
test eax, eax
je 0x10051c28
push 0x100
lea ecx, [ebp + 8]
call fcn.1002bfe0
movzx ecx, al
test ecx, ecx
jne 0x10051c28
lea ecx, [ebp + 8]
call fcn.1002a5f0
mov dword [eax + 0x18], 0x1000
push 0
mov edx, dword [ebp - 0x28]
push edx
mov eax, dword [ebp + 8]
push eax
call fcn.10052000
add esp, 0xc
movzx eax, al
pop esi
mov esp, ebp
pop ebp
ret