Function at 0x81c8a0
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x10
test byte [edx + 0x28], 4
mov dword [esp + 4], ecx
je 0x81cbe2
mov eax, dword [edx + 0x40]
mov edi, edx
test eax, eax
je 0x81cbe2
cmp dword [eax], 0
jle 0x81cbe2
mov ebx, dword [edi + 0x10]
xor esi, esi
mov dword [esp], 0
mov dword [esp + 8], eax
movsx eax, word [ebx + 0x2a]
cmp esi, eax
jge 0x81c8f9
mov ecx, dword [ebx + 4]
lea edx, [esi + esi*4]
test byte [ecx + edx*4 + 0x10], 2
jne 0x81cb31
inc esi
cmp esi, eax
jl 0x81c8e6
mov edx, 0x794860
xor eax, eax
movzx esi, byte [0xbb9cdb]
imul edx, edx
and edx, 3
cmp edx, 1
seta al
mov ecx, eax
xor ecx, 5
lea eax, [ecx + eax*2]
bt esi, eax
jb 0x81cb16
mov al, byte [0xbb9cdb]
mov esi, ebx
xor ecx, ecx
cmp edx, 1
mov ah, 1
seta cl
mov ebx, ecx
xor ebx, 5
lea ecx, [ebx + ecx*2]
xor cl, 7
shl ah, cl
or ah, al
lock cmpxchg byte [0xbb9cdb], ah
jne 0x81c92b
mov ecx, 0x794860
xor edx, edx
movzx eax, al
imul ecx, ecx
and ecx, 3
cmp ecx, 1
seta dl
mov ebx, edx
xor ebx, 5
lea edx, [ebx + edx*2]
xor dl, 7
movzx edx, dl
bt eax, edx
jae 0x81c99a
mov ebx, esi
xor eax, eax
cmp ecx, 1
movzx esi, byte [0xbb9cdb]
seta al
mov edx, eax
xor edx, 5
lea eax, [edx + eax*2]
bt esi, eax
jae 0x81c979
jmp 0x81cb16
xor eax, eax
cmp ecx, 1
movzx edx, byte [0xbb9cdb]
mov ebx, esi
seta al
mov ecx, eax
xor ecx, 5
lea eax, [ecx + eax*2]
bt edx, eax
jb 0x81caee
mov eax, 0x794860
xor ecx, ecx
imul eax, eax
and eax, 3
cmp eax, 1
seta cl
mov eax, ecx
xor eax, 0xe11dc695
lea ecx, [eax + ecx*2 + 0x1050]
mov eax, dword [0xbb9cb0]
mov edx, ecx
shr edx, 0x1f
or edx, ecx
xor eax, ecx
and cl, 7
mov dword [0xbb9cb0], eax
not eax
imul edx, eax
mov eax, dword [0xbb9cb4]
lea esi, [edx + edx]
xor eax, edx
shr edx, 0x1e
mov dword [0xbb9cb4], eax
or esi, edx
not eax
mov edx, dword [0xbb9cb8]
imul eax, esi
lea esi, [eax*4]
xor edx, eax
shr eax, 0x1d
mov dword [0xbb9cb8], edx
or esi, eax
not edx
mov eax, dword [0xbb9cbc]
imul edx, esi
lea esi, [edx*8]
xor eax, edx
shr edx, 0x1c
mov dword [0xbb9cbc], eax
or esi, edx
not eax
mov edx, dword [0xbb9cc0]
imul eax, esi
mov esi, eax
shl esi, 4
xor edx, eax
shr eax, 0x1b
mov dword [0xbb9cc0], edx
or eax, esi
not edx
mov ebp, dword [0xbb9cc4]
imul edx, eax
mov esi, edx
shl esi, 5
xor ebp, edx
shr edx, 0x1a
mov dword [0xbb9cc4], ebp
or edx, esi
not ebp
imul ebp, edx
mov edx, dword [0xbb9cc8]
mov esi, ebp
shl esi, 6
xor edx, ebp
shr ebp, 0x19
mov dword [0xbb9cc8], edx
or ebp, esi
not edx
mov edi, dword [0xbb9ccc]
imul edx, ebp
mov esi, edx
shl esi, 7
xor edi, edx
shr edx, 0x18
mov dword [0xbb9ccc], edi
or edx, esi
not edi
imul edi, edx
mov edx, dword [0xbb9cd0]
mov esi, edi
shl esi, 8
xor edx, edi
shr edi, 0x17
mov dword [0xbb9cd0], edx
or edi, esi
not edx
imul edx, edi
xor dword [0xbb9cd4], edx
mov dl, 1
shl dl, cl
or byte [0xbb9cdb], dl
mov eax, 0x794860
xor ecx, ecx
imul eax, eax
and eax, 3
cmp eax, 1
seta cl
mov eax, ecx
xor eax, 5
lea ecx, [eax + ecx*2]
mov al, 0xfe
xor cl, 7
rol al, cl
and byte [0xbb9cdb], al
push dword [esp]
push dword [ebx]
push 0xbb9cb0
push dword [esp + 0x10]
call fcn.0078de60
add esp, 0x20
jmp 0x81cbe5
mov eax, dword [esp + 4]
mov edx, 0xa4
mov ecx, dword [eax]
push 0
push 0
call fcn.007e4510
add esp, 8
mov ecx, dword [esp + 8]
test eax, eax
je 0x81cbe2
mov ebp, eax
mov eax, dword [edi + 0x2c]
mov dword [esp + 0xc], ebx
mov dword [ebp + 0x1c], eax
mov eax, dword [esp]
mov word [ebp + 0x20], si
mov dword [ebp + 0x2c], ebx
mov ebx, dword [esp + 4]
lea eax, [eax + eax*4]
mov edx, dword [ecx + eax*4 + 4]
mov ecx, dword [ebx]
push 0
call fcn.007fc000
add esp, 4
mov ecx, ebx
mov edx, 0xab
push 0
push eax
call fcn.007db7a0
add esp, 8
mov ecx, ebx
mov edx, 0x35
push eax
push ebp
call fcn.007db7a0
add esp, 8
test byte [edi + 0x24], 8
mov ebp, eax
je 0x81cbb6
mov edx, dword [edi + 0x2c]
mov ecx, ebp
call fcn.0080e2c0
mov ecx, dword [esp + 0x24]
inc esi
mov edx, ebp
push 1
call fcn.008219d0
add esp, 4
mov eax, dword [esp]
mov ebx, dword [esp + 0xc]
mov ecx, eax
inc ecx
mov eax, ecx
mov eax, dword [esp + 8]
mov dword [esp], ecx
cmp ecx, dword [eax]
jl 0x81c8db
add esp, 0x10
pop esi
pop edi
pop ebx
pop ebp
ret