Function at 0x821540
Capabilities:
Encode data using xor

Disassembly:
push ebx
push edi
push esi
mov edi, edx
mov esi, ecx
call fcn.008222d0
test eax, eax
je 0x821770
mov edx, 0x7c42a0
xor eax, eax
movzx ebx, byte [0xbb2aa3]
not edx
and edx, 1
mov ecx, edx
add ecx, 0x7c42a0
sete al
mov ecx, eax
xor ecx, 5
lea eax, [ecx + eax*2 + 4]
and al, 7
movzx eax, al
bt ebx, eax
jb 0x821764
mov al, byte [0xbb2aa3]
mov ebx, edx
xor ecx, ecx
mov ah, 1
add ebx, 0x7c42a0
sete cl
mov ebx, ecx
xor ebx, 5
lea ecx, [ebx + ecx*2 + 4]
and cl, 7
xor cl, 7
shl ah, cl
or ah, al
lock cmpxchg byte [0xbb2aa3], ah
jne 0x82158e
mov ecx, 0x7c42a0
xor edx, edx
movzx eax, al
not ecx
and ecx, 1
mov ebx, ecx
add ebx, 0x7c42a0
sete dl
mov ebx, edx
xor ebx, 5
lea edx, [ebx + edx*2 + 4]
and dl, 7
xor dl, 7
movzx edx, dl
bt eax, edx
jae 0x821617
mov edx, ecx
xor eax, eax
movzx ebx, byte [0xbb2aa3]
add edx, 0x7c42a0
sete al
mov edx, eax
xor edx, 5
lea eax, [edx + eax*2 + 4]
and al, 7
movzx eax, al
bt ebx, eax
jae 0x8215eb
jmp 0x821764
xor eax, eax
add ecx, 0x7c42a0
movzx edx, byte [0xbb2aa3]
sete al
mov ecx, eax
xor ecx, 5
lea eax, [ecx + eax*2 + 4]
and al, 7
movzx eax, al
bt edx, eax
jb 0x821737
mov eax, 0x7c42a0
xor ecx, ecx
not eax
and eax, 1
add eax, 0x7c42a0
sete cl
mov eax, ecx
xor eax, 0x4576db45
lea ecx, [eax + ecx*2 + 0x854]
mov eax, dword [0xbb2a80]
mov edx, ecx
shr edx, 0x1f
or edx, ecx
xor eax, ecx
and cl, 7
mov dword [0xbb2a80], eax
not eax
imul edx, eax
mov eax, dword [0xbb2a84]
lea ebx, [edx + edx]
xor eax, edx
shr edx, 0x1e
mov dword [0xbb2a84], eax
or ebx, edx
not eax
mov edx, dword [0xbb2a88]
imul eax, ebx
lea ebx, [eax*4]
xor edx, eax
shr eax, 0x1d
mov dword [0xbb2a88], edx
or ebx, eax
not edx
mov eax, dword [0xbb2a8c]
imul edx, ebx
lea ebx, [edx*8]
xor eax, edx
shr edx, 0x1c
mov dword [0xbb2a8c], eax
or ebx, edx
not eax
mov edx, dword [0xbb2a90]
imul eax, ebx
mov ebx, eax
shl ebx, 4
xor edx, eax
shr eax, 0x1b
mov dword [0xbb2a90], edx
or eax, ebx
not edx
imul edx, eax
mov eax, dword [0xbb2a94]
mov ebx, edx
shl ebx, 5
xor eax, edx
shr edx, 0x1a
mov dword [0xbb2a94], eax
or edx, ebx
not eax
imul eax, edx
mov edx, dword [0xbb2a98]
mov ebx, eax
shl ebx, 6
xor edx, eax
shr eax, 0x19
mov dword [0xbb2a98], edx
or eax, ebx
not edx
imul edx, eax
xor dword [0xbb2a9c], edx
mov dl, 1
shl dl, cl
or byte [0xbb2aa3], dl
mov eax, 0x7c42a0
xor ecx, ecx
not eax
and eax, 1
add eax, 0x7c42a0
sete cl
mov eax, ecx
xor eax, 5
lea ecx, [eax + ecx*2 + 4]
mov al, 0xfe
and cl, 7
xor cl, 7
rol al, cl
and byte [0xbb2aa3], al
push dword [edi]
push 0xbb2a80
jmp 0x821988
mov ecx, dword [esp + 0x10]
xor eax, eax
test ecx, ecx
jne 0x821996
cmp dword [edi + 0xc], 0
je 0x821996
mov edx, fcn.0079c160
movzx ecx, byte [0xbb2adb]
imul edx, edx
and edx, 3
cmp edx, 1
seta al
not al
and al, 3
movzx eax, al
bt ecx, eax
jb 0x821981
mov al, byte [0xbb2adb]
cmp edx, 1
mov ah, 1
seta cl
not cl
and cl, 3
xor cl, 7
shl ah, cl
or ah, al
lock cmpxchg byte [0xbb2adb], ah
jne 0x8217b5
mov ecx, fcn.0079c160
movzx eax, al
imul ecx, ecx
and ecx, 3
cmp ecx, 1
seta dl
not dl
and dl, 3
xor dl, 7
movzx edx, dl
bt eax, edx
jae 0x821815
cmp ecx, 1
movzx edx, byte [0xbb2adb]
seta al
not al
and al, 3
movzx eax, al
bt edx, eax
jae 0x8217f7
jmp 0x821981
cmp ecx, 1
movzx ecx, byte [0xbb2adb]
seta al
not al
and al, 3
movzx eax, al
bt ecx, eax
jb 0x82195e
mov eax, fcn.0079c160
xor ecx, ecx
imul eax, eax
and eax, 3
cmp eax, 1
mov eax, dword [0xbb2ab0]
seta cl
xor ecx, 0xcff38ebb
add ecx, 0x208
mov edx, ecx
xor eax, ecx
shr edx, 0x1f
mov dword [0xbb2ab0], eax
not eax
or edx, ecx
and cl, 7
imul edx, eax
mov eax, dword [0xbb2ab4]
lea ebx, [edx + edx]
xor eax, edx
shr edx, 0x1e
mov dword [0xbb2ab4], eax
or ebx, edx
not eax
mov edx, dword [0xbb2ab8]
imul eax, ebx
lea ebx, [eax*4]
xor edx, eax
shr eax, 0x1d
mov dword [0xbb2ab8], edx
or ebx, eax
not edx
mov eax, dword [0xbb2abc]
imul edx, ebx
lea ebx, [edx*8]
xor eax, edx
shr edx, 0x1c
mov dword [0xbb2abc], eax
or ebx, edx
not eax
mov edx, dword [0xbb2ac0]
imul eax, ebx
mov ebx, eax
shl ebx, 4
xor edx, eax
shr eax, 0x1b
mov dword [0xbb2ac0], edx
or eax, ebx
not edx
imul edx, eax
mov eax, dword [0xbb2ac4]
mov ebx, edx
shl ebx, 5
xor eax, edx
shr edx, 0x1a
mov dword [0xbb2ac4], eax
or edx, ebx
not eax
imul eax, edx
mov edx, dword [0xbb2ac8]
mov ebx, eax
shl ebx, 6
xor edx, eax
shr eax, 0x19
mov dword [0xbb2ac8], edx
or eax, ebx
not edx
imul edx, eax
mov eax, dword [0xbb2acc]
mov ebx, edx
shl ebx, 7
xor eax, edx
shr edx, 0x18
mov dword [0xbb2acc], eax
or edx, ebx
not eax
imul eax, edx
mov edx, dword [0xbb2ad0]
mov ebx, eax
shl ebx, 8
xor edx, eax
shr eax, 0x17
mov dword [0xbb2ad0], edx
or eax, ebx
not edx
imul edx, eax
xor dword [0xbb2ad4], edx
mov dl, 1
shl dl, cl
or byte [0xbb2adb], dl
mov eax, fcn.0079c160
imul eax, eax
and eax, 3
cmp eax, 1
mov al, 0xfe
seta cl
not cl
and cl, 3
xor cl, 7
rol al, cl
and byte [0xbb2adb], al
push dword [edi]
push 0xbb2ab0
push esi
call fcn.00782570
add esp, 0xc
mov eax, 1
pop esi
pop edi
pop ebx
ret