Function at 0x812770
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x10
mov edi, dword [esp + 0x24]
mov ebx, edx
mov esi, ecx
call fcn.007f7590
mov ecx, esi
mov dword [esp + 0xc], eax
call fcn.007fcfa0
mov ebp, eax
cmp ebx, 1
jg 0x8128e3
mov edx, fcn.00789590
movzx ecx, byte [0xbb9853]
imul edx, edx
and edx, 3
cmp edx, 2
sete al
or al, 4
movzx eax, al
bt ecx, eax
jb 0x8128d5
mov al, byte [0xbb9853]
cmp edx, 2
mov ah, 1
sete cl
or cl, 4
xor cl, 7
shl ah, cl
or ah, al
lock cmpxchg byte [0xbb9853], ah
jne 0x8127c5
mov ecx, fcn.00789590
movzx eax, al
imul ecx, ecx
and ecx, 3
cmp ecx, 2
sete dl
or dl, 4
xor dl, 7
movzx edx, dl
bt eax, edx
jae 0x81281f
cmp ecx, 2
movzx edx, byte [0xbb9853]
sete al
or al, 4
movzx eax, al
bt edx, eax
jae 0x812803
jmp 0x8128d5
cmp ecx, 2
movzx edx, byte [0xbb9853]
sete al
or al, 4
movzx eax, al
bt edx, eax
jb 0x8128b4
mov eax, fcn.00789590
xor ecx, ecx
mov edx, dword [str.O__e]
mov dword [esp], ebx
imul eax, eax
and eax, 3
cmp eax, 2
sete cl
mov eax, ecx
or cl, 4
or eax, 0x174d4a2c
xor edx, eax
mov dword [str.O__e], edx
not edx
imul edx, eax
mov eax, dword [0xbb9844]
lea ebx, [edx + edx]
xor eax, edx
shr edx, 0x1e
mov dword [0xbb9844], eax
or edx, ebx
not eax
imul eax, edx
mov edx, dword [0xbb9848]
lea ebx, [eax*4]
xor edx, eax
shr eax, 0x1d
mov dword [0xbb9848], edx
or eax, ebx
not edx
mov ebx, dword [esp]
imul edx, eax
xor dword [0xbb984c], edx
mov dl, 1
shl dl, cl
or byte [0xbb9853], dl
mov eax, fcn.00789590
imul eax, eax
and eax, 3
cmp eax, 2
mov al, 0xfe
sete cl
or cl, 4
xor cl, 7
rol al, cl
and byte [0xbb9853], al
push str.O__e
push esi
call fcn.0078de60
add esp, 8
mov edx, fcn.00780d20
xor eax, eax
imul edx, edx
and edx, 3
cmp edx, 3
sete al
mov ecx, eax
xor ecx, 1
lea eax, [eax + ecx*2 + 2]
movzx ecx, byte [0xbb9873]
bt ecx, eax
jb 0x812a61
mov al, byte [0xbb9873]
mov dword [esp], ebx
xor ecx, ecx
cmp edx, 3
mov ah, 1
sete cl
mov ebx, ecx
xor ebx, 1
lea ecx, [ecx + ebx*2 + 2]
xor cl, 7
shl ah, cl
or ah, al
lock cmpxchg byte [0xbb9873], ah
jne 0x812917
mov ecx, fcn.00780d20
xor edx, edx
movzx eax, al
imul ecx, ecx
and ecx, 3
cmp ecx, 3
sete dl
mov ebx, edx
xor ebx, 1
lea edx, [edx + ebx*2 + 2]
xor dl, 7
movzx edx, dl
bt eax, edx
jae 0x81298a
mov ebx, dword [esp]
xor eax, eax
cmp ecx, 3
sete al
mov edx, eax
xor edx, 1
lea eax, [eax + edx*2 + 2]
movzx edx, byte [0xbb9873]
bt edx, eax
jae 0x812968
jmp 0x812a61
xor eax, eax
cmp ecx, 3
movzx edx, byte [0xbb9873]
mov ebx, dword [esp]
sete al
mov ecx, eax
xor ecx, 1
lea eax, [eax + ecx*2 + 2]
bt edx, eax
jb 0x812a38
mov ecx, fcn.00780d20
xor eax, eax
imul ecx, ecx
and ecx, 3
cmp ecx, 3
sete al
mov ecx, eax
not ecx
and ecx, 0x1b1
lea ecx, [eax + ecx*2 - 0x315f1fe]
mov eax, dword [0xbb9860]
mov edx, ecx
shr edx, 0x1f
or edx, ecx
xor eax, ecx
and cl, 7
mov dword [0xbb9860], eax
not eax
imul edx, eax
mov eax, dword [0xbb9864]
lea ebx, [edx + edx]
xor eax, edx
shr edx, 0x1e
mov dword [0xbb9864], eax
or ebx, edx
not eax
mov edx, dword [0xbb9868]
imul eax, ebx
lea ebx, [eax*4]
xor edx, eax
shr eax, 0x1d
mov dword [0xbb9868], edx
or ebx, eax
not edx
mov al, 1
imul edx, ebx
mov ebx, dword [esp]
shl al, cl
xor dword [0xbb986c], edx
or byte [0xbb9873], al
mov eax, fcn.00780d20
xor ecx, ecx
imul eax, eax
and eax, 3
cmp eax, 3
sete cl
mov eax, ecx
xor eax, 1
lea ecx, [ecx + eax*2 + 2]
mov al, 0xfe
xor cl, 7
rol al, cl
and byte [0xbb9873], al
mov edx, fcn.007be6e0
movzx ecx, byte [0xbb98bf]
imul edx, edx
and edx, 3
cmp edx, 3
sete al
or al, 6
movzx eax, al
bt ecx, eax
jb 0x812b87
mov al, byte [0xbb98bf]
cmp edx, 3
mov ah, 1
sete cl
or cl, 6
xor cl, 7
shl ah, cl
or ah, al
lock cmpxchg byte [0xbb98bf], ah
jne 0x812a8c
mov ecx, fcn.007be6e0
movzx eax, al
imul ecx, ecx
and ecx, 3
cmp ecx, 3
sete dl
or dl, 6
xor dl, 7
movzx edx, dl
bt eax, edx
jae 0x812ae6
cmp ecx, 3
movzx edx, byte [0xbb98bf]
sete al
or al, 6
movzx eax, al
bt edx, eax
jae 0x812aca
jmp 0x812b87
mov dword [esp], ebx
xor edx, edx
cmp ecx, 3
sete al
movzx ebx, byte [0xbb98bf]
mov ecx, eax
or cl, 6
movzx ecx, cl
bt ebx, ecx
jb 0x812b63
mov dl, al
mov ebx, 0xbb9880
xor eax, eax
mov dword [esp + 4], ebp
mov dword [esp + 8], edi
or edx, 0xa6b87b0e
mov ebp, dword [ebx]
mov ecx, eax
mov edi, edx
inc eax
shl edi, cl
xor cl, 0x1f
xor ebp, edx
shr edx, cl
mov dword [ebx], ebp
or edx, edi
not ebp
add ebx, 4
imul edx, ebp
cmp eax, 0xf
jne 0x812b1c
mov eax, fcn.007be6e0
imul eax, eax
and eax, 3
cmp eax, 3
mov al, 1
sete cl
or cl, 6
shl al, cl
or byte [0xbb98bf], al
mov edi, dword [esp + 8]
mov ebp, dword [esp + 4]
mov eax, fcn.007be6e0
imul eax, eax
and eax, 3
cmp eax, 3
mov al, 0xfe
sete cl
or cl, 6
xor cl, 7
rol al, cl
and byte [0xbb98bf], al
mov ebx, dword [esp]
mov ecx, dword [esp + 0xc]
mov edx, 0x88
push edi
push ebp
push ebx
call fcn.007d10f0
add esp, 0xc
mov ecx, esi
call fcn.007fc3c0
mov eax, dword [esi]
shl edi, 4
mov eax, dword [eax + 0x10]
push ebp
push ebp
push ebx
push 0xbb9860
push dword [eax + edi]
push 0xbb9880
push esi
call fcn.00802190
add esp, 0x1c
mov ecx, esi
mov edx, ebp
add esp, 0x10
pop esi
pop edi
pop ebx
pop ebp
jmp fcn.007fc440