Function at 0x797640
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x10
mov eax, dword [ecx + 0x14]
mov dword [esp + 4], ecx
mov ecx, fcn.00807de0
mov edi, 3
mov dword [esp], edx
sub edi, ecx
mov dword [esp + 0xc], edi
mov dword [esp + 8], eax
mov ecx, edi
xor eax, eax
movzx edx, byte [0xbbe057]
xor ecx, fcn.00807de0
sete al
mov ecx, eax
xor ecx, 1
lea eax, [eax + ecx*2 + 6]
and al, 7
movzx eax, al
bt edx, eax
jb 0x797803
mov al, byte [0xbbe057]
mov edx, edi
xor ecx, ecx
xor edx, fcn.00807de0
sete cl
mov edx, ecx
xor edx, 1
lea ecx, [ecx + edx*2 + 6]
mov dl, 1
and cl, 7
xor cl, 7
shl dl, cl
or dl, al
lock cmpxchg byte [0xbbe057], dl
jne 0x797695
mov edx, edi
xor ecx, ecx
movzx eax, al
xor edx, fcn.00807de0
sete cl
mov edx, ecx
xor edx, 1
lea ecx, [ecx + edx*2 + 6]
and cl, 7
xor cl, 7
movzx ecx, cl
bt eax, ecx
jae 0x797714
mov ecx, edi
xor eax, eax
movzx edx, byte [0xbbe057]
xor ecx, fcn.00807de0
sete al
mov ecx, eax
xor ecx, 1
lea eax, [eax + ecx*2 + 6]
and al, 7
movzx eax, al
bt edx, eax
jae 0x7976e8
jmp 0x797803
mov ecx, edi
xor eax, eax
movzx edx, byte [0xbbe057]
xor ecx, fcn.00807de0
sete al
mov ecx, eax
xor ecx, 1
lea eax, [eax + ecx*2 + 6]
and al, 7
movzx eax, al
bt edx, eax
jb 0x7977dd
mov ecx, edi
xor eax, eax
xor ecx, fcn.00807de0
sete al
mov ecx, eax
not ecx
and ecx, 0x491
lea ecx, [eax + ecx*2 - 0x36bfd492]
mov eax, dword [0xbbe040]
mov edx, ecx
shr edx, 0x1f
or edx, ecx
xor eax, ecx
and cl, 7
mov dword [0xbbe040], eax
not eax
imul edx, eax
mov eax, dword [str.8HL]
lea esi, [edx + edx]
xor eax, edx
shr edx, 0x1e
mov dword [str.8HL], eax
or esi, edx
not eax
mov edx, dword [0xbbe048]
imul eax, esi
lea esi, [eax*4]
xor edx, eax
shr eax, 0x1d
mov dword [0xbbe048], edx
or esi, eax
not edx
mov eax, dword [0xbbe04c]
imul edx, esi
lea esi, [edx*8]
xor eax, edx
shr edx, 0x1c
mov dword [0xbbe04c], eax
or esi, edx
not eax
mov dl, 1
imul eax, esi
shl dl, cl
xor dword [0xbbe050], eax
or byte [0xbbe057], dl
mov ecx, edi
xor eax, eax
xor ecx, fcn.00807de0
sete al
mov ecx, eax
xor ecx, 1
lea ecx, [eax + ecx*2 + 6]
mov al, 0xfe
and cl, 7
xor cl, 7
rol al, cl
and byte [0xbbe057], al
mov edi, dword [esp + 8]
xor esi, esi
test edi, edi
jle 0x797861
mov eax, dword [esp + 4]
xor ebx, ebx
cmp esi, 2
setb bl
xor ebx, esi
cmp dword [esp + 0x24], 0
mov ebp, dword [eax + 0x10]
je 0x79783b
mov eax, ebx
mov ecx, dword [esp + 0x24]
shl eax, 4
mov edx, dword [ebp + eax]
call fcn.00783720
test eax, eax
jne 0x79785c
shl ebx, 4
mov edx, dword [esp]
mov ecx, dword [ebp + ebx + 0xc]
add ecx, 8
call fcn.007cb020
test eax, eax
jne 0x7979cb
mov eax, dword [esp + 4]
mov edi, dword [eax + 0x14]
inc esi
cmp esi, edi
jl 0x79780d
mov ebp, 0x79c4e0
mov edx, 0x79c4e0
mov dword [esp + 8], edi
or ebp, 2
xor edx, 2
movzx ecx, byte [0xbbe033]
mov eax, ebp
add eax, edx
sete al
or al, 4
movzx eax, al
bt ecx, eax
jb 0x79798d
mov al, byte [0xbbe033]
mov ecx, ebp
mov ah, 1
add ecx, edx
sete cl
or cl, 4
xor cl, 7
shl ah, cl
or ah, al
lock cmpxchg byte [0xbbe033], ah
jne 0x797896
mov ecx, ebp
movzx eax, al
add ecx, edx
sete cl
or cl, 4
xor cl, 7
movzx ecx, cl
bt eax, ecx
jae 0x7978e8
mov eax, ebp
movzx ecx, byte [0xbbe033]
add eax, edx
sete al
or al, 4
movzx eax, al
bt ecx, eax
jae 0x7978cb
jmp 0x79798d
mov eax, ebp
movzx ecx, byte [0xbbe033]
add eax, edx
sete al
or al, 4
movzx eax, al
bt ecx, eax
jb 0x797978
mov eax, ebp
xor ecx, ecx
add eax, edx
mov eax, dword [0xbbe020]
sete cl
or ecx, 0xc966b2a8
add ecx, 0x824
mov ebx, ecx
xor eax, ecx
shr ebx, 0x1f
mov dword [0xbbe020], eax
not eax
or ebx, ecx
and cl, 7
imul ebx, eax
mov eax, dword [0xbbe024]
lea edi, [ebx + ebx]
xor eax, ebx
shr ebx, 0x1e
mov dword [0xbbe024], eax
or edi, ebx
not eax
mov esi, dword [0xbbe028]
imul eax, edi
lea ebx, [eax*4]
xor esi, eax
shr eax, 0x1d
mov dword [0xbbe028], esi
or ebx, eax
not esi
mov al, 1
imul esi, ebx
shl al, cl
xor dword [0xbbe02c], esi
or byte [0xbbe033], al
add ebp, edx
mov al, 0xfe
sete cl
or cl, 4
xor cl, 7
rol al, cl
and byte [0xbbe033], al
mov ecx, dword [esp]
mov edx, 0xbbe020
call fcn.00783720
mov edi, dword [esp + 0xc]
xor ebp, ebp
test eax, eax
jne 0x7979cd
mov eax, dword [esp + 4]
mov eax, dword [eax + 0x10]
push dword [eax + 0x10]
push dword [esp + 0x28]
call fcn.00783700
add esp, 8
test eax, eax
mov dword [esp], 0xbbe040
je 0x797665
jmp 0x7979cd
mov ebp, eax
mov eax, ebp
add esp, 0x10
pop esi
pop edi
pop ebx
pop ebp
ret