Function at 0x100f5140
Capabilities:
Encode data using xor
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 8
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
mov ebx, dword [edi + 0xc]
call fcn.10002d70
push 2
push ebx
mov ecx, eax
mov edx, dword [eax]
call dword [edx]
test eax, eax
je 0x100f5398
lea esi, [eax + 0x10]
xor eax, eax
lea ecx, [ebx + ebx]
mov dword [esi - 0xc], ebx
push ecx
mov word [ecx + esi], ax
lea eax, [edi + 0x10]
push eax
push ecx
push esi
mov dword [ebp - 8], esi
call fcn.10004510
add esp, 0x10
call fcn.10002d70
mov ecx, eax
mov edx, dword [eax]
call dword [edx + 0xc]
add eax, 0x10
lea ecx, [ebp - 4]
push esi
mov dword [ebp + 8], eax
call fcn.1005b130
push dword [eax]
lea eax, [ebp + 8]
push dword [edi + 4]
push str._option__r_nhomePageProtect_d_r_nhomepage_s_r_n
push eax
call fcn.100993d0
mov edx, dword [ebp - 4]
add esp, 0x10
add edx, 0xfffffff0
or eax, 0xffffffff
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x100f51d2
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov edi, dword [ebp + 8]
mov eax, dword [edi - 0xc]
inc eax
mov ebx, eax
and ebx, 0x80000003
jns 0x100f51e8
dec ebx
or ebx, 0xfffffffc
inc ebx
neg ebx
cdq
push 0x1025c02a
sbb ebx, ebx
and edx, 3
add eax, edx
neg ebx
sar eax, 2
xor ecx, ecx
add ebx, eax
mov edx, 4
mov eax, ebx
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.101c85a0
add esp, 8
mov dword [ebp + 8], eax
test eax, eax
je 0x100f535b
lea ecx, [ebx*4]
push ecx
push 0x20
push eax
mov dword [ebp - 4], ecx
call sub.msvcrt.dll_memset
push dword [edi - 0xc]
mov esi, dword [ebp + 8]
push edi
push esi
call sub.msvcrt.dll_memcpy
add esp, 0x18
mov eax, esi
test ebx, ebx
jle 0x100f525e
lea ecx, [ecx]
xor dword [eax], 0x4f484951
lea eax, [eax + 4]
sub ebx, 1
jne 0x100f5250
call fcn.10003180
mov esi, dword [eax + 0x154]
test esi, esi
je 0x100f5274
push esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
push 8
call fcn.10003680
add esp, 4
push 0
push 0
push 2
push 0
push 0
push 0x40000000
push dword [ebp + 0xc]
test eax, eax
je 0x100f5298
call eax
jmp 0x100f529e
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
test esi, esi
je 0x100f52ab
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
cmp ebx, 0xffffffff
je 0x100f5346
mov dword [ebp + 0xc], 0
call fcn.10003180
mov esi, dword [eax + 0x154]
test esi, esi
je 0x100f52d1
push esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
push 0xa
call fcn.10003680
add esp, 4
push 0
test eax, eax
je 0x100f52f0
lea ecx, [ebp + 0xc]
push ecx
push dword [ebp - 4]
push dword [ebp + 8]
push ebx
call eax
jmp 0x100f5301
lea eax, [ebp + 0xc]
push eax
push dword [ebp - 4]
push dword [ebp + 8]
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test esi, esi
je 0x100f530c
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
call fcn.10003180
mov esi, dword [eax + 0x154]
test esi, esi
je 0x100f5322
push esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
push 0x14
call fcn.10003680
add esp, 4
push ebx
test eax, eax
je 0x100f5335
call eax
jmp 0x100f533b
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test esi, esi
je 0x100f5346
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push dword [ebp + 8]
call sub.msvcrt.dll_void___cdecl_operator_delete___void__
mov esi, dword [ebp - 8]
add esp, 4
mov ebx, 1
jmp 0x100f535d
xor ebx, ebx
add edi, 0xfffffff0
or eax, 0xffffffff
lock xadd dword [edi + 0xc], eax
dec eax
test eax, eax
jg 0x100f5375
mov ecx, dword [edi]
push edi
mov eax, dword [ecx]
call dword [eax + 4]
add esi, 0xfffffff0
or eax, 0xffffffff
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x100f538d
mov ecx, dword [esi]
push esi
mov edx, dword [ecx]
call dword [edx + 4]
pop edi
pop esi
mov eax, ebx
pop ebx
mov esp, ebp
pop ebp
ret 8
call fcn.10003970
int3