Function at 0x50f6ac
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 0x50f6e3
call fcn.004dccc9
mov dword [ebx], 6
mov dword [ebx + 4], eax
jmp 0x50f982
call fcn.0050edfe
mov eax, dword [ebp - 0x3c]
test byte [eax + 0x20], 4
jne 0x50f797
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 0x50f866
mov eax, dword [ebp + 0x14]
lea ecx, [ebp - 0x34]
xor edi, edi
lea eax, [esi + eax*8]
mov dword [ebp - 0x40], eax
cmp esi, dword [ebp - 0x40]
jae 0x50f9c0
mov dword [esp + 0xc], ecx
mov dword [esp + 0x10], 0
mov eax, dword [esi + 4]
mov dword [ebp - 0x48], ecx
mov dword [ebp - 0x34], 0
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
mov ecx, dword [ebp - 0x48]
je 0x50f866
add edi, dword [ebp - 0x34]
add esi, 8
jmp 0x50f746
mov eax, dword [ebp + 0x14]
mov dword [esp], esi
mov dword [esp + 4], eax
call fcn.005298a4
mov dword [ebp - 0x40], eax
mov eax, dword [0x857c4c]
mov dword [ebp - 0x50], eax
mov eax, dword [ebp - 0x40]
mov edi, dword [ebp - 0x50]
lea eax, [eax + edi - 1]
cdq
idiv edi
lea ecx, [eax*8 + 8]
mov dword [ebp - 0x58], eax
lea eax, [ecx + 0x1e]
shr eax, 4
shl eax, 4
call fcn.005d4d10
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 0x50f817
mov edi, dword [esi + 4]
xor edx, edx
mov dword [ebp - 0x5c], edi
cmp edx, dword [ebp - 0x5c]
jge 0x50f812
mov edi, dword [esi]
add eax, 8
add edi, edx
add edx, dword [ebp - 0x50]
mov dword [eax - 8], edi
jmp 0x50f7fe
add esi, 8
jmp 0x50f7f2
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 0x50f87d
call fcn.004dccc9
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebx + 4], esi
mov dword [ebx], eax
jmp 0x50f982
mov ecx, dword [0x857c4c]
mov edi, dword [ebp - 0x40]
mov dword [ebp - 0x50], 0
mov dword [ebp - 0x4c], 0
lea eax, [ecx - 1]
test edi, eax
je 0x50f8b1
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 0x50f989
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
cmp eax, 0x3e5
je 0x50f906
mov dword [ebp - 0x3c], eax
call fcn.004dccc9
mov edx, dword [ebp - 0x3c]
mov dword [ebx], edx
jmp 0x50f966
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 0x50f92f
call fcn.004dccc9
mov edi, eax
call esi
mov dword [ebx + 4], edi
mov dword [ebx], eax
jmp 0x50f969
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 0x50f978
call esi
mov esi, eax
call fcn.004dccc9
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 0x50f982
mov eax, dword [ebp - 0x34]
cmp edi, eax
cmova edi, eax
jmp 0x50f989
or eax, 0xffffffff
mov edx, eax
jmp 0x50f9c4
mov eax, dword [ebp - 0x20]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 0x4c], 0
push eax
jl 0x50f9c0
jg 0x50f9a4
cmp dword [ebp - 0x50], 0
jbe 0x50f9c0
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.0050f42e
sub esp, 0xc
mov eax, edi
xor edx, edx
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret 0x14