Function at 0x808360
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
push eax
mov ebp, dword [ecx]
xor ebx, ebx
cmp byte [ebp + 0xa5], 0
jne 0x808889
mov esi, ecx
mov ecx, dword [esp + 0x1c]
mov eax, dword [ebp + 0x10]
mov edi, edx
shl ecx, 4
mov eax, dword [eax + ecx]
push dword [esi + 0xf0]
mov dword [esp + 4], eax
push eax
push dword [esp + 0x20]
push edx
push 0x14
push dword [ebp + 0x154]
call dword [ebp + 0x150]
add esp, 0x18
cmp eax, 1
jne 0x808878
mov edx, fcn.00782e10
movzx ecx, byte [0xbb86b7]
imul edx, edx
and edx, 3
cmp edx, 1
seta al
xor al, 5
add al, 0x94
and al, 7
movzx eax, al
bt ecx, eax
jb 0x8084d6
mov al, byte [0xbb86b7]
cmp edx, 1
mov ah, 1
seta cl
xor cl, 5
add cl, 0x94
and cl, 7
xor cl, 7
shl ah, cl
or ah, al
lock cmpxchg byte [0xbb86b7], ah
jne 0x8083e0
mov ecx, fcn.00782e10
movzx eax, al
imul ecx, ecx
and ecx, 3
cmp ecx, 1
seta dl
xor dl, 5
add dl, 0x94
and dl, 7
xor dl, 7
movzx edx, dl
bt eax, edx
jae 0x80844a
cmp ecx, 1
movzx edx, byte [0xbb86b7]
seta al
xor al, 5
add al, 0x94
and al, 7
movzx eax, al
bt edx, eax
jae 0x80842a
jmp 0x8084d6
cmp ecx, 1
movzx ecx, byte [0xbb86b7]
seta al
xor al, 5
add al, 0x94
and al, 7
movzx eax, al
bt ecx, eax
jb 0x8084af
mov eax, fcn.00782e10
xor ecx, ecx
imul eax, eax
and eax, 3
cmp eax, 1
mov eax, dword [0xbb86ac]
seta cl
xor ecx, 0x744b0f15
add ecx, 0x94
mov edx, ecx
xor eax, ecx
shr edx, 0x1f
mov dword [0xbb86ac], eax
not eax
or edx, ecx
and cl, 7
imul edx, eax
xor dword [0xbb86b0], edx
mov dl, 1
shl dl, cl
or byte [0xbb86b7], dl
mov eax, fcn.00782e10
imul eax, eax
and eax, 3
cmp eax, 1
mov al, 0xfe
seta cl
xor cl, 5
add cl, 0x94
and cl, 7
xor cl, 7
rol al, cl
and byte [0xbb86b7], al
push dword [esp + 0x18]
push edi
push 0xbb86ac
call fcn.00783360
add esp, 0xc
cmp dword [esp + 0x1c], 0
mov ebx, eax
jne 0x8084fb
cmp dword [ebp + 0x14], 3
jl 0x80866e
mov eax, fcn.007f7790
mov edi, 3
movzx edx, byte [0xbb86c3]
sub edi, eax
xor eax, eax
mov ecx, edi
xor ecx, fcn.007f7790
sete al
mov ecx, eax
xor ecx, 1
lea eax, [eax + ecx*2 + 2]
bt edx, eax
jb 0x80865a
mov al, byte [0xbb86c3]
mov ebp, ebx
mov ebx, edi
xor ecx, ecx
mov ah, 1
xor ebx, fcn.007f7790
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 [0xbb86c3], ah
jne 0x808534
mov edi, fcn.007f7790
mov ecx, 3
xor edx, edx
movzx eax, al
sub ecx, edi
mov edi, ecx
xor edi, fcn.007f7790
sete dl
mov ebx, edx
xor ebx, 1
lea edx, [edx + ebx*2 + 2]
xor dl, 7
movzx edx, dl
bt eax, edx
jae 0x8085b6
mov ebx, ebp
mov edx, ecx
xor eax, eax
movzx edi, byte [0xbb86c3]
xor edx, fcn.007f7790
sete al
mov edx, eax
xor edx, 1
lea eax, [eax + edx*2 + 2]
bt edi, eax
jae 0x80858f
jmp 0x80865a
xor eax, eax
xor ecx, fcn.007f7790
movzx edx, byte [0xbb86c3]
mov ebx, ebp
sete al
mov ecx, eax
xor ecx, 1
lea eax, [eax + ecx*2 + 2]
bt edx, eax
jb 0x80862d
mov eax, fcn.007f7790
mov ecx, 3
mov edi, dword [0xbb86b8]
sub ecx, eax
xor eax, eax
xor ecx, fcn.007f7790
sete al
mov ecx, eax
not ecx
and ecx, 0x925
lea ecx, [eax + ecx*2 - 0x31a7bee]
mov edx, ecx
xor edi, ecx
shr edx, 0x1f
mov dword [0xbb86b8], edi
not edi
or edx, ecx
and cl, 7
imul edx, edi
xor dword [0xbb86bc], edx
mov dl, 1
shl dl, cl
or byte [0xbb86c3], dl
mov eax, fcn.007f7790
mov ecx, 3
sub ecx, eax
xor eax, eax
xor ecx, fcn.007f7790
sete al
mov ecx, eax
xor ecx, 1
lea ecx, [eax + ecx*2 + 2]
mov al, 0xfe
xor cl, 7
rol al, cl
and byte [0xbb86c3], al
push ebx
push dword [esp + 4]
push 0xbb86b8
call fcn.00783360
add esp, 0xc
mov ebx, eax
mov eax, fcn.0082f910
mov edi, 3
movzx edx, byte [0xbb86ef]
sub edi, eax
xor eax, eax
mov ecx, edi
xor ecx, fcn.0082f910
sete al
mov ecx, eax
xor ecx, 1
lea eax, [eax + ecx*2 + 2]
bt edx, eax
jb 0x80885b
mov al, byte [0xbb86ef]
mov ebp, ebx
mov edx, edi
xor ecx, ecx
xor edx, fcn.0082f910
sete cl
mov edx, ecx
xor edx, 1
lea ecx, [ecx + edx*2 + 2]
mov dl, 1
xor cl, 7
shl dl, cl
or dl, al
lock cmpxchg byte [0xbb86ef], dl
jne 0x8086a7
mov edx, fcn.0082f910
mov ecx, 3
movzx eax, al
sub ecx, edx
xor edx, edx
mov edi, ecx
xor edi, fcn.0082f910
sete dl
mov ebx, edx
xor ebx, 1
lea edx, [edx + ebx*2 + 2]
xor dl, 7
movzx edx, dl
bt eax, edx
jae 0x808729
mov ebx, ebp
mov edx, ecx
xor eax, eax
movzx edi, byte [0xbb86ef]
xor edx, fcn.0082f910
sete al
mov edx, eax
xor edx, 1
lea eax, [eax + edx*2 + 2]
bt edi, eax
jae 0x808702
jmp 0x80885b
xor eax, eax
xor ecx, fcn.0082f910
movzx edx, byte [0xbb86ef]
mov ebx, ebp
sete al
mov ecx, eax
xor ecx, 1
lea eax, [eax + ecx*2 + 2]
bt edx, eax
jb 0x80882e
mov eax, fcn.0082f910
mov ecx, 3
sub ecx, eax
xor eax, eax
xor ecx, fcn.0082f910
sete al
mov ecx, eax
not ecx
and ecx, 5
lea ecx, [eax + ecx*2 - 0x51b41166]
mov eax, dword [0xbb86d0]
mov edx, ecx
shr edx, 0x1f
or edx, ecx
xor eax, ecx
and cl, 7
mov dword [0xbb86d0], eax
not eax
imul edx, eax
mov eax, dword [0xbb86d4]
lea edi, [edx + edx]
xor eax, edx
shr edx, 0x1e
mov dword [0xbb86d4], eax
or edi, edx
not eax
mov edx, dword [0xbb86d8]
imul eax, edi
lea edi, [eax*4]
xor edx, eax
shr eax, 0x1d
mov dword [0xbb86d8], edx
or edi, eax
not edx
mov eax, dword [0xbb86dc]
imul edx, edi
lea edi, [edx*8]
xor eax, edx
shr edx, 0x1c
mov dword [0xbb86dc], eax
or edi, edx
not eax
mov edx, dword [0xbb86e0]
imul eax, edi
mov edi, eax
shl edi, 4
xor edx, eax
shr eax, 0x1b
mov dword [0xbb86e0], edx
or eax, edi
not edx
mov ebp, dword [0xbb86e4]
imul edx, eax
mov edi, edx
shl edi, 5
xor ebp, edx
shr edx, 0x1a
mov dword [0xbb86e4], ebp
or edx, edi
not ebp
imul ebp, edx
mov dl, 1
xor dword [0xbb86e8], ebp
shl dl, cl
or byte [0xbb86ef], dl
mov eax, fcn.0082f910
mov ecx, 3
sub ecx, eax
xor eax, eax
xor ecx, fcn.0082f910
sete al
mov ecx, eax
xor ecx, 1
lea ecx, [eax + ecx*2 + 2]
mov al, 0xfe
xor cl, 7
rol al, cl
and byte [0xbb86ef], al
push ebx
push 0xbb86d0
push esi
call fcn.0078de60
add esp, 0xc
mov dword [esi + 0xc], 0x17
mov ebx, 1
jmp 0x808889
mov ebx, eax
or eax, 2
cmp eax, 2
je 0x808889
mov ecx, esi
call fcn.00800500
mov eax, ebx
add esp, 4
pop esi
pop edi
pop ebx
pop ebp
ret