Function at 0x810820
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x30
mov dword [esp + 4], edx
mov esi, dword [esp + 0x44]
mov eax, dword [0xbd33e0]
xor eax, esp
mov dword [esp + 0x2c], eax
mov dword [esp], ecx
mov edx, dword [ecx]
mov edi, dword [esi + 0xc]
lea ecx, [esp + 0x14]
push dword [edx + 0x6c]
push 0
push 0
call fcn.007832c0
add esp, 0xc
cmp dword [esi + 0x28], 0
jne 0x81093d
cmp word [esi + 0x32], 0
je 0x810c49
mov ebp, fcn.007d3840
mov ebx, fcn.0079e6f0
xor edx, edx
mov dword [esp + 8], edi
imul ebp, ebp
and ebx, 1
and ebp, 3
inc ebx
mov ecx, dword [esi + 4]
mov eax, dword [edi + 4]
test edx, edx
mov dword [esp + 0x10], edx
movsx ecx, word [ecx + edx*2]
lea ecx, [ecx + ecx*4]
mov eax, dword [eax + ecx*4]
mov dword [esp + 0xc], eax
je 0x810b47
mov eax, ebx
movzx ecx, byte [0xbb9427]
xor eax, fcn.0079e6f0
sete al
xor al, 5
add al, 4
and al, 7
movzx eax, al
bt ecx, eax
jb 0x810b33
mov al, byte [0xbb9427]
mov ecx, ebx
mov dl, 1
xor ecx, fcn.0079e6f0
sete cl
xor cl, 5
add cl, 4
and cl, 7
xor cl, 7
shl dl, cl
or dl, al
lock cmpxchg byte [0xbb9427], dl
jne 0x8108cc
mov ecx, ebx
movzx eax, al
xor ecx, fcn.0079e6f0
sete cl
xor cl, 5
add cl, 4
and cl, 7
xor cl, 7
movzx ecx, cl
bt eax, ecx
jae 0x810acc
mov eax, ebx
movzx ecx, byte [0xbb9427]
xor eax, fcn.0079e6f0
sete al
xor al, 5
add al, 4
and al, 7
movzx eax, al
bt ecx, eax
jae 0x810919
jmp 0x810b33
mov edx, fcn.00829b50
xor eax, eax
movzx edi, byte [0xbb941f]
not edx
and edx, 1
mov ecx, edx
add ecx, fcn.00829b50
sete al
mov ecx, eax
not ecx
lea eax, [eax + ecx*2]
and al, 3
movzx eax, al
bt edi, eax
jb 0x810ab3
mov al, byte [0xbb941f]
mov edi, esi
mov esi, edx
xor ecx, ecx
mov ah, 1
add esi, fcn.00829b50
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 [0xbb941f], ah
jne 0x810977
mov ecx, fcn.00829b50
xor edx, edx
movzx eax, al
not ecx
and ecx, 1
mov esi, ecx
add esi, fcn.00829b50
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 0x8109fc
mov esi, edi
mov edx, ecx
xor eax, eax
movzx edi, byte [0xbb941f]
add edx, fcn.00829b50
sete al
mov edx, eax
not edx
lea eax, [eax + edx*2]
and al, 3
movzx eax, al
bt edi, eax
jae 0x8109d2
jmp 0x810ab3
xor eax, eax
add ecx, fcn.00829b50
movzx edx, byte [0xbb941f]
mov esi, edi
sete al
mov ecx, eax
not ecx
lea eax, [eax + ecx*2]
and al, 3
movzx eax, al
bt edx, eax
jb 0x810a88
mov ecx, fcn.00829b50
xor eax, eax
not ecx
and ecx, 1
add ecx, fcn.00829b50
sete al
mov ecx, eax
not ecx
and ecx, 0x8a5
lea ecx, [eax + ecx*2 + 0x3b555340]
mov eax, dword [0xbb9410]
xor eax, ecx
mov dword [0xbb9410], eax
not eax
mov edx, dword [0xbb9414]
imul eax, ecx
and cl, 7
lea esi, [eax + eax]
xor edx, eax
shr eax, 0x1e
mov dword [0xbb9414], edx
or eax, esi
not edx
mov esi, edi
imul edx, eax
xor dword [0xbb9418], edx
mov dl, 1
shl dl, cl
or byte [0xbb941f], dl
mov eax, fcn.00829b50
xor ecx, ecx
not eax
and eax, 1
add eax, fcn.00829b50
sete cl
mov eax, ecx
not eax
lea ecx, [ecx + eax*2]
mov al, 0xfe
and cl, 3
xor cl, 7
rol al, cl
and byte [0xbb941f], al
push dword [esi]
push 0xbb9410
lea eax, [esp + 0x1c]
push eax
call fcn.00783530
add esp, 0xc
jmp 0x810c49
mov eax, ebx
movzx ecx, byte [0xbb9427]
xor eax, fcn.0079e6f0
sete al
xor al, 5
add al, 4
and al, 7
movzx eax, al
bt ecx, eax
jb 0x810b13
mov eax, ebx
xor ecx, ecx
xor eax, fcn.0079e6f0
mov al, 1
sete cl
xor ecx, 0x242b1eed
add ecx, 4
xor dword [0xbb9420], ecx
and cl, 7
shl al, cl
or byte [0xbb9427], al
mov eax, ebx
xor eax, fcn.0079e6f0
mov al, 0xfe
sete cl
xor cl, 5
add cl, 4
and cl, 7
xor cl, 7
rol al, cl
and byte [0xbb9427], al
push 2
push 0xbb9420
lea eax, [esp + 0x1c]
push eax
call fcn.00782dd0
add esp, 0xc
cmp ebp, 1
movzx ecx, byte [0xbb942f]
seta al
or al, 4
movzx eax, al
bt ecx, eax
jb 0x810c04
mov al, byte [0xbb942f]
cmp ebp, 1
mov dl, 1
seta cl
or cl, 4
xor cl, 7
shl dl, cl
or dl, al
lock cmpxchg byte [0xbb942f], dl
jne 0x810b67
cmp ebp, 1
movzx eax, al
seta cl
or cl, 4
xor cl, 7
movzx ecx, cl
bt eax, ecx
jae 0x810bb3
cmp ebp, 1
movzx ecx, byte [0xbb942f]
seta al
or al, 4
movzx eax, al
bt ecx, eax
jae 0x810b9a
jmp 0x810c04
cmp ebp, 1
movzx ecx, byte [0xbb942f]
seta al
or al, 4
movzx eax, al
bt ecx, eax
jb 0x810bee
xor ecx, ecx
cmp ebp, 1
mov al, 1
seta cl
or ecx, 0x4eec4b58
add ecx, 0x44
xor dword [0xbb9428], ecx
and cl, 7
shl al, cl
or byte [0xbb942f], al
cmp ebp, 1
mov al, 0xfe
seta cl
or cl, 4
xor cl, 7
rol al, cl
and byte [0xbb942f], al
mov edi, dword [esp + 8]
push dword [edi]
lea esi, [esp + 0x18]
push esi
call fcn.00783000
add esp, 8
push 1
push 0xbb9428
push esi
call fcn.00782dd0
add esp, 0xc
push dword [esp + 0xc]
push esi
call fcn.00783000
add esp, 8
mov esi, dword [esp + 0x44]
mov edx, dword [esp + 0x10]
movzx eax, word [esi + 0x32]
inc edx
cmp edx, eax
jb 0x810884
lea ecx, [esp + 0x14]
call fcn.007831c0
mov ecx, dword [esi + 0x38]
xor edx, edx
and ecx, 3
cmp ecx, 2
mov ecx, dword [esp]
setne dl
shl edx, 9
add edx, 0x613
push 2
push 0xfffffffffffffff9
push eax
push dword [esp + 0x10]
call fcn.007fc3d0
add esp, 0x10
mov ecx, dword [esp + 0x2c]
xor ecx, esp
call fcn.00989fe9
add esp, 0x30
pop esi
pop edi
pop ebx
pop ebp
ret