Function at 0x804fc0
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 [0xbcbae0]
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.007779c0
add esp, 0xc
cmp dword [esi + 0x28], 0
jne 0x8050dd
cmp word [esi + 0x32], 0
je 0x8053e9
mov ebp, fcn.007c7f40
mov ebx, fcn.00792de0
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 0x8052e7
mov eax, ebx
movzx ecx, byte [0xbb1ac7]
xor eax, fcn.00792de0
sete al
xor al, 5
add al, 4
and al, 7
movzx eax, al
bt ecx, eax
jb 0x8052d3
mov al, byte [0xbb1ac7]
mov ecx, ebx
mov dl, 1
xor ecx, fcn.00792de0
sete cl
xor cl, 5
add cl, 4
and cl, 7
xor cl, 7
shl dl, cl
or dl, al
lock cmpxchg byte [0xbb1ac7], dl
jne 0x80506c
mov ecx, ebx
movzx eax, al
xor ecx, fcn.00792de0
sete cl
xor cl, 5
add cl, 4
and cl, 7
xor cl, 7
movzx ecx, cl
bt eax, ecx
jae 0x80526c
mov eax, ebx
movzx ecx, byte [0xbb1ac7]
xor eax, fcn.00792de0
sete al
xor al, 5
add al, 4
and al, 7
movzx eax, al
bt ecx, eax
jae 0x8050b9
jmp 0x8052d3
mov edx, fcn.0081e310
xor eax, eax
movzx edi, byte [0xbb1abf]
not edx
and edx, 1
mov ecx, edx
add ecx, fcn.0081e310
sete al
mov ecx, eax
not ecx
lea eax, [eax + ecx*2]
and al, 3
movzx eax, al
bt edi, eax
jb 0x805253
mov al, byte [0xbb1abf]
mov edi, esi
mov esi, edx
xor ecx, ecx
mov ah, 1
add esi, fcn.0081e310
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 [0xbb1abf], ah
jne 0x805117
mov ecx, fcn.0081e310
xor edx, edx
movzx eax, al
not ecx
and ecx, 1
mov esi, ecx
add esi, fcn.0081e310
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 0x80519c
mov esi, edi
mov edx, ecx
xor eax, eax
movzx edi, byte [0xbb1abf]
add edx, fcn.0081e310
sete al
mov edx, eax
not edx
lea eax, [eax + edx*2]
and al, 3
movzx eax, al
bt edi, eax
jae 0x805172
jmp 0x805253
xor eax, eax
add ecx, fcn.0081e310
movzx edx, byte [0xbb1abf]
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 0x805228
mov ecx, fcn.0081e310
xor eax, eax
not ecx
and ecx, 1
add ecx, fcn.0081e310
sete al
mov ecx, eax
not ecx
and ecx, 0x8a5
lea ecx, [eax + ecx*2 + 0x3b555340]
mov eax, dword [0xbb1ab0]
xor eax, ecx
mov dword [0xbb1ab0], eax
not eax
mov edx, dword [0xbb1ab4]
imul eax, ecx
and cl, 7
lea esi, [eax + eax]
xor edx, eax
shr eax, 0x1e
mov dword [0xbb1ab4], edx
or eax, esi
not edx
mov esi, edi
imul edx, eax
xor dword [0xbb1ab8], edx
mov dl, 1
shl dl, cl
or byte [0xbb1abf], dl
mov eax, fcn.0081e310
xor ecx, ecx
not eax
and eax, 1
add eax, fcn.0081e310
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 [0xbb1abf], al
push dword [esi]
push 0xbb1ab0
lea eax, [esp + 0x1c]
push eax
call fcn.00777c30
add esp, 0xc
jmp 0x8053e9
mov eax, ebx
movzx ecx, byte [0xbb1ac7]
xor eax, fcn.00792de0
sete al
xor al, 5
add al, 4
and al, 7
movzx eax, al
bt ecx, eax
jb 0x8052b3
mov eax, ebx
xor ecx, ecx
xor eax, fcn.00792de0
mov al, 1
sete cl
xor ecx, 0x242b1eed
add ecx, 4
xor dword [0xbb1ac0], ecx
and cl, 7
shl al, cl
or byte [0xbb1ac7], al
mov eax, ebx
xor eax, fcn.00792de0
mov al, 0xfe
sete cl
xor cl, 5
add cl, 4
and cl, 7
xor cl, 7
rol al, cl
and byte [0xbb1ac7], al
push 2
push 0xbb1ac0
lea eax, [esp + 0x1c]
push eax
call fcn.007774d0
add esp, 0xc
cmp ebp, 1
movzx ecx, byte [0xbb1acf]
seta al
or al, 4
movzx eax, al
bt ecx, eax
jb 0x8053a4
mov al, byte [0xbb1acf]
cmp ebp, 1
mov dl, 1
seta cl
or cl, 4
xor cl, 7
shl dl, cl
or dl, al
lock cmpxchg byte [0xbb1acf], dl
jne 0x805307
cmp ebp, 1
movzx eax, al
seta cl
or cl, 4
xor cl, 7
movzx ecx, cl
bt eax, ecx
jae 0x805353
cmp ebp, 1
movzx ecx, byte [0xbb1acf]
seta al
or al, 4
movzx eax, al
bt ecx, eax
jae 0x80533a
jmp 0x8053a4
cmp ebp, 1
movzx ecx, byte [0xbb1acf]
seta al
or al, 4
movzx eax, al
bt ecx, eax
jb 0x80538e
xor ecx, ecx
cmp ebp, 1
mov al, 1
seta cl
or ecx, 0x4eec4b58
add ecx, 0x44
xor dword [0xbb1ac8], ecx
and cl, 7
shl al, cl
or byte [0xbb1acf], al
cmp ebp, 1
mov al, 0xfe
seta cl
or cl, 4
xor cl, 7
rol al, cl
and byte [0xbb1acf], al
mov edi, dword [esp + 8]
push dword [edi]
lea esi, [esp + 0x18]
push esi
call fcn.00777700
add esp, 8
push 1
push 0xbb1ac8
push esi
call fcn.007774d0
add esp, 0xc
push dword [esp + 0xc]
push esi
call fcn.00777700
add esp, 8
mov esi, dword [esp + 0x44]
mov edx, dword [esp + 0x10]
movzx eax, word [esi + 0x32]
inc edx
cmp edx, eax
jb 0x805024
lea ecx, [esp + 0x14]
call fcn.007778c0
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.007f0b50
add esp, 0x10
mov ecx, dword [esp + 0x2c]
xor ecx, esp
call fcn.00980459
add esp, 0x30
pop esi
pop edi
pop ebx
pop ebp
ret