Function at 0x791430
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x2c
mov dword [esp + 8], edx
mov dword [esp + 4], ecx
mov edx, fcn.00822960
xor ecx, ecx
mov eax, dword [0xbcbae0]
and edx, 1
inc edx
xor eax, esp
mov dword [esp + 0x28], eax
mov dword [esp + 0x14], edx
mov eax, dword [esp + 0x14]
xor edx, edx
mov ebp, dword [ecx*4 + 0xb4d370]
mov esi, dword [ecx*4 + 0xb4d4b0]
mov dword [esp + 0x1c], ecx
xor eax, fcn.00822960
mov eax, 1
sete dl
xor edx, 0x49b128fb
add edx, 0xc08
xor edx, dword [ecx*4 + 0xb4bb50]
mov ecx, edx
and cl, 7
movzx ebx, cl
shl eax, cl
xor cl, 7
mov dword [esp], ebx
mov ebx, 1
shl ebx, cl
movzx ecx, byte [ebp + esi - 1]
mov edi, dword [esp]
bt ecx, edi
jb 0x79153c
mov dword [esp + 0xc], eax
mov al, byte [ebp + esi - 1]
mov ecx, eax
or cl, bl
lock cmpxchg byte [ebp + esi - 1], cl
jne 0x7914c1
mov ecx, dword [esp + 0xc]
movzx eax, al
test ebx, eax
je 0x7914e3
movzx eax, byte [ebp + esi - 1]
test ecx, eax
je 0x7914d8
jmp 0x79153c
mov dword [esp + 0x10], ebx
movzx eax, byte [ebp + esi - 1]
test ecx, eax
jne 0x791532
lea ecx, [esi - 4]
shr ecx, 2
je 0x79152a
xor eax, eax
mov ebx, ebp
mov dword [esp + 0x18], ecx
mov edi, dword [ebx]
mov ecx, eax
mov dword [esp], edx
inc eax
shl dword [esp], cl
and cl, 0x1f
xor cl, 0x1f
xor edi, edx
shr edx, cl
mov ecx, dword [esp + 0x18]
or edx, dword [esp]
mov dword [ebx], edi
not edi
add ebx, 4
imul edx, edi
cmp eax, ecx
jne 0x791500
mov eax, dword [esp + 0xc]
or byte [ebp + esi - 1], al
mov eax, dword [esp + 0x10]
not al
and byte [ebp + esi - 1], al
mov ecx, dword [esp + 0x1c]
inc ecx
cmp ecx, 0x50
jne 0x791459
mov eax, dword [0xc1f184]
cmp eax, 2
je 0x79155d
call fcn.007781a0
test eax, eax
je 0x7915a5
mov dword [esp + 0x24], 0
lea eax, [esp + 0x24]
push 0
push 0
push eax
push 0
mov esi, dword [esp + 0x14]
push esi
push 0
push 0x1300
call dword [0xbabbd4]
test eax, eax
je 0x79169a
call fcn.00791930
mov ecx, dword [esp + 0x24]
call fcn.007784c0
mov edi, eax
call fcn.00791940
push dword [esp + 0x24]
jmp 0x7915f3
mov dword [esp + 0x20], 0
lea eax, [esp + 0x20]
push 0
push 0
push eax
push 0
mov esi, dword [esp + 0x14]
push esi
push 0
push 0x1300
call dword [0xbabbc8]
test eax, eax
je 0x79169a
call fcn.00791930
call dword [0xbabb20]
mov ecx, dword [esp + 0x20]
mov edx, eax
call fcn.00778630
mov edi, eax
call fcn.00791940
push dword [esp + 0x20]
call dword [0xbabd48]
mov edx, fcn.007c7b20
xor eax, eax
movzx esi, byte [0xbace73]
imul edx, edx
and edx, 3
cmp edx, 3
sete al
mov ecx, eax
xor ecx, 3
lea eax, [ecx + eax*2]
bt esi, eax
jb 0x7918fd
mov al, byte [0xbace73]
xor ecx, ecx
cmp edx, 3
mov ah, 1
sete cl
mov ebx, ecx
xor ebx, 3
lea ecx, [ebx + ecx*2]
xor cl, 7
shl ah, cl
or ah, al
lock cmpxchg byte [0xbace73], ah
jne 0x791629
mov ecx, fcn.007c7b20
xor edx, edx
movzx eax, al
imul ecx, ecx
and ecx, 3
cmp ecx, 3
sete dl
mov ebx, edx
xor ebx, 3
lea edx, [ebx + edx*2]
xor dl, 7
movzx edx, dl
bt eax, edx
jae 0x791885
xor eax, eax
cmp ecx, 3
movzx esi, byte [0xbace73]
sete al
mov edx, eax
xor edx, 3
lea eax, [edx + eax*2]
bt esi, eax
jae 0x791679
jmp 0x7918fd
mov edx, fcn.007775c0
mov eax, fcn.007775c0
movzx edi, byte [0xbace6b]
and edx, 1
xor edx, eax
xor eax, eax
cmp edx, 0xffffffff
sete al
mov ecx, eax
xor ecx, 5
lea eax, [ecx + eax*2 + 4]
and al, 7
movzx eax, al
bt edi, eax
jb 0x791869
mov al, byte [0xbace6b]
xor ecx, ecx
cmp edx, 0xffffffff
mov ah, 1
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 [0xbace6b], ah
jne 0x7916d4
mov ecx, fcn.007775c0
mov edx, fcn.007775c0
movzx eax, al
and ecx, 1
xor ecx, edx
xor edx, edx
cmp ecx, 0xffffffff
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 0x791753
xor eax, eax
cmp ecx, 0xffffffff
movzx edi, byte [0xbace6b]
sete al
mov edx, eax
xor edx, 5
lea eax, [edx + eax*2 + 4]
and al, 7
movzx eax, al
bt edi, eax
jae 0x79172c
jmp 0x791869
xor eax, eax
cmp ecx, 0xffffffff
movzx edx, byte [0xbace6b]
sete al
mov ecx, eax
xor ecx, 5
lea eax, [ecx + eax*2 + 4]
and al, 7
movzx eax, al
bt edx, eax
jb 0x791839
mov ecx, fcn.007775c0
mov eax, fcn.007775c0
and ecx, 1
xor ecx, eax
xor eax, eax
cmp ecx, 0xffffffff
sete al
mov ecx, eax
xor ecx, 0x5ba4e05
lea ecx, [ecx + eax*2 + 0x254]
mov eax, dword [0xbace50]
xor eax, ecx
mov dword [0xbace50], eax
not eax
mov edx, dword [0xbace54]
imul eax, ecx
and cl, 7
lea esi, [eax + eax]
xor edx, eax
shr eax, 0x1e
mov dword [0xbace54], edx
or esi, eax
not edx
mov eax, dword [0xbace58]
imul edx, esi
lea esi, [edx*4]
xor eax, edx
shr edx, 0x1d
mov dword [0xbace58], eax
or esi, edx
not eax
mov edx, dword [0xbace5c]
imul eax, esi
lea esi, [eax*8]
xor edx, eax
shr eax, 0x1c
mov dword [0xbace5c], edx
or esi, eax
not edx
mov eax, dword [0xbace60]
imul edx, esi
mov esi, edx
shl esi, 4
xor eax, edx
shr edx, 0x1b
mov dword [0xbace60], eax
or edx, esi
not eax
mov esi, dword [esp + 4]
imul eax, edx
mov dl, 1
xor dword [0xbace64], eax
shl dl, cl
or byte [0xbace6b], dl
mov ecx, fcn.007775c0
mov eax, fcn.007775c0
and ecx, 1
xor ecx, eax
xor eax, eax
cmp ecx, 0xffffffff
sete al
mov ecx, eax
xor ecx, 5
lea ecx, [ecx + eax*2 + 4]
mov al, 0xfe
and cl, 7
xor cl, 7
rol al, cl
and byte [0xbace6b], al
push esi
push esi
push 0xbace50
push dword [esp + 0x4c]
push dword [esp + 0x18]
call fcn.00777b20
add esp, 0x14
jmp 0x79191c
xor eax, eax
cmp ecx, 3
movzx edx, byte [0xbace73]
sete al
mov ecx, eax
xor ecx, 3
lea eax, [ecx + eax*2]
bt edx, eax
jb 0x7918d5
mov eax, fcn.007c7b20
xor ecx, ecx
imul eax, eax
and eax, 3
cmp eax, 3
sete cl
mov eax, ecx
xor eax, 0xc2552423
lea ecx, [eax + ecx*2 + 0x730]
mov al, 1
xor dword [0xbace6c], ecx
and cl, 7
shl al, cl
or byte [0xbace73], al
mov eax, fcn.007c7b20
xor ecx, ecx
imul eax, eax
and eax, 3
cmp eax, 3
sete cl
mov eax, ecx
xor eax, 3
lea ecx, [eax + ecx*2]
mov al, 0xfe
xor cl, 7
rol al, cl
and byte [0xbace73], al
push edi
push 0xbace6c
push dword [esp + 0x48]
push dword [esp + 0x14]
call fcn.00777b20
add esp, 0x10
push edi
call fcn.00775660
add esp, 4
mov ecx, dword [esp + 0x28]
xor ecx, esp
call fcn.00980459
add esp, 0x2c
pop esi
pop edi
pop ebx
pop ebp
ret