Function at 0x10040b20
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x94
mov eax, dword [0x10072f40]
xor eax, ebp
mov dword [ebp - 4], eax
push esi
mov esi, dword [ebp + 8]
lea eax, [ebp - 0x44]
push edi
push 0x40
push 0
push eax
mov edi, ecx
mov dword [ebp - 0x90], esi
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
push 0x1388
push dword [edi + 0xc]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x10040b79
pop edi
mov eax, 0x80004005
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.1005078e
mov esp, ebp
pop ebp
ret 8
mov al, byte [ebp + 0xc]
mov edx, 0x80
mov cl, byte [edi + 0x14]
cmp al, 0xff
jne 0x10040b94
test cl, cl
setne cl
dec cl
and ecx, 0xffffff80
jmp 0x10040b9c
cmp al, 0x80
movzx ecx, cl
cmove ecx, edx
push ebx
or ecx, 0x1f
mov dword [ebp - 0x8c], 0
lea ebx, [esi + 3]
mov dword [ebp - 0x88], ecx
mov dword [ebp - 0x94], ebx
nop dword [eax]
mov al, byte [edi + 4]
mov byte [ebp - 0x44], al
xor eax, eax
mov byte [ebp - 0x42], cl
mov cl, byte [esi + 2]
mov word [ebp - 0x41], ax
movzx eax, cl
mov word [ebp - 0x3f], ax
mov eax, edx
or ax, word [esi]
mov byte [ebp - 0x43], 0
mov word [ebp - 0x3d], ax
movzx esi, cl
test cl, cl
je 0x10040c3f
test ebx, ebx
je 0x10040c06
cmp esi, 0x35
ja 0x10040c06
push esi
lea eax, [ebp - 0x3b]
push ebx
push eax
call sub.VCRUNTIME140.dll_memcpy
add esp, 0xc
jmp 0x10040c3f
push 0x35
lea eax, [ebp - 0x3b]
push 0
push eax
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
test ebx, ebx
jne 0x10040c28
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [eax], 0x16
jmp 0x10040c39
cmp esi, 0x35
jbe 0x10040c3f
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [eax], 0x22
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo]
push dword [ebp - 0x3f]
mov eax, dword [edi]
push edi
call dword [eax + 0x30]
push dword [ebp - 0x3d]
mov word [ebp - 0x3f], ax
mov eax, dword [edi]
push edi
call dword [eax + 0x30]
xorps xmm2, xmm2
mov word [ebp - 0x3d], ax
movups xmm0, xmmword [ebp - 0x42]
mov eax, 0x22
xorps xmm1, xmm1
pxor xmm2, xmm0
movups xmm0, xmmword [ebp - 0x32]
pxor xmm1, xmm0
pxor xmm2, xmm1
movaps xmm0, xmm2
psrldq xmm0, 8
pxor xmm2, xmm0
movups xmm0, xmm2
psrldq xmm0, 4
pxor xmm2, xmm0
movups xmm0, xmm2
psrldq xmm0, 2
pxor xmm2, xmm0
movups xmm0, xmm2
psrldq xmm0, 1
pxor xmm2, xmm0
movd ecx, xmm2
nop dword [eax]
xor cl, byte [ebp + eax - 0x44]
inc eax
cmp eax, 0x35
jle 0x10040cb0
push dword [edi + 0x10]
mov byte [ebp - 6], cl
call dword [sym.imp.KERNEL32.dll_Sleep]
mov ecx, dword [edi + 8]
lea edx, [ebp - 0x44]
push 0x40
push edx
mov eax, dword [ecx]
call dword [eax + 0xc]
mov esi, eax
test esi, esi
js 0x10040d7d
xor ebx, ebx
push 0x40
lea eax, [ebp - 0x84]
push 0
push eax
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
push dword [edi + 0x10]
call dword [sym.imp.KERNEL32.dll_Sleep]
mov ecx, dword [edi + 8]
lea edx, [ebp - 0x84]
mov al, byte [edi + 4]
mov byte [ebp - 0x84], al
push 0x40
mov eax, dword [ecx]
push edx
call dword [eax + 0x10]
mov esi, eax
test esi, esi
js 0x10040d46
mov al, byte [ebp - 0x82]
mov ecx, dword [ebp - 0x88]
and al, 0x9f
cmp cl, al
jne 0x10040d76
mov ax, word [ebp - 0x7d]
cmp ax, word [ebp - 0x3d]
jne 0x10040d41
cmp byte [ebp - 0x83], 2
je 0x10040d4e
mov esi, 0x80004005
inc ebx
cmp ebx, 5
jl 0x10040ce0
jmp 0x10040d89
mov eax, dword [ebp - 0x80]
mov ecx, dword [edi]
shr eax, 8
push eax
push edi
call dword [ecx + 0x30]
movzx ecx, ax
mov eax, dword [ebp - 0x90]
mov dl, byte [eax + 2]
movzx eax, dl
cmp ax, cx
jae 0x10040dbf
mov esi, 0x80004005
jmp 0x10040d91
mov esi, 0x80004005
jmp 0x10040d97
cmp esi, 0x8000ffff
je 0x10040e14
test esi, esi
jns 0x10040e14
mov ecx, dword [ebp - 0x88]
mov edx, dword [ebp - 0x8c]
inc edx
mov dword [ebp - 0x8c], edx
cmp edx, 5
jge 0x10040e14
mov ebx, dword [ebp - 0x94]
mov edx, 0x80
mov esi, dword [ebp - 0x90]
jmp 0x10040bc0
mov eax, ecx
movzx edx, dl
test eax, eax
je 0x10040e12
mov ecx, dword [ebp - 0x94]
test ecx, ecx
jne 0x10040de0
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [eax], 0x16
jmp 0x10040e0c
cmp edx, eax
jb 0x10040df4
push eax
lea eax, [ebp - 0x7b]
push eax
push ecx
call sub.VCRUNTIME140.dll_memcpy
add esp, 0xc
jmp 0x10040e12
push edx
push 0
push ecx
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [eax], 0x22
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo]
xor esi, esi
push dword [edi + 0xc]
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov ecx, dword [ebp - 4]
mov eax, esi
pop ebx
pop edi
xor ecx, ebp
pop esi
call fcn.1005078e
mov esp, ebp
pop ebp
ret 8