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

Disassembly:
sub esp, 0x10
push ebx
push ebp
push esi
push edi
mov edi, dword [esp + 0x28]
test edi, edi
jne 0x1020c609
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x10
ret
push edi
call fcn.102106f0
add esp, 4
test eax, eax
jne 0x1020c61e
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret
mov ebx, dword [esp + 0x34]
test ebx, ebx
jg 0x1020c630
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x10
ret
mov eax, dword [edi]
mov dword [esp + 0x10], 0
cmp eax, 1
jne 0x1020c70e
mov edi, dword [edi + 4]
push eax
push 0
push 0
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov ebp, eax
cmp ebp, 0xffffffff
mov dword [esp + 0x28], ebp
jne 0x1020c667
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x10
ret
push 0
push edi
mov dword [esp + 0x18], 1
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov esi, eax
sub esi, ebx
sub esi, ebp
test esi, esi
jle 0x1020c6fb
push esi
call fcn.1023e104
add esp, 4
mov ebp, eax
push 1
push 0
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_SetFilePointer]
push edi
call ebx
lea eax, [esp + 0x18]
push 0
push eax
push esi
push ebp
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x1020c6c2
push ebp
call fcn.1023e12d
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret
mov ecx, dword [esp + 0x28]
push 0
push 0
push ecx
push edi
call ebx
lea edx, [esp + 0x18]
push 0
push edx
push esi
push ebp
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x1020c6e6
mov dword [esp + 0x10], eax
push ebp
call fcn.1023e12d
mov eax, dword [esp + 0x14]
add esp, 4
test eax, eax
je 0x1020c8bf
push edi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
mov eax, dword [esp + 0x10]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret
cmp eax, 2
jne 0x1020c78f
mov esi, dword [edi + 4]
mov ecx, esi
mov eax, dword [esi]
call dword [eax + 0x14]
mov ecx, esi
mov ebp, eax
call fcn.102106e0
mov edi, eax
mov dword [esp + 0x10], 1
sub edi, ebx
sub edi, ebp
test edi, edi
jle 0x1020c77b
mov edx, dword [esi]
push 1
push ebx
mov ecx, esi
call dword [edx + 0x18]
push edi
call fcn.1023e104
add esp, 4
mov ebx, eax
mov eax, dword [esi]
mov ecx, esi
push edi
push ebx
call dword [eax + 0x20]
mov edx, dword [esi]
push 0
push ebp
mov ecx, esi
call dword [edx + 0x18]
mov eax, dword [esi]
push edi
push ebx
mov ecx, esi
call dword [eax + 0x24]
mov edx, dword [esi]
mov ecx, esi
call dword [edx + 0x14]
push ebx
mov ebp, eax
call fcn.1023e12d
add esp, 4
mov eax, dword [esi]
push ebp
mov ecx, esi
call dword [eax + 0x1c]
mov eax, dword [esp + 0x10]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret
cmp eax, 3
jne 0x1020c8bf
mov esi, dword [edi + 4]
push 1
push 0
push 0
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
mov dword [esp + 0x14], eax
jne 0x1020c7bb
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x10
ret
push 0
push esi
mov dword [esp + 0x18], 1
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ecx, dword [esp + 0x14]
mov ebp, eax
sub ebp, ebx
sub ebp, ecx
test ebp, ebp
jle 0x1020c8b8
push ebp
call fcn.1023e104
mov ecx, dword [esp + 0x38]
add esp, 4
mov ebx, eax
push 1
push 0
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 1
push 0
push 0
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
lea edx, [esp + 0x18]
push 0
push edx
push ebp
push ebx
push esi
mov dword [esp + 0x3c], eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x1020c831
push ebx
call fcn.1023e12d
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret
mov ebp, dword [esp + 0x18]
lea eax, [edi + 0xc]
push eax
mov eax, dword [edi + 0x130]
lea ecx, [edi + 0x2c]
push eax
mov dword [esp + 0x24], ecx
push ecx
mov ecx, dword [esp + 0x34]
push ebp
push ebx
push ecx
call fcn.1020f750
mov edx, dword [esp + 0x2c]
add esp, 0x18
push 0
push 0
push edx
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 1
push 0
push 0
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov edx, dword [esp + 0x1c]
lea ecx, [edi + 0xc]
push ecx
mov ecx, dword [edi + 0x130]
push ecx
push edx
push ebp
push ebx
push eax
call fcn.1020f750
add esp, 0x18
lea eax, [esp + 0x18]
push 0
push eax
push ebp
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x1020c8a7
mov dword [esp + 0x10], eax
push ebx
call fcn.1023e12d
mov eax, dword [esp + 0x14]
add esp, 4
test eax, eax
je 0x1020c8bf
push esi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
mov eax, dword [esp + 0x10]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret