Function at 0x7c8190
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
mov ebx, dword [esp + 0x14]
mov ebp, dword [esp + 0x18]
mov edi, dword [ecx]
mov esi, ecx
test ebx, ebx
jne 0x7c81be
mov ebx, edx
mov ecx, edi
movzx edx, bl
push 0
push ebp
call fcn.007c8160
mov edx, ebx
add esp, 8
mov ebx, eax
test eax, eax
je 0x7c81c8
cmp dword [ebx + 0xc], 0
jne 0x7c8433
movzx ebx, dl
mov ecx, edi
mov edx, ebx
push ebp
call fcn.007c8520
add esp, 4
mov ecx, edi
mov edx, ebx
push 0
push ebp
call fcn.007c8160
add esp, 8
test eax, eax
je 0x7c8208
cmp dword [eax + 0xc], 0
mov ebx, eax
jne 0x7c8433
mov ecx, edi
mov edx, ebx
call fcn.007c85c0
test eax, eax
je 0x7c8433
mov eax, fcn.007dc3b0
mov edx, 3
movzx edi, byte [0xbaff43]
sub edx, eax
xor eax, eax
mov ecx, edx
xor ecx, fcn.007dc3b0
sete al
mov ecx, eax
not ecx
lea eax, [eax + ecx*2]
and al, 3
movzx eax, al
bt edi, eax
jb 0x7c841b
mov al, byte [0xbaff43]
mov edi, edx
xor ecx, ecx
mov ah, 1
xor edi, fcn.007dc3b0
sete cl
mov ebx, ecx
not ebx
lea ecx, [ecx + ebx*2]
and cl, 3
xor cl, 7
shl ah, cl
or ah, al
lock cmpxchg byte [0xbaff43], ah
jne 0x7c8242
mov edx, fcn.007dc3b0
mov ecx, 3
movzx eax, al
sub ecx, edx
xor edx, edx
mov edi, ecx
xor edi, fcn.007dc3b0
sete dl
mov ebx, edx
not ebx
lea edx, [edx + ebx*2]
and dl, 3
xor dl, 7
movzx edx, dl
bt eax, edx
jae 0x7c82c7
mov edx, ecx
xor eax, eax
movzx edi, byte [0xbaff43]
xor edx, fcn.007dc3b0
sete al
mov edx, eax
not edx
lea eax, [eax + edx*2]
and al, 3
movzx eax, al
bt edi, eax
jae 0x7c829d
jmp 0x7c841b
xor eax, eax
xor ecx, fcn.007dc3b0
movzx edx, byte [0xbaff43]
sete al
mov ecx, eax
not ecx
lea eax, [eax + ecx*2]
and al, 3
movzx eax, al
bt edx, eax
jb 0x7c83ed
mov eax, fcn.007dc3b0
mov ecx, 3
sub ecx, eax
xor eax, eax
xor ecx, fcn.007dc3b0
sete al
mov ecx, eax
not ecx
and ecx, 0x805
lea ecx, [eax + ecx*2 + 0x5f71d160]
mov eax, dword [0xbaff20]
mov edx, ecx
shr edx, 0x1f
or edx, ecx
xor eax, ecx
and cl, 7
mov dword [0xbaff20], eax
not eax
imul edx, eax
mov eax, dword [0xbaff24]
lea edi, [edx + edx]
xor eax, edx
shr edx, 0x1e
mov dword [0xbaff24], eax
or edi, edx
not eax
mov edx, dword [0xbaff28]
imul eax, edi
lea edi, [eax*4]
xor edx, eax
shr eax, 0x1d
mov dword [0xbaff28], edx
or edi, eax
not edx
mov eax, dword [0xbaff2c]
imul edx, edi
lea edi, [edx*8]
xor eax, edx
shr edx, 0x1c
mov dword [0xbaff2c], eax
or edi, edx
not eax
mov edx, dword [0xbaff30]
imul eax, edi
mov edi, eax
shl edi, 4
xor edx, eax
shr eax, 0x1b
mov dword [0xbaff30], edx
or eax, edi
not edx
mov ebx, dword [0xbaff34]
imul edx, eax
mov edi, edx
shl edi, 5
xor ebx, edx
shr edx, 0x1a
mov dword [0xbaff34], ebx
or edx, edi
not ebx
imul ebx, edx
mov edx, dword [0xbaff38]
mov edi, ebx
shl edi, 6
xor edx, ebx
shr ebx, 0x19
mov dword [0xbaff38], edx
or ebx, edi
not edx
imul edx, ebx
xor dword [0xbaff3c], edx
mov dl, 1
shl dl, cl
or byte [0xbaff43], dl
mov eax, fcn.007dc3b0
mov ecx, 3
sub ecx, eax
xor eax, eax
xor ecx, fcn.007dc3b0
sete al
mov ecx, eax
not ecx
lea ecx, [eax + ecx*2]
mov al, 0xfe
and cl, 3
xor cl, 7
rol al, cl
and byte [0xbaff43], al
push ebp
push 0xbaff20
push esi
call fcn.00782570
add esp, 0xc
xor ebx, ebx
mov dword [esi + 0xc], 0x101
mov eax, ebx
pop esi
pop edi
pop ebx
pop ebp
ret