Function at 0x1000bec0
Capabilities:
Read file on windows

Disassembly:
push ebx
push ebp
mov ebp, dword [esp + 0x1c]
push esi
mov esi, dword [esp + 0x1c]
push edi
mov edi, dword [esp + 0x1c]
mov dword [ebp], 0
test edi, edi
mov dword [esi], 0
je 0x1000bfa5
mov eax, dword [esp + 0x14]
test eax, eax
je 0x1000bfa5
mov edx, dword [eax + 8]
mov ebx, dword [esp + 0x18]
mov ecx, dword [eax]
add ebx, edx
cmp ecx, 1
jne 0x1000bf37
cmp edi, 0xffffffff
jne 0x1000bf0c
mov ecx, dword [eax + 4]
mov edi, dword [ecx + 4]
mov ecx, dword [eax + 4]
cmp dword [ecx + 4], ebx
jbe 0x1000bfa5
mov edx, dword [ecx]
add edx, ebx
mov dword [esi], edx
mov eax, dword [eax + 4]
mov eax, dword [eax + 4]
sub eax, ebx
cmp eax, edi
mov dword [ebp], eax
jbe 0x1000bfa5
mov dword [ebp], edi
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
ret
test ecx, ecx
jne 0x1000c08f
mov esi, dword [eax + 4]
cmp edi, 0xffffffff
jne 0x1000bf69
mov edi, dword [esi + 0x14]
cmp edi, 0xffffffff
jne 0x1000bf7b
push 2
push ecx
mov ecx, dword [esi]
push ecx
call dword [sym.imp.MSVCRT.dll_fseek]
mov edx, dword [esi]
push edx
call dword [sym.imp.MSVCRT.dll_ftell]
add esp, 0x10
jmp 0x1000bf79
mov eax, dword [esi + 0x14]
cmp eax, 0xffffffff
je 0x1000bf7b
sub eax, ebx
add eax, edx
cmp edi, eax
jle 0x1000bf7b
mov edi, eax
test edi, edi
jle 0x1000bfa5
mov eax, dword [esi + 0xc]
cmp eax, ebx
ja 0x1000bfac
mov ecx, dword [esi + 8]
lea edx, [ebx + edi]
add ecx, eax
cmp ecx, edx
jb 0x1000bfac
mov ecx, dword [esi + 4]
mov edx, dword [esp + 0x20]
sub ecx, eax
add ecx, ebx
mov dword [edx], ecx
mov dword [ebp], edi
inc dword [esi + 0x18]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
ret
mov eax, dword [esi + 0x10]
cmp eax, edi
jb 0x1000bfba
mov ecx, dword [esi + 0x18]
test ecx, ecx
jbe 0x1000c01f
test eax, eax
jbe 0x1000bff2
mov eax, dword [esi + 0x18]
test eax, eax
jbe 0x1000bfda
push esi
call fcn.1000bdb0
add esp, 4
cmp eax, 0x80000000
jb 0x1000bfe7
pop edi
pop esi
pop ebp
pop ebx
ret
mov eax, dword [esi + 4]
push eax
call dword [sym.imp.MSVCRT.dll_free]
add esp, 4
xor eax, eax
mov dword [esi + 0x18], eax
mov dword [esi + 0x10], eax
mov dword [esi + 8], eax
mov eax, dword [esi + 0x1c]
mov ebp, edi
cmp edi, eax
jae 0x1000bffd
mov ebp, eax
push ebp
call dword [sym.imp.MSVCRT.dll_malloc]
add esp, 4
mov dword [esi + 4], eax
test eax, eax
jne 0x1000c018
pop edi
pop esi
pop ebp
mov eax, 0x80220186
pop ebx
ret
mov dword [esi + 0x10], ebp
mov ebp, dword [esp + 0x24]
mov ecx, dword [esi]
push 0
push ebx
push ecx
call dword [sym.imp.MSVCRT.dll_fseek]
add esp, 0xc
test eax, eax
je 0x1000c03c
pop edi
pop esi
pop ebp
mov eax, 0x8022018d
pop ebx
ret
mov edx, dword [esi]
mov eax, dword [esi + 0x10]
mov ecx, dword [esi + 4]
push edx
push eax
push 1
push ecx
mov dword [esi + 0xc], ebx
call dword [sym.imp.MSVCRT.dll_fread]
mov edx, dword [esi]
mov dword [esi + 8], eax
add esp, 0x10
test byte [edx + 0xc], 0x20
je 0x1000c06a
pop edi
pop esi
pop ebp
mov eax, 0x8022018d
pop ebx
ret
mov ecx, dword [esi + 0x18]
mov eax, dword [esi + 4]
inc ecx
mov dword [esi + 0x18], ecx
mov ecx, dword [esp + 0x20]
mov dword [ecx], eax
mov esi, dword [esi + 8]
cmp esi, edi
ja 0x1000bf2d
mov dword [ebp], esi
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
ret
pop edi
pop esi
pop ebp
mov eax, 0x80220180
pop ebx
ret