Function at 0x829020
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x28
test edx, edx
mov dword [esp + 0xc], ecx
je 0x82936d
mov ecx, dword [esp + 0x40]
mov edi, 0x832da0
mov esi, edx
and edi, 1
inc edi
mov dword [esp + 8], edi
cmp dword [esi + 0x10], 0
je 0x829362
mov edx, dword [esi + 4]
test ecx, ecx
jne 0x829064
mov eax, edx
and eax, 0x40000
jne 0x829362
mov eax, edi
mov dword [esp + 0x14], edx
xor eax, 0x832da0
movzx ecx, byte [0xbb34bb]
sete al
or al, 4
movzx eax, al
bt ecx, eax
jb 0x829146
mov al, byte [0xbb34bb]
mov ecx, edi
mov dl, 1
xor ecx, 0x832da0
sete cl
or cl, 4
xor cl, 7
shl dl, cl
or dl, al
lock cmpxchg byte [0xbb34bb], dl
jne 0x82908c
mov ecx, edi
movzx eax, al
xor ecx, 0x832da0
sete cl
or cl, 4
xor cl, 7
movzx ecx, cl
bt eax, ecx
jae 0x8290e6
mov eax, edi
movzx ecx, byte [0xbb34bb]
xor eax, 0x832da0
sete al
or al, 4
movzx eax, al
bt ecx, eax
jae 0x8290c9
jmp 0x829146
mov eax, edi
movzx ecx, byte [0xbb34bb]
xor eax, 0x832da0
sete al
or al, 4
movzx eax, al
bt ecx, eax
jb 0x82912c
mov eax, edi
xor ecx, ecx
xor eax, 0x832da0
mov al, 1
sete cl
or ecx, 0x5007a40c
add ecx, 0x520
xor dword [0xbb34b4], ecx
and cl, 7
shl al, cl
or byte [0xbb34bb], al
mov eax, edi
xor eax, 0x832da0
mov al, 0xfe
sete cl
or cl, 4
xor cl, 7
rol al, cl
and byte [0xbb34bb], al
mov edx, fcn.007a4c30
movzx ecx, byte [0xbb34c3]
xor eax, eax
imul edx, edx
and edx, 3
cmp edx, 1
seta al
bt ecx, eax
jb 0x8291f7
mov al, byte [0xbb34c3]
cmp edx, 1
mov ah, 1
seta cl
xor cl, 7
shl ah, cl
or ah, al
lock cmpxchg byte [0xbb34c3], ah
jne 0x82916e
cmp edx, 1
movzx eax, al
seta cl
xor cl, 7
movzx ecx, cl
bt eax, ecx
jae 0x8291b1
movzx ecx, byte [0xbb34c3]
xor eax, eax
cmp edx, 1
seta al
bt ecx, eax
jae 0x82919b
jmp 0x8291f7
movzx ecx, byte [0xbb34c3]
xor eax, eax
cmp edx, 1
seta al
bt ecx, eax
jb 0x8291e4
xor ecx, ecx
cmp edx, 1
seta cl
mov eax, ecx
or eax, 0xb585fb58
xor dword [0xbb34bc], eax
mov ah, 1
shl ah, cl
or byte [0xbb34c3], ah
cmp edx, 1
mov al, 0xfe
seta cl
xor cl, 7
rol al, cl
and byte [0xbb34c3], al
cmp dword [esi + 0x18], 0
mov ecx, 0xbb34ac
jne 0x829213
cmp dword [esi + 0x14], 0
mov ecx, 0xbb34b4
mov eax, 0xbb34bc
cmove ecx, eax
xor edx, edx
mov dword [esp + 0x10], ecx
mov dword [esp + 0x18], esi
mov eax, fcn.007b1b20
mov ecx, fcn.007b1b20
mov esi, dword [edx*4 + 0xb4f030]
mov ebp, dword [edx*4 + 0xb4f050]
mov dword [esp + 0x24], edx
and eax, 1
xor eax, ecx
xor ecx, ecx
cmp eax, 0xffffffff
sete cl
mov eax, ecx
xor eax, 0xef08cb83
lea ebx, [eax + ecx*2 + 0x848]
mov eax, 1
xor ebx, dword [edx*4 + 0xb4f070]
mov ecx, ebx
and cl, 7
movzx edx, cl
shl eax, cl
xor cl, 7
mov dword [esp], edx
mov edx, 1
shl edx, cl
movzx ecx, byte [esi + ebp - 1]
mov edi, dword [esp]
bt ecx, edi
jb 0x82930b
mov dword [esp + 4], eax
mov al, byte [esi + ebp - 1]
mov ecx, eax
or cl, dl
lock cmpxchg byte [esi + ebp - 1], cl
jne 0x829290
mov ecx, dword [esp + 4]
movzx eax, al
test edx, eax
je 0x8292b2
movzx eax, byte [esi + ebp - 1]
test ecx, eax
je 0x8292a7
jmp 0x82930b
mov dword [esp + 0x1c], edx
movzx eax, byte [esi + ebp - 1]
test ecx, eax
jne 0x829301
lea ecx, [ebp - 4]
shr ecx, 2
je 0x8292f9
xor eax, eax
mov edx, esi
mov dword [esp + 0x20], ecx
mov edi, dword [edx]
mov ecx, eax
mov dword [esp], ebx
inc eax
shl dword [esp], cl
and cl, 0x1f
xor cl, 0x1f
xor edi, ebx
shr ebx, cl
mov ecx, dword [esp + 0x20]
or ebx, dword [esp]
mov dword [edx], edi
not edi
add edx, 4
imul ebx, edi
cmp eax, ecx
jne 0x8292cf
mov eax, dword [esp + 4]
or byte [esi + ebp - 1], al
mov eax, dword [esp + 0x1c]
not al
and byte [esi + ebp - 1], al
mov edx, dword [esp + 0x24]
inc edx
cmp edx, 5
jne 0x82921d
mov esi, dword [esp + 0x18]
mov edx, dword [esp + 0x14]
movsx ecx, byte [esi]
mov eax, edx
and edx, 3
and eax, 0x3c0800
xor eax, 0x200000
push eax
push ecx
push dword [edx*4 + 0xb48130]
push dword [esp + 0x1c]
push dword [esp + 0x4c]
push dword [esi + 0x20]
push 0xbb34c4
push 1
push dword [esp + 0x2c]
call fcn.00828f60
add esp, 0x24
mov ecx, dword [esp + 0x40]
mov edi, dword [esp + 8]
mov esi, dword [esi + 0xc]
test esi, esi
jne 0x829046
add esp, 0x28
pop esi
pop edi
pop ebx
pop ebp
ret