Function at 0x50f790
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x608d1c
mov eax, dword fs:[0]
push eax
sub esp, 0x2c
push ebx
push esi
push edi
mov eax, dword [0x6b000c]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov ebx, ecx
cmp dword [ebp + 0x14], 4
mov dword [ebx + 0xc], 0
jne 0x50f811
mov esi, dword [ebp + 0xc]
test esi, esi
je 0x50fc43
push 0xa50
call fcn.00560437
add esp, 4
mov dword [ebp + 0xc], eax
mov dword [ebp - 4], 0
mov ecx, eax
call fcn.0047ffd0
mov edi, eax
mov dword [ebp + 0x14], edi
mov dword [ebp - 4], 0xffffffff
mov ecx, edi
mov eax, dword [ebp + 0x10]
push dword [eax + 0x2c]
push dword [eax + 0x28]
push dword [esi + 4]
call fcn.00480880
jmp 0x50f84f
mov esi, dword [ebp + 8]
test esi, esi
je 0x50fc43
push 0xa50
call fcn.00560437
add esp, 4
mov dword [ebp + 0xc], eax
mov dword [ebp - 4], 1
mov ecx, eax
call fcn.0047ffd0
mov edi, eax
mov dword [ebp + 0x14], eax
mov dword [ebp - 4], 0xffffffff
mov ecx, edi
push dword [esi]
call fcn.004807f0
test edi, edi
je 0x50fc43
mov dword [ebp - 0x30], edi
mov dword [ebp - 4], 2
mov eax, dword [ebp + 0x10]
cmp dword [eax + 0x48], 0
je 0x50fc0f
mov esi, dword [edi + 0x6d4]
push esi
mov dword [ebp - 0x38], 0
mov dword [ebp - 0x34], esi
call fcn.00560596
push esi
push 0
push eax
mov dword [ebp - 0x38], eax
call fcn.00588800
add esp, 0x10
mov byte [ebp - 4], 3
call fcn.0040bf10
mov ecx, eax
test ecx, ecx
je 0x50fc59
mov eax, dword [ecx]
call dword [eax + 0xc]
lea esi, [eax + 0x10]
mov dword [ebp + 0xc], esi
mov byte [ebp - 4], 5
cmp byte [ebp + 0x20], 0
jne 0x50f984
mov eax, dword [ebp + 0x10]
lea ecx, [ebp + 8]
push dword [ebp + 0x18]
mov edx, dword [eax]
call fcn.004df5e0
add esp, 4
mov byte [ebp - 4], 6
lea edi, [esi - 0x10]
mov edx, dword [eax]
lea ecx, [edx - 0x10]
cmp ecx, edi
je 0x50f927
cmp dword [edi + 0xc], 0
lea esi, [edi + 0xc]
jl 0x50f918
mov eax, dword [ecx]
cmp eax, dword [edi]
jne 0x50f918
call fcn.0040c950
mov dword [ebp + 0x18], eax
or ecx, 0xffffffff
lock xadd dword [esi], ecx
dec ecx
test ecx, ecx
jg 0x50f910
mov ecx, dword [edi]
push edi
mov edx, dword [ecx]
call dword [edx + 4]
mov eax, dword [ebp + 0x18]
lea esi, [eax + 0x10]
mov dword [ebp + 0xc], esi
jmp 0x50f927
push dword [edx - 0xc]
lea ecx, [ebp + 0xc]
push edx
call fcn.0040c9d0
mov esi, dword [ebp + 0xc]
mov byte [ebp - 4], 5
or eax, 0xffffffff
mov edx, dword [ebp + 8]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x50f946
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov edi, dword [ebp + 0x14]
push 0
push 0x80
push 2
push 0
push 0
push 0xc0000000
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x20], eax
cmp eax, 0xffffffff
jne 0x50f9bf
cmp byte [ebp + 0x20], 0
je 0x50f97d
mov ecx, dword [ebx + 8]
push 0
call fcn.004dfbe0
add esp, 4
xor ebx, ebx
jmp 0x50fbcd
mov edx, dword [ebp + 0x18]
test edx, edx
jne 0x50f99c
xor ecx, ecx
push ecx
push edx
lea ecx, [ebp + 0xc]
call fcn.0040c9d0
mov esi, dword [ebp + 0xc]
jmp 0x50f949
mov ecx, edx
lea esi, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x50f9a1
sub ecx, esi
sar ecx, 1
push ecx
push edx
lea ecx, [ebp + 0xc]
call fcn.0040c9d0
mov esi, dword [ebp + 0xc]
jmp 0x50f949
mov eax, dword [ebp + 0x10]
mov ecx, dword [eax + 0x48]
mov al, byte [ecx]
and al, 7
cmp al, 3
jne 0x50fa1e
cmp dword [ecx + 8], 0
je 0x50fbc2
mov ebx, dword [ecx + 4]
test ebx, ebx
je 0x50fbc2
push ebx
call fcn.00560596
mov edi, eax
mov eax, dword [ebp + 0x10]
push ebx
mov ecx, dword [eax + 0x48]
push dword [ecx + 8]
push edi
call fcn.00589190
add esp, 0x10
lea eax, [ebp - 0x2c]
push 0
push eax
push ebx
push edi
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_WriteFile]
push edi
mov ebx, eax
call fcn.00560591
add esp, 4
jmp 0x50fbc4
lea eax, [ebp + 0x18]
mov dword [ebp + 0x18], 0
push eax
push ecx
mov ecx, edi
call fcn.00482280
test eax, eax
je 0x50fbc2
cmp dword [ebp + 0x18], 0
je 0x50fbc2
push dword [edi + 0x6d4]
call fcn.00560596
mov dword [ebp - 0x10], eax
xor edx, edx
mov eax, dword [ebp + 0x10]
xor ecx, ecx
xor ebx, ebx
mov dword [ebp + 0x20], ecx
add esp, 4
mov dword [ebp + 8], ebx
mov dword [ebp - 0x14], ecx
mov edi, dword [eax + 0x48]
mov eax, dword [edi + 4]
div dword [ebp + 0x18]
test eax, eax
je 0x50fbfd
mov dword [ebp - 0x1c], ecx
mov dword [ebp - 0x18], ecx
nop dword [eax]
cmp dword [edi + 4], 0
je 0x50fae8
mov edx, dword [edi + 8]
test edx, edx
je 0x50fae8
movzx eax, word [edi]
and eax, 7
sub eax, 0
je 0x50facb
sub eax, 1
je 0x50faae
sub eax, 1
mov eax, dword [ebp + 0x14]
jne 0x50faeb
mov ebx, dword [ebp - 0x18]
mov ecx, dword [ebx + edx + 0xc]
jmp 0x50fab8
mov ebx, dword [ebp - 0x1c]
mov eax, dword [ebp + 0x14]
mov ecx, dword [ebx + edx + 4]
add ecx, dword [eax + 0x4bc]
mov ebx, dword [ebx + edx]
add ebx, ecx
mov dword [ebp + 0x20], ecx
mov dword [ebp + 8], ebx
jmp 0x50faeb
mov ebx, dword [ebp - 0x14]
mov eax, dword [ebp + 0x14]
mov ecx, dword [edx + ebx*8 + 4]
add ecx, dword [eax + 0x4bc]
mov ebx, dword [edx + ebx*8]
add ebx, ecx
mov dword [ebp + 0x20], ecx
mov dword [ebp + 8], ebx
jmp 0x50faeb
mov eax, dword [ebp + 0x14]
xor edx, edx
mov dword [ebp - 0x28], edx
sub ebx, ecx
je 0x50fb8e
jmp 0x50fafd
mov eax, dword [ebp + 0x14]
mov edi, dword [ebp + 0x1c]
test edi, edi
je 0x50fb0d
cmp dword [edi], 0
jne 0x50fbc2
mov edi, dword [eax + 0x6d4]
xor eax, eax
mov dword [ebp - 0x24], eax
cmp edx, eax
jb 0x50fb22
ja 0x50fb29
cmp ebx, edi
jae 0x50fb29
mov edi, ebx
mov dword [ebp - 0x24], edx
mov eax, edx
push dword [ebp - 0x10]
push eax
push edi
push 0
push ecx
mov ecx, dword [ebp + 0x14]
call fcn.00482090
push 0
lea eax, [ebp - 0x2c]
push eax
push edi
push dword [ebp - 0x10]
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x50fbb7
cmp dword [ebp - 0x24], 0
mov eax, dword [ebp + 0x14]
mov eax, dword [eax + 0x6d4]
jb 0x50fb8b
ja 0x50fb65
cmp edi, eax
jb 0x50fb8b
mov ecx, dword [ebp + 0x20]
mov edx, dword [ebp - 0x28]
inc ecx
sub ebx, eax
mov dword [ebp + 0x20], ecx
sbb edx, 0
mov dword [ebp - 0x28], edx
test edx, edx
ja 0x50fafa
jb 0x50fb8e
test ebx, ebx
jne 0x50fafa
jmp 0x50fb8e
mov ecx, dword [ebp + 0x20]
mov eax, dword [ebp + 0x10]
xor edx, edx
mov ebx, dword [ebp - 0x14]
add dword [ebp - 0x18], 0x18
inc ebx
add dword [ebp - 0x1c], 0x14
mov edi, dword [eax + 0x48]
mov dword [ebp - 0x14], ebx
mov eax, dword [edi + 4]
div dword [ebp + 0x18]
cmp ebx, eax
jae 0x50fbfd
mov ebx, dword [ebp + 8]
jmp 0x50fa80
push dword [ebp - 0x10]
call fcn.00560591
add esp, 4
xor ebx, ebx
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov byte [ebp - 4], 3
add esi, 0xfffffff0
or eax, 0xffffffff
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x50fbe9
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
mov byte [ebp - 4], 2
push dword [ebp - 0x38]
call fcn.00560591
mov edi, dword [ebp + 0x14]
add esp, 4
jmp 0x50fc11
push dword [ebp - 0x10]
call fcn.00560591
mov ebx, 1
add esp, 4
jmp 0x50fbc4
xor ebx, ebx
mov dword [ebp - 4], 0xffffffff
mov ecx, edi
call fcn.00480340
push 0xa50
push edi
call fcn.005603ff
add esp, 8
mov eax, ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x1c
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x1c
push 0x80004005
call fcn.0040b250
int3