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

Disassembly:
sub esp, 0x20
push ebx
push ebp
push esi
mov esi, dword [esp + 0x34]
test esi, esi
push edi
jne 0x4108d9
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x20
ret
push esi
call fcn.00415110
add esp, 4
test eax, eax
jne 0x4108ee
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x20
ret
mov eax, dword [esi]
mov ebp, 1
cmp eax, ebp
mov dword [esp + 0x10], 0
jne 0x410a3b
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 0x410925
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x20
ret
push 0
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebx, eax
mov dword [esp + 0x18], 0
sub ebx, edi
test ebx, ebx
jle 0x410985
push ebx
call fcn.0041f3bd
add esp, 4
mov ebp, eax
lea eax, [esp + 0x24]
mov dword [esp + 0x18], ebp
push 0
push eax
push ebx
push ebp
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x410974
push ebp
call fcn.0041f3e6
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x20
ret
push 0
push 0
push edi
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov ebp, 1
mov eax, dword [esp + 0x34]
mov dword [esp + 0x10], ebp
mov dword [esp + 0x28], ebp
cmp eax, ebp
mov ebp, dword [sym.imp.KERNEL32.dll_WriteFile]
jle 0x4109cb
lea edi, [esp + 0x44]
mov eax, dword [edi]
lea edx, [esp + 0x24]
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 0x410a08
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x34]
inc eax
add edi, 0xc
cmp eax, ecx
mov dword [esp + 0x28], eax
jl 0x41099f
mov eax, dword [esp + 0x18]
test eax, eax
je 0x410d1c
push 1
push 0
push 0
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov edi, eax
lea eax, [esp + 0x24]
push 0
push eax
push ebx
mov ebx, dword [esp + 0x24]
push ebx
push esi
call ebp
test eax, eax
je 0x410a16
push 0
push 0
push edi
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
jmp 0x410a1e
mov ebx, dword [esp + 0x18]
mov dword [esp + 0x10], 0
jmp 0x410a1e
mov dword [esp + 0x10], 0
test ebx, ebx
je 0x410d1c
push ebx
call fcn.0041f3e6
mov eax, dword [esp + 0x14]
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x20
ret
cmp eax, 2
jne 0x410b10
mov ebx, dword [esi + 4]
mov ecx, ebx
mov edx, dword [ebx]
call dword [edx + 0x14]
lea ecx, [esp + 0x20]
lea edx, [esp + 0x2c]
push ecx
mov dword [esp + 0x28], eax
mov eax, dword [ebx]
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 + 0x28], esi
jle 0x410a96
push esi
call fcn.0041f3bd
mov ecx, esi
mov esi, dword [esp + 0x30]
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 edx, dword [ebx]
push 0
push eax
mov ecx, ebx
call dword [edx + 0x18]
mov eax, dword [esp + 0x34]
mov dword [esp + 0x10], 1
cmp eax, 1
jle 0x410ad7
lea esi, [esp + 0x44]
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 0x410abc
mov esi, dword [esp + 0x28]
test ebp, ebp
je 0x410d1c
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 fcn.0041f3e6
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, 0x20
ret
cmp eax, 3
jne 0x410d1c
mov edi, dword [esi + 4]
push ebp
mov ebp, dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
push 0
push edi
mov dword [esp + 0x30], edi
call ebp
cmp eax, 0xffffffff
mov dword [esp + 0x18], eax
jne 0x410b41
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x20
ret
push 0
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ecx, dword [esp + 0x18]
mov ebx, eax
sub ebx, ecx
mov dword [esp + 0x14], 0
test ebx, ebx
mov dword [esp + 0x24], ebx
jle 0x410bcd
push ebx
call fcn.0041f3bd
add esp, 4
lea ecx, [esp + 0x28]
mov dword [esp + 0x14], eax
push 0
push ecx
push ebx
push eax
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x410b9a
mov edx, dword [esp + 0x14]
push edx
call fcn.0041f3e6
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x20
ret
mov edx, dword [esi + 0xc]
mov eax, dword [esp + 0x28]
mov ebx, dword [esp + 0x18]
lea ecx, [esi + 0x10]
push ecx
lea ecx, [esi + 0x34]
push edx
mov edx, dword [esp + 0x1c]
push ecx
push eax
push edx
push ebx
mov dword [esp + 0x3c], eax
call fcn.00414790
add esp, 0x18
push 0
push 0
push ebx
push edi
call ebp
mov ebx, dword [esp + 0x24]
mov ecx, dword [esp + 0x34]
mov eax, 1
cmp ecx, eax
mov dword [esp + 0x10], eax
mov dword [esp + 0x2c], eax
jle 0x410c9f
lea eax, [esp + 0x44]
mov dword [esp + 0x1c], eax
jmp 0x410bf6
mov ebp, dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov ecx, dword [esp + 0x1c]
push 1
push 0
push 0
mov eax, dword [ecx]
push edi
mov ebx, dword [eax + 4]
lea esi, [eax + 8]
call ebp
push ebx
call fcn.00415fd1
mov ecx, ebx
mov ebp, eax
mov edx, ecx
mov edi, ebp
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov eax, dword [esp + 0x3c]
mov ecx, edx
add eax, 0x10
and ecx, 3
push eax
mov eax, dword [esp + 0x40]
mov edx, dword [esp + 0x20]
add eax, 0x34
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [eax - 0x28]
push ecx
push eax
push ebx
push ebp
push edx
call fcn.00414790
mov ecx, dword [esp + 0x3c]
add esp, 0x1c
lea eax, [esp + 0x28]
push 0
push eax
push ebx
push ebp
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
push ebp
je 0x410cf1
call fcn.00415ee8
mov eax, dword [esp + 0x30]
mov edx, dword [esp + 0x20]
mov ecx, dword [esp + 0x38]
mov edi, dword [esp + 0x24]
add esp, 4
inc eax
add edx, 0xc
cmp eax, ecx
mov dword [esp + 0x2c], eax
mov dword [esp + 0x1c], edx
jl 0x410bf0
mov ebx, dword [esp + 0x24]
mov ebp, dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov esi, dword [esp + 0x38]
mov eax, dword [esp + 0x14]
test eax, eax
je 0x410d1c
push 1
push 0
push 0
push edi
call ebp
mov ecx, dword [esi + 0xc]
lea edx, [esi + 0x10]
push edx
add esi, 0x34
push ecx
push esi
mov esi, dword [esp + 0x20]
push ebx
push esi
push eax
mov dword [esp + 0x30], eax
call fcn.00414790
add esp, 0x18
lea edx, [esp + 0x28]
push 0
push edx
push ebx
push esi
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x410d07
mov eax, dword [esp + 0x18]
push 0
push 0
push eax
push edi
call ebp
jmp 0x410d0f
call fcn.00415ee8
mov esi, dword [esp + 0x18]
add esp, 4
mov dword [esp + 0x10], 0
jmp 0x410d0f
mov dword [esp + 0x10], 0
test esi, esi
je 0x410d1c
push esi
call fcn.0041f3e6
add esp, 4
mov eax, dword [esp + 0x10]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x20
ret