Function at 0x402560
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x2d4
mov eax, dword [0x46f084]
xor eax, esp
mov dword [esp + 0x2d0], eax
mov eax, dword [ebp + 8]
mov dword [esp + 0xc], eax
mov eax, dword [ebp + 0x10]
push ebx
mov dword [esp + 0x30], eax
mov eax, dword [ebp + 0x14]
push esi
mov dword [esp + 0x3c], eax
mov eax, dword [ebp + 0x1c]
push edi
mov dword [esp + 0x44], eax
mov edi, ecx
mov eax, dword [ebp + 0x20]
push 0xa8
mov dword [esp + 0x34], eax
lea eax, [esp + 0x18c]
push 0
push eax
mov byte [esp + 0x1f], dl
call sub.VCRUNTIME140.dll_memset
mov ebx, dword [ebp + 0xc]
add esp, 0xc
cmp bl, 0x20
ja 0x4025e2
cmp byte [ebp + 0x18], 0x20
ja 0x4025e2
mov byte [esp + 0x230], 1
mov esi, 0x20
mov dword [esp + 0x2c], 0x2a
jmp 0x4025f7
mov byte [esp + 0x230], 2
mov esi, 0x9e
mov dword [esp + 0x2c], 0xa8
push 0xffffffffffffffff
push dword [esp + 0x34]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov edx, dword [esp + 0x18]
lea eax, [esp + 0x230]
mov cl, byte [esp + 0x13]
push esi
push eax
push dword [esp + 0x40]
push ebx
call fcn.004022f0
mov esi, dword [edi + 4]
add esp, 0x10
cmp dword [0x48af54], 0
mov ebx, 0x1e
mov dword [esp + 0x18], esi
je 0x40263f
mov eax, dword [0x48af50]
test eax, eax
jne 0x402685
push str.hid.dll
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov edi, eax
push str.HidD_GetFeature
push edi
call esi
push str.HidD_SetFeature
push edi
mov dword [0x48af54], eax
call esi
cmp dword [0x48af54], 0
mov dword [0x48af50], eax
je 0x402974
test eax, eax
je 0x402974
mov esi, dword [esp + 0x18]
mov edi, dword [esp + 0x2c]
lea ecx, [esp + 0x230]
push edi
push ecx
push esi
call eax
test al, al
je 0x402974
mov eax, ebx
nop
dec eax
mov dword [esp + 0x34], eax
mov al, byte [esp + 0x230]
mov byte [esp + 0x188], al
lea eax, [esp + 0x188]
push edi
push eax
push esi
call dword [0x48af54]
movzx esi, al
call dword [sym.imp.KERNEL32.dll_GetLastError]
test esi, esi
jne 0x40271c
cmp eax, 0x79
je 0x4026eb
cmp eax, 0x1f
je 0x4026eb
cmp eax, 0x17
je 0x4026eb
cmp eax, 2
je 0x4026eb
cmp eax, 0x3e3
jne 0x402714
sub ebx, 1
js 0x402974
push edi
lea eax, [esp + 0x18c]
push eax
push dword [esp + 0x20]
call dword [0x48af54]
movzx esi, al
call dword [sym.imp.KERNEL32.dll_GetLastError]
test esi, esi
je 0x4026d0
test esi, esi
je 0x402974
movzx eax, byte [esp + 0x191]
xor ecx, ecx
mov dword [esp + 0x14], 0
mov dword [esp + 0x3c], eax
lea edi, [eax + 0xa]
mov esi, edi
and edi, 1
shr esi, 1
je 0x4027a8
cmp esi, 0x10
jb 0x4027a8
mov eax, esi
mov edx, esi
and eax, 0xf
xorps xmm2, xmm2
sub edx, eax
xorps xmm1, xmm1
movups xmm0, xmmword [esp + ecx*2 + 0x188]
pxor xmm2, xmm0
movups xmm0, xmmword [esp + ecx*2 + 0x198]
add ecx, 0x10
pxor xmm1, xmm0
cmp ecx, edx
jl 0x402752
pxor xmm1, xmm2
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
movd eax, xmm1
movzx eax, ax
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x3c]
mov dx, word [esp + 0x14]
cmp ecx, esi
jge 0x4027c3
xor dx, word [esp + ecx*2 + 0x188]
inc ecx
cmp ecx, esi
jl 0x4027b1
mov word [esp + 0x14], dx
test edi, edi
je 0x4027d7
movzx eax, byte [esp + eax + 0x191]
xor dx, ax
mov word [esp + 0x14], dx
mov eax, dword [esp + 0x18e]
xor eax, dword [esp + 0x14]
cmp ax, word [esp + 0x18e]
je 0x402805
mov eax, dword [esp + 0x34]
test eax, eax
je 0x402974
mov edi, dword [esp + 0x2c]
mov esi, dword [esp + 0x18]
jmp 0x4026a0
push dword [esp + 0x30]
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
test byte [esp + 0x18d], 0x80
mov dword [esp + 0x1c], 0xddccbbaa
mov dword [esp + 0x20], 0x2211ffee
mov dword [esp + 0x24], 0x66554433
mov dword [esp + 0x28], 0x99998877
je 0x402931
movzx ebx, byte [esp + 0x191]
test bl, 0xf
jne 0x402913
mov edx, dword [esp + 0x38]
push ecx
lea ecx, [esp + 0xdc]
call fcn.00403980
mov esi, eax
lea ecx, [esp + 0xdc]
lea eax, [esp + 0x4c]
mov dword [esp + 0x38], esi
push eax
lea eax, [esp + 0x19a]
mov edx, esi
push eax
call fcn.00404b60
movups xmm0, xmmword [esp + 0x54]
shr ebx, 4
add esp, 0xc
movups xmm1, xmmword [esp + 0x1c]
pxor xmm1, xmm0
movups xmmword [esp + 0x48], xmm1
cmp ebx, 1
jbe 0x402913
xor edi, edi
dec ebx
lea eax, [esp + 0x58]
mov edx, esi
add eax, edi
lea ecx, [esp + 0xd8]
push eax
lea eax, [esp + 0x1a6]
add eax, edi
push eax
call fcn.00404b60
lea eax, [esp + 0x62]
add esp, 8
lea edx, [esp + 0x193]
add eax, edi
add edx, edi
mov esi, 4
nop word [eax + eax]
movzx ecx, byte [edx - 1]
lea edx, [edx + 4]
xor byte [eax - 2], cl
lea eax, [eax + 4]
movzx ecx, byte [edx - 4]
xor byte [eax - 5], cl
movzx ecx, byte [edx - 3]
xor byte [eax - 4], cl
movzx ecx, byte [edx - 2]
xor byte [eax - 3], cl
sub esi, 1
jne 0x4028e0
mov esi, dword [esp + 0x34]
add edi, 0x10
sub ebx, 1
jne 0x4028a1
movzx eax, byte [esp + 0x191]
push eax
lea eax, [esp + 0x4c]
push eax
lea eax, [esp + 0x19a]
push eax
call sub.VCRUNTIME140.dll_memcpy
add esp, 0xc
mov al, byte [ebp + 0x18]
test al, al
je 0x402950
movzx eax, al
push eax
lea eax, [esp + 0x196]
push eax
push dword [esp + 0x48]
call sub.VCRUNTIME140.dll_memcpy
add esp, 0xc
mov ecx, dword [esp + 0x44]
mov al, byte [esp + 0x190]
mov byte [ecx], al
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x2d0]
xor ecx, esp
call fcn.0042df20
mov esp, ebp
pop ebp
ret
push dword [esp + 0x30]
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov ecx, dword [esp + 0x2dc]
or eax, 0xffffffff
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.0042df20
mov esp, ebp
pop ebp
ret