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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xdc
mov eax, dword [0x5a9008]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
mov eax, dword [edi + 0xc]
mov dword [ebp - 0x68], eax
xor eax, eax
mov dword [ebp - 0x70], eax
call dword [sym.imp.KERNEL32.dll_GetVersion]
movzx eax, al
mov ecx, 5
cmp ecx, eax
sbb eax, eax
and eax, 0xc00
add eax, 0x400
xor ebx, ebx
mov dword [edi + 0x8c], eax
mov esi, dword [ebp - 0xb4]
mov dword [ebp - 0x6c], ebx
lea eax, [ebp - 0xdc]
mov dword [ebp - 0xd4], ebx
push eax
lea eax, [ebp - 0x74]
xorps xmm0, xmm0
push eax
push 0x5c
lea eax, [ebp - 0x60]
movlpd qword [ebp - 0xdc], xmm0
push eax
push dword [edi]
movlpd qword [ebp - 0xd0], xmm0
call dword [sym.imp.KERNEL32.dll_ReadFile]
or ecx, 0xffffffff
test eax, eax
cmovne ecx, dword [ebp - 0x74]
cmp ecx, 0xffffffff
je 0x5276fe
cmp ecx, 0x5c
jne 0x527631
test byte [ebp - 0x5a], 8
je 0x52761b
cmp dword [ebp - 0x54], 0xbeefc0de
jne 0x52761b
cmp dword [ebp - 0x50], 1
jne 0x527605
test ebx, ebx
je 0x5274dc
cmp dword [ebp + 0xc], 0
mov eax, dword [ebp - 8]
je 0x5274d1
cmp eax, dword [ebp - 0x78]
jmp 0x5274d4
cmp dword [ebp - 0x78], eax
sbb eax, eax
neg eax
test eax, eax
je 0x527513
movups xmm0, xmmword [ebp - 0x54]
movups xmmword [ebp - 0xc4], xmm0
movups xmm0, xmmword [ebp - 0x44]
movups xmmword [ebp - 0xb4], xmm0
movups xmm0, xmmword [ebp - 0x34]
movups xmmword [ebp - 0xa4], xmm0
movups xmm0, xmmword [ebp - 0x24]
movups xmmword [ebp - 0x94], xmm0
movups xmm0, xmmword [ebp - 0x14]
movups xmmword [ebp - 0x84], xmm0
mov eax, dword [ebp - 0x6c]
mov esi, dword [ebp - 0xb4]
inc eax
add ebx, esi
mov dword [ebp - 0x6c], eax
cmp eax, 2
jl 0x527451
mov edx, dword [ebp - 0x7c]
mov eax, dword [ebp - 0xb8]
mov ebx, dword [ebp - 0xbc]
mov dword [edi + 0x10], esi
mov ecx, dword [edi + 0x4c]
test ecx, ecx
jne 0x527549
mov dword [edi + 0x4c], eax
mov ecx, eax
lea eax, [edx + 1]
imul eax, esi
cmp ecx, eax
jae 0x527558
mov dword [edi + 0x4c], eax
mov ecx, eax
mov esi, dword [ebp - 0x70]
mov dword [ebp - 0xb8], ecx
test esi, esi
je 0x527585
test byte [ebp - 0x68], 1
jne 0x52771f
lea eax, [ebp - 0xc4]
push eax
push edi
call fcn.00526dc0
add esp, 8
test eax, eax
jne 0x5275f4
xor esi, esi
and dword [ebp - 0x68], 1
mov eax, 0
cmovne eax, ebx
push eax
push edi
call fcn.00526ed0
add esp, 8
test eax, eax
jne 0x5275f4
test esi, esi
je 0x5275c5
cmp dword [ebp - 0x68], eax
je 0x5275b1
mov eax, dword [edi + 0x30]
mov dword [ebp - 0xbc], eax
lea eax, [ebp - 0xc4]
push eax
push edi
call fcn.00526dc0
add esp, 8
test eax, eax
jne 0x5275f4
mov esi, dword [edi + 0x10]
xor edx, edx
lea ecx, [esi - 0xc]
mov eax, ecx
shr ecx, 1
shr eax, 2
and ecx, 0x7ffffffe
dec eax
sub ecx, 2
mov dword [edi + 0x80], eax
mov eax, dword [edi + 0x4c]
div esi
mov dword [edi + 0x84], ecx
mov dword [edi + 0x54], eax
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004ef615
mov esp, ebp
pop ebp
ret
pop edi
pop esi
mov eax, 0xffff87b6
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004ef615
mov esp, ebp
pop ebp
ret
pop edi
pop esi
mov eax, 0xffff87b7
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004ef615
mov esp, ebp
pop ebp
ret
test ecx, ecx
je 0x52770d
jns 0x527715
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x52752b
cmp eax, 2
jne 0x5275f4
mov esi, dword [edi + 0x14]
mov dword [ebp - 0x70], 1
mov dword [edi + 0x10], esi
cmp esi, 0x8000
jbe 0x527673
mov dword [edi + 0x10], 0x8000
mov esi, 0x8000
xor eax, eax
mov dword [ebp - 0xc4], 0xbeefc0de
mov word [ebp - 0x9e], ax
xorps xmm0, xmm0
mov dword [ebp - 0x78], eax
xor ebx, ebx
mov ax, word [edi + 0xc]
mov edx, 1
or ax, 8
mov dword [ebp - 0xbc], ebx
mov word [ebp - 0xb0], ax
mov eax, 0x100000
movlpd qword [ebp - 0xae], xmm0
movlpd qword [ebp - 0xa6], xmm0
movlpd qword [ebp - 0x98], xmm0
movlpd qword [ebp - 0x90], xmm0
movlpd qword [ebp - 0x88], xmm0
mov dword [ebp - 0xc0], 1
mov dword [ebp - 0xb4], esi
mov dword [ebp - 0x7c], edx
mov dword [ebp - 0x9c], 0xffffffff
mov dword [ebp - 0x80], 0xffffffff
jmp 0x52753d
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x26
jne 0x52763f
test ebx, ebx
je 0x527652
mov eax, 0xffff87b7
jmp 0x527645
push 0
lea eax, [ebp - 0xc8]
mov byte [ebp - 0x61], 0
push eax
push 1
lea eax, [ebp - 0x61]
push eax
push dword [edi]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x527585
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004ef615
mov esp, ebp
pop ebp
ret