Function at 0x5a786c
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffcc
mov eax, dword [ebp + 0xc]
mov dword [ebp - 8], eax
mov eax, dword [ebp + 0x10]
mov dword [ebp - 4], eax
mov edx, dword [ebp + 8]
cmp dword [edx + 0x50], 0xffffffff
je 0x5a78a9
mov eax, dword [ebp + 0xc]
mov edx, dword [ebp + 0x10]
mov ecx, dword [ebp + 8]
cmp edx, dword [ecx + 0x2c]
jne 0x5a789c
cmp eax, dword [ecx + 0x28]
jae 0x5a78a9
jmp 0x5a789e
jge 0x5a78a9
mov eax, dword [ebp + 8]
mov edx, dword [eax + 0x50]
mov dword [ebp - 0xc], edx
jmp 0x5a78c0
mov ecx, dword [ebp + 8]
mov eax, dword [ecx]
mov dword [ebp - 0xc], eax
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x10]
mov edx, dword [edx + 0x14]
add dword [ebp - 8], eax
adc dword [ebp - 4], edx
mov ecx, dword [ebp + 8]
cmp dword [ecx + 0x54], 0
je 0x5a796c
xor eax, eax
mov dword [ebp - 0x24], eax
xor edx, edx
mov dword [ebp - 0x20], edx
mov ecx, dword [ebp + 0xc]
mov dword [ebp - 0x30], ecx
mov ecx, dword [ebp + 0x10]
mov dword [ebp - 0x2c], ecx
cmp dword [ebp + 0x20], 0
je 0x5a7910
push 0
lea eax, [ebp - 0x30]
push eax
mov eax, dword [ebp + 0x14]
push eax
push dword [ebp + 0x20]
lea edx, [ebp - 0x24]
push edx
push 0
push 0
push 0
mov ecx, dword [ebp + 8]
push dword [ecx]
call dword [0x818320]
mov dword [ebp - 0x28], eax
jmp 0x5a7935
push 0
lea eax, [ebp - 0x30]
push eax
mov eax, dword [ebp + 0x14]
push eax
push dword [ebp + 0x1c]
lea edx, [ebp - 0x24]
push edx
push 0
push 0
push 0
mov ecx, dword [ebp + 8]
push dword [ecx]
call dword [0x81831c]
mov dword [ebp - 0x28], eax
cmp dword [ebp - 0x28], 0
jne 0x5a794b
mov eax, dword [ebp - 0x20]
xor edx, edx
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x18], edx
jmp 0x5a7a3f
mov dword [ebp - 0x1c], 0xffffffff
mov dword [ebp - 0x18], 0xffffffff
push dword [ebp - 0x28]
call fcn.005a65f6
pop ecx
mov dword [0xd1470c], eax
jmp 0x5a7a3f
push 0
push 0
push dword [ebp - 4]
push dword [ebp - 8]
push dword [ebp - 0xc]
call dword [0x81833c]
test eax, eax
jne 0x5a79a0
call sub.KERNEL32.DLL_GetLastError
push eax
call fcn.005a64f0
pop ecx
mov dword [0xd1470c], eax
mov eax, 0xffffffff
mov edx, eax
jmp 0x5a7a45
cmp dword [ebp + 0x20], 0
je 0x5a79c0
push 0
lea eax, [ebp - 0x10]
push eax
mov eax, dword [ebp + 0x14]
push eax
push dword [ebp + 0x20]
push dword [ebp - 0xc]
call sub.KERNEL32.DLL_WriteFile
mov dword [ebp - 0x14], eax
jmp 0x5a79d8
push 0
lea edx, [ebp - 0x10]
push edx
mov eax, dword [ebp + 0x14]
push eax
push dword [ebp + 0x1c]
push dword [ebp - 0xc]
call sub.KERNEL32.DLL_ReadFile
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x10]
xor edx, edx
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x18], edx
cmp dword [ebp - 0x14], 0
jne 0x5a7a03
call sub.KERNEL32.DLL_GetLastError
push eax
call fcn.005a64f0
pop ecx
mov dword [0xd1470c], eax
mov eax, 0xffffffff
mov edx, eax
jmp 0x5a7a45
cmp dword [ebp + 0x1c], 0
je 0x5a7a3f
cmp dword [ebp + 0x10], 0
jne 0x5a7a3f
cmp dword [ebp + 0xc], 0
jne 0x5a7a3f
mov ecx, dword [ebp + 0x1c]
mov dword [ebp - 0x34], ecx
mov eax, dword [ebp - 0x34]
movsx edx, byte [eax + 0xb]
and edx, 0xff
mov ecx, dword [ebp - 0x34]
movsx eax, byte [ecx + 0xc]
and eax, 0xff
shl eax, 8
add edx, eax
mov ecx, dword [ebp + 8]
mov dword [ecx + 0x38], edx
mov eax, dword [ebp - 0x1c]
mov edx, dword [ebp - 0x18]
mov esp, ebp
pop ebp
ret