Function at 0x40b160
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x460
push ebx
push esi
push edi
mov edi, ecx
cmp dword [edi + 0xa4], 1
jne 0x40b422
mov esi, dword [edi + 4]
mov dword [ebp - 0x14], esi
lea eax, [esi - 0x10]
cmp eax, 0x3f0
ja 0x40b422
mov ecx, dword [edi + 0xa8]
sub ecx, 3
cmp ecx, 6
ja 0x40b422
call fcn.0040d670
mov dword [ebp - 8], eax
test eax, eax
je 0x40b422
movzx ebx, byte [eax + 8]
lea eax, [ebx + ebx]
lea ecx, [eax + 2]
mov dword [ebp - 0x10], eax
cmp ecx, esi
ja 0x40b422
lea eax, [ebp - 0x460]
mov ecx, edi
push eax
push dword [ebp + 0x1c]
push dword [ebp + 8]
call fcn.0040a450
mov edi, eax
add esp, 0xc
test edi, edi
jne 0x40b3f2
mov edi, dword [ebp - 8]
xorps xmm0, xmm0
movq qword [ebp - 0x20], xmm0
mov dword [ebp - 0x18], eax
mov eax, dword [edi + 0x20]
call eax
mov dword [ebp - 0x1c], eax
lea ecx, [ebp - 0x20]
test eax, eax
jne 0x40b20e
mov edi, 0xffffae80
jmp 0x40b3ed
mov eax, esi
mov dword [ebp - 0x20], edi
sub eax, ebx
lea esi, [ebp - 0x45f]
push ecx
dec eax
lea ecx, [ebp - 0x45f]
push eax
add esi, ebx
mov dword [ebp - 0xc], eax
push esi
mov edx, ebx
call fcn.0040ab50
mov edi, eax
add esp, 0xc
test edi, edi
jne 0x40b3ea
mov edx, dword [ebp - 0xc]
lea eax, [ebp - 0x20]
push eax
lea eax, [ebp - 0x45f]
mov ecx, esi
push ebx
push eax
call fcn.0040ab50
mov edi, eax
add esp, 0xc
test edi, edi
jne 0x40b3ea
lea ecx, [ebp - 0x20]
call fcn.0040d6d0
mov ecx, dword [ebp - 8]
lea eax, [ebp - 0x60]
push eax
push edi
xor edx, edx
call fcn.0040d8c0
mov edi, eax
add esp, 8
test edi, edi
jne 0x40b3f2
mov dl, byte [ebp - 0x460]
xor ecx, ecx
mov byte [ebp - 1], dl
test ebx, ebx
je 0x40b331
cmp ebx, 0x20
jb 0x40b318
mov eax, ebx
xorps xmm2, xmm2
and eax, 0xffffffe0
xorps xmm3, xmm3
nop dword [eax + eax]
movups xmm0, xmmword [esi]
movups xmm1, xmmword [ebp + ecx - 0x60]
pxor xmm1, xmm0
movups xmm0, xmmword [esi + 0x10]
add esi, 0x20
por xmm2, xmm1
movups xmm1, xmmword [ebp + ecx - 0x50]
add ecx, 0x20
pxor xmm1, xmm0
por xmm3, xmm1
cmp ecx, eax
jb 0x40b2b0
por xmm2, xmm3
movaps xmm0, xmm2
psrldq xmm0, 8
por xmm2, xmm0
movups xmm0, xmm2
psrldq xmm0, 4
por xmm2, xmm0
movups xmm0, xmm2
psrldq xmm0, 2
por xmm2, xmm0
movups xmm0, xmm2
psrldq xmm0, 1
por xmm2, xmm0
movd eax, xmm2
or dl, al
mov byte [ebp - 1], dl
cmp ecx, ebx
jae 0x40b331
nop dword [eax]
mov al, byte [ebp + ecx - 0x60]
inc ecx
xor al, byte [esi]
inc esi
or dl, al
cmp ecx, ebx
jb 0x40b320
mov byte [ebp - 1], dl
mov eax, dword [ebp - 0x14]
xor ebx, ebx
sub eax, dword [ebp - 0x10]
xor edi, edi
add eax, 0xfffffffe
mov dword [ebp - 0xc], ebx
xor cl, cl
mov dword [ebp - 8], eax
xor edx, edx
cmp eax, 2
jb 0x40b388
nop dword [eax]
or cl, byte [esi + edx]
mov al, cl
neg al
or al, cl
or cl, byte [esi + edx + 1]
not al
add edx, 2
movzx eax, al
shr eax, 7
add edi, eax
mov al, cl
neg al
mov dword [ebp - 0x10], edi
or al, cl
not al
movzx eax, al
shr eax, 7
add ebx, eax
mov eax, dword [ebp - 8]
dec eax
cmp edx, eax
jb 0x40b350
mov eax, dword [ebp - 8]
cmp edx, eax
jae 0x40b3a0
or cl, byte [edx + esi]
mov al, cl
neg al
or al, cl
not al
movzx eax, al
shr eax, 7
mov dword [ebp - 0xc], eax
mov cl, byte [ebp - 1]
lea eax, [edi + ebx]
add eax, dword [ebp - 0xc]
add esi, eax
mov al, byte [esi]
inc esi
xor al, 1
or cl, al
je 0x40b3bb
mov edi, 0xffffbf00
jmp 0x40b3f2
mov eax, dword [ebp - 0x14]
lea ecx, [ebp - 0x460]
sub eax, esi
add ecx, eax
cmp ecx, dword [ebp + 0x24]
jbe 0x40b3d4
mov edi, 0xffffbc00
jmp 0x40b3f2
mov eax, dword [ebp + 0x18]
push ecx
push esi
push dword [ebp + 0x20]
mov dword [eax], ecx
call sub.ntdll.dll_memcpy
add esp, 0xc
xor edi, edi
jmp 0x40b3f2
lea ecx, [ebp - 0x20]
call fcn.0040d6d0
push 0x400
lea eax, [ebp - 0x460]
push 0
push eax
mov eax, dword [sub.ntdll.dll_memset]
call eax
push 0x40
lea eax, [ebp - 0x60]
push 0
push eax
mov eax, dword [sub.ntdll.dll_memset]
call eax
add esp, 0x18
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
pop edi
pop esi
mov eax, 0xffffbf80
pop ebx
mov esp, ebp
pop ebp
ret