Function at 0x51c71c
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x7c
cmp dword [ecx + 4], 0xffffffff
mov eax, dword [ebp + 8]
mov edx, dword [ebp + 0xc]
mov dword [ebp - 0x3c], ecx
mov esi, dword [ebp + 0x10]
mov ebx, dword [ebp + 0x18]
mov dword [ebp - 0x48], eax
mov dword [ebp - 0x44], edx
jne 0x51c753
call fcn.004e34b3
mov dword [ebx], 6
mov dword [ebx + 4], eax
jmp 0x51c9e7
call fcn.0051be60
mov eax, dword [ebp - 0x3c]
test byte [eax + 0x20], 4
jne 0x51c801
mov eax, dword [ebp - 0x48]
mov edx, dword [ebp - 0x44]
mov dword [esp + 0x10], 0
mov dword [ebp - 0x30], eax
lea eax, [ebp - 0x30]
mov dword [ebp - 0x2c], edx
mov edx, dword [ebp - 0x44]
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x48]
mov dword [esp + 8], edx
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x3c]
mov eax, dword [eax + 4]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
sub esp, 0x14
test eax, eax
je 0x51c8cb
mov eax, dword [ebp + 0x14]
xor edi, edi
lea eax, [esi + eax*8]
mov dword [ebp - 0x40], eax
cmp esi, dword [ebp - 0x40]
jae 0x51ca25
lea eax, [ebp - 0x34]
mov dword [esp + 0x10], 0
mov dword [ebp - 0x34], 0
mov dword [esp + 0xc], eax
mov eax, dword [esi + 4]
mov dword [esp + 8], eax
mov eax, dword [esi]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x3c]
mov eax, dword [eax + 4]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
sub esp, 0x14
test eax, eax
je 0x51c8cb
add edi, dword [ebp - 0x34]
add esi, 8
jmp 0x51c7b3
mov eax, dword [ebp + 0x14]
mov dword [esp], esi
mov dword [esp + 4], eax
call fcn.00536158
mov dword [ebp - 0x40], eax
mov eax, dword [0x86bc14]
mov ecx, dword [ebp - 0x40]
mov dword [ebp - 0x50], eax
lea eax, [eax + ecx - 1]
cdq
idiv dword [ebp - 0x50]
lea ecx, [eax*8 + 8]
mov dword [ebp - 0x58], eax
lea eax, [ecx + 0x1e]
and eax, 0xfffffff0
call fcn.005e3260
sub esp, eax
lea eax, [esp + 0x23]
and eax, 0xfffffff0
mov dword [ebp - 0x54], eax
mov edi, dword [ebp - 0x54]
xor eax, eax
rep stosb byte es:[edi], al
mov eax, dword [ebp + 0x14]
lea ecx, [esi + eax*8]
mov eax, dword [ebp - 0x54]
cmp esi, ecx
jae 0x51c87c
mov edi, dword [esi + 4]
xor edx, edx
mov dword [ebp - 0x5c], edi
cmp dword [ebp - 0x5c], edx
jle 0x51c877
mov edi, dword [esi]
add eax, 8
add edi, edx
add edx, dword [ebp - 0x50]
mov dword [eax - 8], edi
jmp 0x51c863
add esi, 8
jmp 0x51c857
lea edx, [ebp - 0x30]
mov dword [eax], 0
mov ecx, 5
xor eax, eax
mov edi, edx
rep stosd dword es:[edi], eax
mov eax, dword [ebp - 0x44]
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 1
mov dword [esp], 0
mov dword [ebp - 0x24], eax
mov eax, dword [ebp - 0x48]
mov dword [ebp - 0x28], eax
call dword [sym.imp.KERNEL32.dll_CreateEventW]
sub esp, 0x10
test eax, eax
mov dword [ebp - 0x20], eax
jne 0x51c8e2
call fcn.004e34b3
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebx + 4], esi
mov dword [ebx], eax
jmp 0x51c9e7
mov ecx, dword [0x86bc14]
mov edi, dword [ebp - 0x40]
mov dword [ebp - 0x50], 0
mov dword [ebp - 0x4c], 0
lea eax, [ecx - 1]
test edi, eax
je 0x51c916
mov eax, edi
cdq
add eax, dword [ebp - 0x48]
adc edx, dword [ebp - 0x44]
imul ecx, dword [ebp - 0x58]
mov dword [ebp - 0x50], eax
mov dword [ebp - 0x4c], edx
mov dword [ebp - 0x40], ecx
lea eax, [ebp - 0x30]
mov dword [esp + 0xc], 0
mov dword [esp + 0x10], eax
mov eax, dword [ebp - 0x40]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x54]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x3c]
mov eax, dword [eax + 4]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_WriteFileGather]
sub esp, 0x14
test eax, eax
jne 0x51c9ee
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
cmp eax, 0x3e5
je 0x51c96b
mov dword [ebp - 0x3c], eax
call fcn.004e34b3
mov edx, dword [ebp - 0x3c]
mov dword [ebx], edx
jmp 0x51c9cb
mov eax, dword [ebp - 0x20]
mov dword [esp + 4], 0xffffffff
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
inc eax
push ecx
push ecx
jne 0x51c994
call fcn.004e34b3
mov edi, eax
call esi
mov dword [ebx + 4], edi
mov dword [ebx], eax
jmp 0x51c9ce
lea eax, [ebp - 0x34]
mov dword [esp + 0xc], 0
mov dword [esp + 8], eax
lea eax, [ebp - 0x30]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x3c]
mov eax, dword [eax + 4]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
sub esp, 0x10
test eax, eax
jne 0x51c9dd
call esi
mov esi, eax
call fcn.004e34b3
mov dword [ebx], esi
mov dword [ebx + 4], eax
mov eax, dword [ebp - 0x20]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push edx
jmp 0x51c9e7
mov eax, dword [ebp - 0x34]
cmp edi, eax
cmova edi, eax
jmp 0x51c9ee
or eax, 0xffffffff
mov edx, eax
jmp 0x51ca29
mov eax, dword [ebp - 0x20]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 0x4c], 0
push eax
jl 0x51ca25
jg 0x51ca09
cmp dword [ebp - 0x50], 0
jbe 0x51ca25
mov eax, dword [ebp - 0x50]
mov edx, dword [ebp - 0x4c]
mov ecx, dword [ebp - 0x3c]
mov dword [esp + 8], ebx
mov dword [esp], eax
mov dword [esp + 4], edx
call fcn.0051c496
sub esp, 0xc
mov eax, edi
xor edx, edx
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret 0x14