Function at 0x10040e60
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x98
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
mov edi, ecx
mov dword [ebp - 0x98], esi
push 0
push eax
mov dword [ebp - 0x88], edi
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 0x10040ebf
pop edi
mov eax, 0x80004005
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.1005078e
mov esp, ebp
pop ebp
ret 0xc
mov al, byte [ebp + 0x10]
mov cl, byte [edi + 0x14]
cmp al, 0xff
jne 0x10040ed5
test cl, cl
setne cl
dec cl
and ecx, 0xffffff80
jmp 0x10040ee2
mov edx, 0x80
movzx ecx, cl
cmp al, dl
cmove ecx, edx
or ecx, 0x1f
mov dword [ebp - 0x90], 0
lea edx, [esi + 3]
mov dword [ebp - 0x8c], ecx
mov dword [ebp - 0x94], edx
nop
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 ax, word [esi]
mov byte [ebp - 0x43], 0
mov word [ebp - 0x3d], ax
movzx esi, cl
test cl, cl
je 0x10040f82
test edx, edx
je 0x10040f44
cmp esi, 0x35
ja 0x10040f44
push esi
push edx
lea eax, [ebp - 0x3b]
push eax
call sub.VCRUNTIME140.dll_memcpy
add esp, 0xc
jmp 0x10040f82
push 0x35
lea eax, [ebp - 0x3b]
push 0
push eax
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
cmp dword [ebp - 0x94], 0
jne 0x10040f6b
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [eax], 0x16
jmp 0x10040f7c
cmp esi, 0x35
jbe 0x10040f82
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 xmm1, xmm1
mov word [ebp - 0x3d], ax
movups xmm0, xmmword [ebp - 0x42]
mov eax, 0x22
xorps xmm2, xmm2
pxor xmm1, xmm0
movups xmm0, xmmword [ebp - 0x32]
pxor xmm0, xmm2
pxor xmm1, xmm0
movaps xmm0, xmm1
psrldq xmm0, 8
pxor xmm1, xmm0
movups xmm0, xmm1
psrldq xmm0, 4
pxor xmm1, xmm0
movups xmm0, xmm1
psrldq xmm0, 2
pxor xmm1, xmm0
movups xmm0, xmm1
psrldq xmm0, 1
pxor xmm1, xmm0
movd ecx, xmm1
nop
xor cl, byte [ebp + eax - 0x44]
inc eax
cmp eax, 0x35
jle 0x10040ff0
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]
mov eax, dword [eax + 0xc]
call eax
mov esi, eax
test esi, esi
js 0x100410e4
cmp dword [ebp + 0xc], 1
jne 0x100410f6
xor edi, edi
nop dword [eax]
push 0x40
lea eax, [ebp - 0x84]
push 0
push eax
call sub.VCRUNTIME140.dll_memset
mov esi, dword [ebp - 0x88]
add esp, 0xc
push dword [esi + 0x10]
call dword [sym.imp.KERNEL32.dll_Sleep]
mov ecx, dword [esi + 8]
lea edx, [ebp - 0x84]
mov al, byte [esi + 4]
mov byte [ebp - 0x84], al
push 0x40
mov eax, dword [ecx]
push edx
mov eax, dword [eax + 0x10]
call eax
mov esi, eax
test esi, esi
js 0x1004109e
mov al, byte [ebp - 0x82]
mov ecx, dword [ebp - 0x8c]
and al, 0x9f
cmp cl, al
jne 0x100410d7
mov ax, word [ebp - 0x7d]
cmp ax, word [ebp - 0x3d]
jne 0x10041099
cmp byte [ebp - 0x83], 2
je 0x100410ee
mov esi, 0x80004005
inc edi
cmp edi, 5
jl 0x10041030
mov edi, dword [ebp - 0x88]
test esi, esi
jns 0x100410f6
mov ecx, dword [ebp - 0x8c]
mov eax, dword [ebp - 0x90]
inc eax
mov dword [ebp - 0x90], eax
cmp eax, 5
jge 0x100410f6
mov edx, dword [ebp - 0x94]
mov esi, dword [ebp - 0x98]
jmp 0x10040f00
mov edi, dword [ebp - 0x88]
mov esi, 0x80004005
jmp 0x100410b4
cmp esi, 0x8000ffff
je 0x100410f6
jmp 0x100410aa
mov edi, dword [ebp - 0x88]
xor esi, esi
push dword [edi + 0xc]
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov ecx, dword [ebp - 4]
mov eax, esi
pop edi
xor ecx, ebp
pop esi
call fcn.1005078e
mov esp, ebp
pop ebp
ret 0xc