Function at 0x1000ad90
Capabilities:
Read file on windows
Write file on windows

Disassembly:
sub esp, 0x14
push ebp
push esi
mov esi, ecx
mov eax, dword [esi + 8]
dec eax
js 0x1000adbe
mov edx, dword [esi + 0x14]
lea ecx, [eax + eax*2]
lea ecx, [edx + ecx*4]
cmp dword [ecx + 8], 0xffffffff
jne 0x1000adbe
mov edx, dword [ecx]
mov ebp, dword [esi + 0xc]
sub ebp, edx
dec eax
sub ecx, 0xc
mov dword [esi + 0xc], ebp
test eax, eax
jge 0x1000ada6
mov ecx, dword [esi + 0xc]
inc eax
test ecx, ecx
mov dword [esi + 8], eax
je 0x1000afc8
mov eax, dword [esi + 0x10]
xor edx, edx
lea eax, [eax + eax*4]
lea eax, [eax + eax*4]
shl eax, 2
div ecx
cmp eax, 0x19
jbe 0x1000afc8
xor eax, eax
push ebx
mov dword [esp + 0x18], eax
push edi
mov dword [esp + 0x10], 1
mov dword [esp + 0x20], eax
mov ebx, dword [esi + 8]
xor ebp, ebp
dec ebx
mov dword [esp + 0x18], ebx
lea eax, [ebx - 1]
test eax, eax
jle 0x1000ae5c
xor edi, edi
mov eax, dword [esp + 0x10]
test eax, eax
je 0x1000ae68
mov ecx, dword [esi + 0x14]
cmp dword [edi + ecx + 8], 0xffffffff
jne 0x1000ae51
mov eax, dword [edi + ecx]
lea edx, [ebx + ebx*2]
mov ecx, dword [ecx + edx*4]
cmp eax, ecx
jb 0x1000ae51
lea eax, [eax + eax*4]
lea edx, [ecx + ecx*4]
lea eax, [eax + eax*4]
lea edx, [edx + edx*4]
shl eax, 2
shl edx, 2
sub eax, edx
xor edx, edx
div ecx
cmp eax, 0x19
jae 0x1000ae51
mov dword [esp + 0x10], 0
inc ebp
lea eax, [ebx - 1]
add edi, 0xc
cmp ebp, eax
jl 0x1000ae0d
mov eax, dword [esp + 0x10]
test eax, eax
jne 0x1000afb9
mov eax, dword [esi + 0x14]
lea ebx, [ebx + ebx*2]
shl ebx, 2
lea edx, [esp + 0x1c]
mov ecx, dword [eax + ebx]
push ecx
push edx
call fcn.100040c0
add esp, 8
test eax, eax
je 0x1000afb9
mov eax, dword [esi + 0x14]
mov edx, dword [esi + 0x24]
push 0
push 0
mov ecx, dword [eax + ebx + 4]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
lea eax, [esp + 0x1c]
push eax
call fcn.10004120
mov edx, dword [esi + 0x14]
add esp, 4
lea ecx, [esp + 0x14]
mov dword [esp + 0x10], eax
push 0
push ecx
mov ecx, dword [edx + ebx]
mov edx, dword [esi + 0x24]
push ecx
push eax
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x1000aed7
mov dword [esp + 0x10], eax
jmp 0x1000af99
mov eax, dword [esi + 0x14]
mov edx, dword [esi + 0x24]
lea edi, [ebp + ebp*2]
push 0
shl edi, 2
push 0
mov ecx, dword [eax + edi + 4]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov eax, dword [esi + 0x14]
push 0
mov ecx, dword [eax + edi + 4]
mov eax, dword [ebx + eax]
add eax, ecx
push eax
push 0
push ecx
mov ecx, dword [esi + 0x24]
push ecx
call dword [sym.imp.KERNEL32.dll_LockFile]
mov eax, dword [esi + 0x14]
lea edx, [esp + 0x14]
push 0
push edx
mov ecx, dword [eax + ebx]
mov edx, dword [esp + 0x18]
mov eax, dword [esi + 0x24]
push ecx
push edx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov dword [esp + 0x10], eax
mov eax, dword [esi + 0x14]
push 0
mov ecx, dword [eax + edi + 4]
mov edx, dword [ebx + eax]
mov eax, dword [esi + 0x24]
add edx, ecx
push edx
push 0
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_UnlockFile]
mov eax, dword [esp + 0x10]
test eax, eax
je 0x1000af99
mov edx, dword [esi + 0x14]
mov ecx, dword [esp + 0x18]
push ebp
push ecx
mov eax, dword [edx + ebx + 8]
mov ecx, dword [esi + 0x1c]
push eax
push esi
call fcn.10009a00
test eax, eax
mov dword [esp + 0x10], eax
je 0x1000af99
mov eax, dword [esi + 0x14]
mov ebp, dword [esi + 0xc]
mov ecx, dword [ebx + eax]
sub ebp, ecx
mov ecx, dword [esi + 0x10]
mov dword [esi + 0xc], ebp
mov edx, dword [eax + edi]
mov edi, dword [ebx + eax]
mov eax, dword [esi + 8]
sub edx, edi
add ecx, edx
dec eax
mov dword [esi + 0x10], ecx
mov dword [esi + 8], eax
lea eax, [esp + 0x1c]
push eax
call fcn.10004140
mov eax, dword [esp + 0x14]
add esp, 4
test eax, eax
je 0x1000afb9
mov eax, dword [esi + 8]
test eax, eax
jne 0x1000adfa
lea ecx, [esp + 0x1c]
push ecx
call fcn.100040a0
add esp, 4
pop edi
pop ebx
mov eax, dword [esi + 8]
test eax, eax
je 0x1000afe3
lea edx, [eax + eax*2]
mov eax, dword [esi + 0x14]
lea ecx, [eax + edx*4]
mov eax, dword [eax + edx*4 - 0xc]
mov edx, dword [ecx - 8]
add eax, edx
jmp 0x1000afe6
mov eax, dword [esi + 0x18]
mov ecx, dword [esi + 0x24]
push 0
push 0
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov edx, dword [esi + 0x24]
push edx
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
pop esi
pop ebp
add esp, 0x14
ret