Function at 0x10104540
Capabilities:
Get file size
Read file on windows
Write file on windows

Disassembly:
sub esp, 0x10
push ebx
push ebp
push esi
mov esi, dword [esp + 0x24]
test esi, esi
push edi
jne 0x10104559
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x10
ret
push esi
call fcn.10108130
add esp, 4
test eax, eax
jne 0x1010456e
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret
mov eax, dword [esi]
mov ebp, 1
cmp eax, ebp
mov dword [esp + 0x10], 0
jne 0x101046bb
mov esi, dword [esi + 4]
push ebp
push 0
push 0
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov edi, eax
cmp edi, 0xffffffff
jne 0x101045a5
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x10
ret
push 0
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebx, eax
mov dword [esp + 0x14], 0
sub ebx, edi
test ebx, ebx
jle 0x10104605
push ebx
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
add esp, 4
mov ebp, eax
lea eax, [esp + 0x1c]
mov dword [esp + 0x14], ebp
push 0
push eax
push ebx
push ebp
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x101045f4
push ebp
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret
push 0
push 0
push edi
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov ebp, 1
mov eax, dword [esp + 0x24]
mov dword [esp + 0x10], ebp
mov dword [esp + 0x18], ebp
cmp eax, ebp
mov ebp, dword [sym.imp.KERNEL32.dll_WriteFile]
jle 0x1010464b
lea edi, [esp + 0x34]
mov eax, dword [edi]
lea edx, [esp + 0x1c]
push 0
push edx
lea ecx, [eax + 8]
mov eax, dword [eax + 4]
push eax
push ecx
push esi
call ebp
test eax, eax
je 0x10104688
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x24]
inc eax
add edi, 0xc
cmp eax, ecx
mov dword [esp + 0x18], eax
jl 0x1010461f
mov eax, dword [esp + 0x14]
test eax, eax
je 0x1010476e
push 1
push 0
push 0
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov edi, eax
lea eax, [esp + 0x1c]
push 0
push eax
push ebx
mov ebx, dword [esp + 0x20]
push ebx
push esi
call ebp
test eax, eax
je 0x10104696
push 0
push 0
push edi
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
jmp 0x1010469e
mov ebx, dword [esp + 0x14]
mov dword [esp + 0x10], 0
jmp 0x1010469e
mov dword [esp + 0x10], 0
test ebx, ebx
je 0x1010476e
push ebx
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
mov eax, dword [esp + 0x14]
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret
cmp eax, 2
jne 0x1010476e
mov ebx, dword [esi + 4]
mov ecx, ebx
mov edx, dword [ebx]
call dword [edx + 0x14]
mov eax, dword [ebx]
lea ecx, [esp + 0x14]
lea edx, [esp + 0x18]
push ecx
push edx
push 0xffffffffffffffff
push 0
mov ecx, ebx
call dword [eax + 0x30]
mov esi, eax
xor ebp, ebp
test esi, esi
mov dword [esp + 0x1c], esi
jle 0x10104712
push esi
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
mov ecx, esi
mov esi, dword [esp + 0x1c]
mov ebp, eax
mov eax, ecx
mov edi, ebp
add esp, 4
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov esi, eax
mov eax, dword [esp + 0x24]
mov dword [esp + 0x10], 1
cmp eax, 1
jle 0x10104745
lea esi, [esp + 0x34]
lea edi, [eax - 1]
mov eax, dword [esi]
mov edx, dword [ebx]
mov ecx, dword [eax + 4]
add eax, 8
push ecx
push eax
mov ecx, ebx
call dword [edx + 0x24]
add esi, 0xc
dec edi
jne 0x1010472a
mov esi, dword [esp + 0x1c]
test ebp, ebp
je 0x1010476e
mov edx, dword [ebx]
mov ecx, ebx
call dword [edx + 0x14]
mov edi, eax
mov eax, dword [ebx]
push esi
push ebp
mov ecx, ebx
call dword [eax + 0x24]
push ebp
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
mov edx, dword [ebx]
add esp, 4
mov ecx, ebx
push 0
push edi
call dword [edx + 0x18]
mov eax, dword [esp + 0x10]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret