Function at 0x804380
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0xc
test edx, edx
je 0x8046ae
cmp dword [edx], 0
mov ebx, edx
mov dword [esp + 4], 0
jle 0x8046b6
mov eax, dword [ecx + 0xc]
lea ebp, [ebx + 8]
xor esi, esi
mov dword [esp], ecx
mov dword [esp + 8], eax
cmp byte [ecx + 8], 0
jne 0x80465f
mov edi, dword [ebp + 4]
test edi, edi
je 0x804640
mov edx, dword [esp + 8]
mov ecx, edi
call fcn.00777e20
mov ecx, dword [esp]
test eax, eax
je 0x804640
mov edx, 0x8317d0
movzx ecx, byte [0xbb1a83]
not edx
and edx, 1
mov eax, edx
add eax, 0x8317d0
sete al
or al, 4
movzx eax, al
bt ecx, eax
jb 0x80461c
mov al, byte [0xbb1a83]
mov ecx, edx
mov ah, 1
add ecx, 0x8317d0
sete cl
or cl, 4
xor cl, 7
shl ah, cl
or ah, al
lock cmpxchg byte [0xbb1a83], ah
jne 0x80440a
mov ecx, 0x8317d0
movzx eax, al
not ecx
and ecx, 1
mov edx, ecx
add edx, 0x8317d0
sete dl
or dl, 4
xor dl, 7
movzx edx, dl
bt eax, edx
jae 0x804471
mov eax, ecx
movzx edx, byte [0xbb1a83]
add eax, 0x8317d0
sete al
or al, 4
movzx eax, al
bt edx, eax
jae 0x804451
jmp 0x80461c
add ecx, 0x8317d0
movzx ecx, byte [0xbb1a83]
sete al
or al, 4
movzx eax, al
bt ecx, eax
jb 0x8045fa
mov eax, 0x8317d0
xor ecx, ecx
not eax
and eax, 1
add eax, 0x8317d0
mov eax, dword [0xbb1a50]
sete cl
or ecx, 0xf02bb964
add ecx, 0xd20
mov edx, ecx
xor eax, ecx
shr edx, 0x1f
mov dword [0xbb1a50], eax
not eax
or edx, ecx
and cl, 7
imul edx, eax
mov eax, dword [0xbb1a54]
lea esi, [edx + edx]
xor eax, edx
shr edx, 0x1e
mov dword [0xbb1a54], eax
or esi, edx
not eax
mov edx, dword [0xbb1a58]
imul eax, esi
lea esi, [eax*4]
xor edx, eax
shr eax, 0x1d
mov dword [0xbb1a58], edx
or esi, eax
not edx
mov eax, dword [0xbb1a5c]
imul edx, esi
lea esi, [edx*8]
xor eax, edx
shr edx, 0x1c
mov dword [0xbb1a5c], eax
or esi, edx
not eax
mov edx, dword [0xbb1a60]
imul eax, esi
mov esi, eax
shl esi, 4
xor edx, eax
shr eax, 0x1b
mov dword [0xbb1a60], edx
or eax, esi
not edx
mov ebx, dword [0xbb1a64]
imul edx, eax
mov esi, edx
shl esi, 5
xor ebx, edx
shr edx, 0x1a
mov dword [0xbb1a64], ebx
or edx, esi
not ebx
imul ebx, edx
mov edx, dword [0xbb1a68]
mov esi, ebx
shl esi, 6
xor edx, ebx
shr ebx, 0x19
mov dword [0xbb1a68], edx
or ebx, esi
not edx
mov ebp, dword [str.P_FY]
imul edx, ebx
mov esi, edx
shl esi, 7
xor ebp, edx
shr edx, 0x18
mov dword [str.P_FY], ebp
or edx, esi
not ebp
imul ebp, edx
mov edx, dword [0xbb1a70]
mov esi, ebp
shl esi, 8
xor edx, ebp
shr ebp, 0x17
mov dword [0xbb1a70], edx
or ebp, esi
not edx
mov ebx, dword [0xbb1a74]
imul edx, ebp
mov esi, edx
shl esi, 9
xor ebx, edx
shr edx, 0x16
mov dword [0xbb1a74], ebx
or edx, esi
not ebx
imul ebx, edx
mov edx, dword [0xbb1a78]
mov esi, ebx
shl esi, 0xa
xor edx, ebx
shr ebx, 0x15
mov dword [0xbb1a78], edx
or ebx, esi
not edx
imul edx, ebx
xor dword [0xbb1a7c], edx
mov dl, 1
shl dl, cl
or byte [0xbb1a83], dl
mov eax, 0x8317d0
not eax
and eax, 1
add eax, 0x8317d0
mov al, 0xfe
sete cl
or cl, 4
xor cl, 7
rol al, cl
and byte [0xbb1a83], al
push edi
mov eax, dword [esp + 4]
push dword [eax + 0x14]
push dword [eax + 0x10]
push 0xbb1a50
push dword [eax]
call fcn.00782570
add esp, 0x14
mov dword [esp + 4], 1
jmp 0x8046b6
mov eax, dword [ecx]
mov edx, edi
mov ecx, dword [eax]
call fcn.00774f10
mov ecx, dword [esp]
mov dword [ebp + 4], 0
mov eax, dword [ecx + 4]
mov dword [ebp], eax
or byte [ebp + 0x28], 0x40
mov edx, dword [ebp + 0x14]
mov edi, ebx
mov ebx, ecx
call fcn.00804a80
test eax, eax
mov dword [esp + 4], 1
jne 0x8046b6
mov edx, dword [ebp + 0x30]
mov ecx, ebx
call fcn.00804b40
test eax, eax
jne 0x8046b6
test byte [ebp + 0x28], 4
mov ecx, dword [esp]
mov ebx, edi
je 0x8046a2
mov edx, dword [ebp + 0x40]
mov ecx, dword [esp]
call fcn.00804e00
mov ecx, dword [esp]
test eax, eax
jne 0x8046b6
inc esi
add ebp, 0x48
cmp esi, dword [ebx]
jl 0x8043b1
mov dword [esp + 4], 0
mov eax, dword [esp + 4]
add esp, 0xc
pop esi
pop edi
pop ebx
pop ebp
ret