Function at 0x804b40
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
push eax
xor edi, edi
test edx, edx
je 0x804de9
mov ebx, edx
mov esi, ecx
cmp byte [esi + 8], 0
jne 0x804b5d
or byte [ebx + 7], 0x40
cmp byte [ebx], 0x99
jne 0x804b72
mov edx, dword [esi]
mov eax, dword [edx]
cmp byte [eax + 0xa5], 0
je 0x804ba7
mov byte [ebx], 0x77
mov eax, dword [ebx + 4]
test eax, 0x804000
jne 0x804de9
test eax, 0x800
je 0x804db4
mov edx, dword [ebx + 0x14]
mov ecx, esi
call fcn.00804a80
test eax, eax
je 0x804dc9
mov edi, 1
jmp 0x804de9
mov edi, fcn.0077fb20
mov ebx, fcn.0077fb20
xor eax, eax
movzx ebp, byte [0xbb1aaf]
or edi, 2
xor ebx, 2
mov ecx, edi
add ecx, ebx
sete al
mov ecx, eax
xor ecx, 1
lea eax, [eax + ecx*2 + 6]
and al, 7
movzx eax, al
bt ebp, eax
jb 0x804d9c
mov al, byte [0xbb1aaf]
mov dword [esp], edi
mov edi, ebx
mov ebp, dword [esp]
xor ebx, ebx
mov ah, 1
add ebp, edi
sete bl
mov ecx, ebx
xor ecx, 1
lea ecx, [ebx + ecx*2 + 6]
and cl, 7
xor cl, 7
shl ah, cl
or ah, al
lock cmpxchg byte [0xbb1aaf], ah
jne 0x804be8
mov ecx, fcn.0077fb20
mov edi, fcn.0077fb20
xor ebx, ebx
movzx eax, al
or ecx, 2
xor edi, 2
mov ebp, ecx
add ebp, edi
sete bl
mov ebp, ebx
xor ebx, 1
lea ebx, [ebp + ebx*2 + 6]
and bl, 7
xor bl, 7
movzx ebx, bl
bt eax, ebx
jae 0x804c6c
mov ebx, ecx
xor eax, eax
movzx ebp, byte [0xbb1aaf]
add ebx, edi
sete al
mov ebx, eax
xor ebx, 1
lea eax, [eax + ebx*2 + 6]
and al, 7
movzx eax, al
bt ebp, eax
jae 0x804c44
jmp 0x804d9c
xor eax, eax
add ecx, edi
movzx edi, byte [0xbb1aaf]
sete al
mov ecx, eax
xor ecx, 1
lea eax, [eax + ecx*2 + 6]
and al, 7
movzx eax, al
bt edi, eax
jb 0x804d6c
mov ecx, fcn.0077fb20
mov edi, fcn.0077fb20
xor eax, eax
xor edi, 2
or ecx, 2
add ecx, edi
sete al
mov ecx, eax
not ecx
and ecx, 0x111
lea ecx, [eax + ecx*2 + 0x1dbcbe8e]
mov eax, dword [0xbb1a90]
xor eax, ecx
mov dword [0xbb1a90], eax
not eax
mov edi, dword [0xbb1a94]
imul eax, ecx
and cl, 7
lea ebx, [eax + eax]
xor edi, eax
shr eax, 0x1e
mov dword [0xbb1a94], edi
or ebx, eax
not edi
mov eax, dword [0xbb1a98]
imul edi, ebx
lea ebx, [edi*4]
xor eax, edi
shr edi, 0x1d
mov dword [0xbb1a98], eax
or ebx, edi
not eax
mov edi, dword [0xbb1a9c]
imul eax, ebx
lea ebx, [eax*8]
xor edi, eax
shr eax, 0x1c
mov dword [0xbb1a9c], edi
or ebx, eax
not edi
mov eax, dword [0xbb1aa0]
imul edi, ebx
mov ebx, edi
shl ebx, 4
xor eax, edi
shr edi, 0x1b
mov dword [0xbb1aa0], eax
or edi, ebx
not eax
mov ebp, dword [0xbb1aa4]
imul eax, edi
mov ebx, eax
shl ebx, 5
xor ebp, eax
shr eax, 0x1a
mov dword [0xbb1aa4], ebp
or eax, ebx
not ebp
imul ebp, eax
mov ah, 1
xor dword [0xbb1aa8], ebp
shl ah, cl
or byte [0xbb1aaf], ah
mov eax, fcn.0077fb20
mov ecx, fcn.0077fb20
xor ebx, ebx
xor ecx, 2
or eax, 2
add eax, ecx
sete bl
mov eax, ebx
xor eax, 1
lea ecx, [ebx + eax*2 + 6]
mov al, 0xfe
and cl, 7
xor cl, 7
rol al, cl
and byte [0xbb1aaf], al
push dword [esi + 0x10]
push 0xbb1a90
push edx
call fcn.00782570
add esp, 0xc
mov edi, 1
jmp 0x804de9
mov edx, dword [ebx + 0x14]
mov ecx, esi
call fcn.00804e00
test eax, eax
je 0x804dc9
mov edi, 1
jmp 0x804de9
mov edx, dword [ebx + 0x10]
mov ecx, esi
call fcn.00804b40
test eax, eax
je 0x804dde
mov edi, 1
jmp 0x804de9
mov ebx, dword [ebx + 0xc]
test ebx, ebx
jne 0x804b53
mov eax, edi
add esp, 4
pop esi
pop edi
pop ebx
pop ebp
ret