Function at 0x834880
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 0x834bcd
mov ecx, dword [esp + 0x40]
mov edi, 0x83e600
mov esi, edx
and edi, 1
inc edi
mov dword [esp + 8], edi
cmp dword [esi + 0x10], 0
je 0x834bc2
mov edx, dword [esi + 4]
test ecx, ecx
jne 0x8348c4
mov eax, edx
and eax, 0x40000
jne 0x834bc2
mov eax, edi
mov dword [esp + 0x14], edx
xor eax, 0x83e600
movzx ecx, byte [0xbbae1b]
sete al
or al, 4
movzx eax, al
bt ecx, eax
jb 0x8349a6
mov al, byte [0xbbae1b]
mov ecx, edi
mov dl, 1
xor ecx, 0x83e600
sete cl
or cl, 4
xor cl, 7
shl dl, cl
or dl, al
lock cmpxchg byte [0xbbae1b], dl
jne 0x8348ec
mov ecx, edi
movzx eax, al
xor ecx, 0x83e600
sete cl
or cl, 4
xor cl, 7
movzx ecx, cl
bt eax, ecx
jae 0x834946
mov eax, edi
movzx ecx, byte [0xbbae1b]
xor eax, 0x83e600
sete al
or al, 4
movzx eax, al
bt ecx, eax
jae 0x834929
jmp 0x8349a6
mov eax, edi
movzx ecx, byte [0xbbae1b]
xor eax, 0x83e600
sete al
or al, 4
movzx eax, al
bt ecx, eax
jb 0x83498c
mov eax, edi
xor ecx, ecx
xor eax, 0x83e600
mov al, 1
sete cl
or ecx, 0x5007a40c
add ecx, 0x520
xor dword [0xbbae14], ecx
and cl, 7
shl al, cl
or byte [0xbbae1b], al
mov eax, edi
xor eax, 0x83e600
mov al, 0xfe
sete cl
or cl, 4
xor cl, 7
rol al, cl
and byte [0xbbae1b], al
mov edx, fcn.007b0530
movzx ecx, byte [0xbbae23]
xor eax, eax
imul edx, edx
and edx, 3
cmp edx, 1
seta al
bt ecx, eax
jb 0x834a57
mov al, byte [0xbbae23]
cmp edx, 1
mov ah, 1
seta cl
xor cl, 7
shl ah, cl
or ah, al
lock cmpxchg byte [0xbbae23], ah
jne 0x8349ce
cmp edx, 1
movzx eax, al
seta cl
xor cl, 7
movzx ecx, cl
bt eax, ecx
jae 0x834a11
movzx ecx, byte [0xbbae23]
xor eax, eax
cmp edx, 1
seta al
bt ecx, eax
jae 0x8349fb
jmp 0x834a57
movzx ecx, byte [0xbbae23]
xor eax, eax
cmp edx, 1
seta al
bt ecx, eax
jb 0x834a44
xor ecx, ecx
cmp edx, 1
seta cl
mov eax, ecx
or eax, 0xb585fb58
xor dword [0xbbae1c], eax
mov ah, 1
shl ah, cl
or byte [0xbbae23], ah
cmp edx, 1
mov al, 0xfe
seta cl
xor cl, 7
rol al, cl
and byte [0xbbae23], al
cmp dword [esi + 0x18], 0
mov ecx, 0xbbae0c
jne 0x834a73
cmp dword [esi + 0x14], 0
mov ecx, 0xbbae14
mov eax, 0xbbae1c
cmove ecx, eax
xor edx, edx
mov dword [esp + 0x10], ecx
mov dword [esp + 0x18], esi
mov eax, fcn.007bd430
mov ecx, fcn.007bd430
mov esi, dword [edx*4 + 0xb57690]
mov ebp, dword [edx*4 + 0xb576b0]
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 + 0xb576d0]
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 0x834b6b
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 0x834af0
mov ecx, dword [esp + 4]
movzx eax, al
test edx, eax
je 0x834b12
movzx eax, byte [esi + ebp - 1]
test ecx, eax
je 0x834b07
jmp 0x834b6b
mov dword [esp + 0x1c], edx
movzx eax, byte [esi + ebp - 1]
test ecx, eax
jne 0x834b61
lea ecx, [ebp - 4]
shr ecx, 2
je 0x834b59
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 0x834b2f
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 0x834a7d
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 + 0xb50790]
push dword [esp + 0x1c]
push dword [esp + 0x4c]
push dword [esi + 0x20]
push 0xbbae24
push 1
push dword [esp + 0x2c]
call fcn.008347c0
add esp, 0x24
mov ecx, dword [esp + 0x40]
mov edi, dword [esp + 8]
mov esi, dword [esi + 0xc]
test esi, esi
jne 0x8348a6
add esp, 0x28
pop esi
pop edi
pop ebx
pop ebp
ret