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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
push ebx
push esi
push edi
mov edi, dword [ebp + 0xc]
test edi, edi
je 0x5a4e9d
push edi
call fcn.005a7450
add esp, 4
test eax, eax
je 0x5a4e9d
mov esi, dword [ebp + 0x18]
test esi, esi
jle 0x5a4e9d
mov eax, dword [edi]
xor ebx, ebx
cmp eax, 1
jne 0x5a4eed
mov edi, dword [edi + 4]
push eax
push ebx
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov dword [ebp - 8], eax
cmp eax, 0xffffffff
je 0x5a4e9d
push 0
push edi
mov ebx, 1
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov esi, eax
sub esi, dword [ebp + 0x18]
sub esi, dword [ebp - 8]
test esi, esi
jle 0x5a4edd
push esi
call fcn.005a8078
add esp, 4
mov dword [ebp - 4], eax
push ebx
push 0
push dword [ebp + 0x18]
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
lea eax, [ebp - 0x10]
push eax
push esi
push dword [ebp - 4]
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x5a4ea6
push dword [ebp - 4]
call fcn.005a8081
add esp, 4
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
push 0
push 0
push dword [ebp - 8]
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
lea eax, [ebp - 0x10]
push eax
push esi
mov esi, dword [ebp - 4]
push esi
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
neg eax
push esi
sbb eax, eax
and ebx, eax
call fcn.005a8081
add esp, 4
test ebx, ebx
je 0x5a509f
push edi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
pop edi
pop esi
mov eax, ebx
pop ebx
mov esp, ebp
pop ebp
ret
cmp eax, 2
jne 0x5a4f7a
mov edi, dword [edi + 4]
mov ecx, edi
mov eax, dword [edi]
call dword [eax + 0x14]
mov ebx, eax
mov ecx, edi
mov dword [ebp - 4], ebx
call fcn.005a79d0
sub eax, esi
sub eax, ebx
mov ebx, 1
mov dword [ebp + 0x14], eax
test eax, eax
jle 0x5a4f67
mov eax, dword [edi]
mov ecx, edi
push ebx
push esi
call dword [eax + 0x18]
push dword [ebp + 0x14]
call fcn.005a8078
add esp, 4
mov esi, eax
mov eax, dword [edi]
mov ecx, edi
push dword [ebp + 0x14]
push esi
call dword [eax + 0x20]
mov eax, dword [edi]
mov ecx, edi
push 0
push dword [ebp - 4]
call dword [eax + 0x18]
push dword [ebp + 0x14]
mov eax, dword [edi]
mov ecx, edi
push esi
call dword [eax + 0x24]
mov eax, dword [edi]
mov ecx, edi
call dword [eax + 0x14]
push esi
mov dword [ebp - 4], eax
call fcn.005a8081
add esp, 4
mov eax, dword [edi]
mov ecx, edi
push dword [ebp - 4]
call dword [eax + 0x1c]
pop edi
pop esi
mov eax, ebx
pop ebx
mov esp, ebp
pop ebp
ret
cmp eax, 3
jne 0x5a509f
mov esi, dword [edi + 4]
push 1
push 0
push 0
push esi
mov dword [ebp - 8], esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov dword [ebp - 0xc], eax
cmp eax, 0xffffffff
je 0x5a4e9d
push 0
mov ebx, 1
push esi
mov dword [ebp - 0x1c], ebx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
sub eax, dword [ebp + 0x18]
sub eax, dword [ebp - 0xc]
mov dword [ebp - 0x14], eax
test eax, eax
jle 0x5a5098
push eax
call fcn.005a8078
add esp, 4
mov dword [ebp - 4], eax
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
push dword [ebp + 0x18]
push esi
call ebx
push 1
push 0
push 0
push esi
call ebx
mov ebx, dword [ebp - 4]
push 0
mov dword [ebp - 0x18], eax
lea eax, [ebp - 0x10]
push eax
push dword [ebp - 0x14]
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x5a5015
push ebx
call fcn.005a8081
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp + 0xc]
lea esi, [edi + 0xc]
mov ebx, dword [ebp - 0x10]
add edi, 0x2c
push esi
push dword [eax + 0x130]
push edi
push ebx
push dword [ebp - 4]
push dword [ebp - 0x18]
call fcn.005a6140
add esp, 0x18
push 0
push 0
push dword [ebp - 0xc]
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 1
push 0
push 0
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov ecx, dword [ebp + 0xc]
push esi
push dword [ecx + 0x130]
push edi
mov edi, dword [ebp - 4]
push ebx
push edi
push eax
call fcn.005a6140
mov esi, dword [ebp - 8]
lea eax, [ebp - 0x10]
add esp, 0x18
push 0
push eax
push ebx
push edi
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
neg eax
push edi
sbb eax, eax
and eax, dword [ebp - 0x1c]
mov ebx, eax
call fcn.005a8081
add esp, 4
test ebx, ebx
je 0x5a509f
push esi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
pop edi
pop esi
mov eax, ebx
pop ebx
mov esp, ebp
pop ebp
ret