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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x28
push ebx
mov ebx, dword [ebp + 0xc]
push esi
push edi
test ebx, ebx
je 0x5a5196
push ebx
call fcn.005a7450
add esp, 4
test eax, eax
je 0x5a5196
mov ecx, dword [ebx]
xor eax, eax
cmp ecx, 1
jne 0x5a5247
mov ebx, dword [ebx + 4]
push ecx
push eax
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov edi, eax
mov dword [ebp - 0x24], edi
cmp edi, 0xffffffff
je 0x5a5196
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov esi, eax
mov dword [ebp - 8], 0
sub esi, edi
mov dword [ebp - 0x20], esi
test esi, esi
jle 0x5a51ad
push esi
call fcn.005a8078
add esp, 4
mov edi, eax
lea eax, [ebp - 0x10]
mov dword [ebp - 8], edi
push 0
push eax
push esi
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x5a519f
push edi
call fcn.005a8081
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push 0
push 0
push dword [ebp - 0x24]
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov esi, 1
mov dword [ebp - 4], 1
cmp dword [ebp + 8], esi
jle 0x5a51e4
lea edi, [ebp + 0x18]
mov eax, dword [edi]
lea ecx, [ebp - 0x10]
push 0
push ecx
push dword [eax + 4]
add eax, 8
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x5a5222
inc esi
add edi, 0xc
cmp esi, dword [ebp + 8]
jl 0x5a51c1
mov esi, dword [ebp - 8]
test esi, esi
je 0x5a54d0
mov edi, dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 1
push 0
push 0
push ebx
call edi
push 0
mov dword [ebp + 0x14], eax
lea eax, [ebp - 0x10]
push eax
push dword [ebp - 0x20]
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x5a5225
push 0
push 0
push dword [ebp + 0x14]
push ebx
call edi
jmp 0x5a522c
mov esi, dword [ebp - 8]
mov dword [ebp - 4], 0
test esi, esi
je 0x5a54d0
push esi
call fcn.005a8081
mov eax, dword [ebp - 4]
add esp, 4
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp ecx, 2
jne 0x5a52ff
mov edi, dword [ebx + 4]
mov ecx, edi
mov eax, dword [edi]
call dword [eax + 0x14]
mov eax, dword [edi]
lea ecx, [ebp - 0x28]
push ecx
lea ecx, [ebp - 0x24]
push ecx
push 0xffffffffffffffff
push 0
mov ecx, edi
call dword [eax + 0x30]
mov esi, eax
mov dword [ebp - 0x10], 0
mov dword [ebp - 0x20], esi
test esi, esi
jle 0x5a5295
push esi
call fcn.005a8078
push esi
push dword [ebp - 0x24]
mov ebx, eax
push ebx
mov dword [ebp - 0x10], ebx
call fcn.005a8ef0
add esp, 0x10
mov ebx, dword [ebp + 8]
mov eax, 1
mov dword [ebp - 4], eax
cmp ebx, eax
jle 0x5a52c3
lea esi, [ebp + 0x18]
dec ebx
mov eax, dword [esi]
mov ecx, edi
mov edx, dword [edi]
push dword [eax + 4]
add eax, 8
push eax
call dword [edx + 0x24]
lea esi, [esi + 0xc]
sub ebx, 1
jne 0x5a52a8
mov eax, dword [ebp - 4]
mov ebx, dword [ebp - 0x10]
test ebx, ebx
je 0x5a5198
mov eax, dword [edi]
mov ecx, edi
call dword [eax + 0x14]
push dword [ebp - 0x20]
mov esi, eax
mov ecx, edi
mov eax, dword [edi]
push ebx
call dword [eax + 0x24]
push ebx
call fcn.005a8081
mov eax, dword [edi]
add esp, 4
mov ecx, edi
push 0
push esi
call dword [eax + 0x18]
mov eax, dword [ebp - 4]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp ecx, 3
jne 0x5a5198
mov edi, dword [ebx + 4]
push 1
push 0
push 0
push edi
mov dword [ebp - 0x18], edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov esi, eax
mov dword [ebp - 0x14], esi
cmp esi, 0xffffffff
je 0x5a5196
push 0
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
sub eax, esi
mov dword [ebp - 8], 0
mov dword [ebp - 0xc], eax
test eax, eax
jle 0x5a53a5
push eax
call fcn.005a8078
add esp, 4
mov esi, eax
lea eax, [ebp - 0x10]
mov dword [ebp - 8], esi
push 0
push eax
push dword [ebp - 0xc]
push esi
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x5a5377
push esi
call fcn.005a8081
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 0x10]
lea eax, [ebx + 0xc]
push eax
push dword [ebx + 0x130]
lea eax, [ebx + 0x2c]
mov dword [ebp - 0xc], ecx
push eax
push ecx
push esi
mov esi, dword [ebp - 0x14]
push esi
call fcn.005a6140
add esp, 0x18
push 0
push 0
push esi
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp dword [ebp + 8], 1
lea eax, [ebx + 0xc]
mov dword [ebp - 0x24], eax
mov dword [ebp - 4], 1
mov dword [ebp - 0x1c], 1
jle 0x5a544a
lea ecx, [ebp + 0x18]
mov dword [ebp - 0x20], ecx
nop dword [eax]
mov esi, dword [ecx]
push 1
push 0
push 0
push dword [ebp - 0x18]
mov edi, dword [esi + 4]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push edi
call fcn.005ac0b1
mov dword [ebp - 0x28], eax
lea eax, [esi + 8]
mov esi, dword [ebp - 0x28]
push edi
push eax
push esi
call fcn.005a8ef0
lea eax, [ebx + 0xc]
push eax
push dword [ebx + 0x130]
lea eax, [ebx + 0x2c]
push eax
push edi
push esi
push dword [ebp - 0x14]
call fcn.005a6140
add esp, 0x28
lea eax, [ebp - 0x10]
push 0
push eax
push edi
mov edi, dword [ebp - 0x18]
push esi
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push esi
test eax, eax
je 0x5a54a4
call fcn.005ac096
mov eax, dword [ebp - 0x1c]
add esp, 4
mov ecx, dword [ebp - 0x20]
inc eax
add ecx, 0xc
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x20], ecx
cmp eax, dword [ebp + 8]
jl 0x5a53d0
mov esi, dword [ebp - 8]
test esi, esi
je 0x5a54d0
push 1
push 0
push 0
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push dword [ebp - 0x24]
mov ecx, eax
lea eax, [ebx + 0x2c]
push dword [ebx + 0x130]
mov ebx, dword [ebp - 0xc]
push eax
push ebx
push esi
push ecx
mov dword [ebp + 0x14], ecx
call fcn.005a6140
add esp, 0x18
lea eax, [ebp - 0x10]
push 0
push eax
push ebx
push esi
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x5a54ba
push 0
push 0
push dword [ebp + 0x14]
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov eax, dword [ebp - 4]
jmp 0x5a54bf
call fcn.005ac096
mov esi, dword [ebp - 8]
add esp, 4
mov dword [ebp - 4], 0
xor eax, eax
jmp 0x5a54bf
xor eax, eax
mov dword [ebp - 4], eax
test esi, esi
je 0x5a5198
push esi
call fcn.005a8081
add esp, 4
mov eax, dword [ebp - 4]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret