Function at 0x818540
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
push eax
mov esi, dword [edx + 0x14]
test esi, esi
jne 0x818553
xor ebx, ebx
jmp 0x8187fa
cmp dword [esi], 1
je 0x81855f
xor ebx, ebx
jmp 0x8187fa
test byte [edx + 7], 1
je 0x81856c
xor ebx, ebx
jmp 0x8187fa
mov ebx, fcn.007801b0
mov eax, fcn.007801b0
mov edi, ecx
movzx ecx, byte [0xbba1eb]
and ebx, 1
xor ebx, eax
cmp ebx, 0xffffffff
sete al
or al, 2
movzx eax, al
bt ecx, eax
jb 0x81867e
mov al, byte [0xbba1eb]
cmp ebx, 0xffffffff
mov ah, 1
sete cl
or cl, 2
xor cl, 7
shl ah, cl
or ah, al
lock cmpxchg byte [0xbba1eb], ah
jne 0x81859d
mov ecx, fcn.007801b0
mov ebx, fcn.007801b0
and ecx, 1
xor ecx, ebx
cmp ecx, 0xffffffff
sete ah
or ah, 2
xor ah, 7
movzx ebx, ah
movzx eax, al
bt eax, ebx
jae 0x8185fb
cmp ecx, 0xffffffff
movzx ebx, byte [0xbba1eb]
sete al
or al, 2
movzx eax, al
bt ebx, eax
jae 0x8185df
jmp 0x81867e
cmp ecx, 0xffffffff
movzx ebx, byte [0xbba1eb]
sete al
or al, 2
movzx eax, al
bt ebx, eax
jb 0x818659
mov ebx, fcn.007801b0
mov eax, fcn.007801b0
xor ecx, ecx
and ebx, 1
xor ebx, eax
mov eax, dword [0xbba1e0]
cmp ebx, 0xffffffff
sete cl
or ecx, 0x34c93842
add ecx, 0xb10
xor eax, ecx
mov dword [0xbba1e0], eax
not eax
imul eax, ecx
and cl, 7
xor dword [0xbba1e4], eax
mov ah, 1
shl ah, cl
or byte [0xbba1eb], ah
mov ecx, fcn.007801b0
mov eax, fcn.007801b0
and ecx, 1
xor ecx, eax
mov al, 0xfe
cmp ecx, 0xffffffff
sete cl
or cl, 2
xor cl, 7
rol al, cl
and byte [0xbba1eb], al
mov ebx, dword [edx + 8]
mov edx, 0xbba1e0
mov ecx, ebx
call fcn.00783720
test eax, eax
jne 0x81869d
mov byte [esp + 3], 2
mov bl, 1
jmp 0x8187da
mov eax, fcn.007c2bf0
mov edx, 3
movzx ecx, byte [0xbba1f7]
sub edx, eax
mov eax, edx
xor eax, fcn.007c2bf0
sete al
or al, 2
movzx eax, al
bt ecx, eax
jb 0x8187c3
mov al, byte [0xbba1f7]
mov ecx, edx
mov ah, 1
xor ecx, fcn.007c2bf0
sete cl
or cl, 2
xor cl, 7
shl ah, cl
or ah, al
lock cmpxchg byte [0xbba1f7], ah
jne 0x8186cd
mov edx, fcn.007c2bf0
mov ecx, 3
movzx eax, al
sub ecx, edx
mov edx, ecx
xor edx, fcn.007c2bf0
sete dl
or dl, 2
xor dl, 7
movzx edx, dl
bt eax, edx
jae 0x818736
mov eax, ecx
movzx edx, byte [0xbba1f7]
xor eax, fcn.007c2bf0
sete al
or al, 2
movzx eax, al
bt edx, eax
jae 0x818716
jmp 0x8187c3
xor ecx, fcn.007c2bf0
movzx ecx, byte [0xbba1f7]
sete al
or al, 2
movzx eax, al
bt ecx, eax
jb 0x81879e
mov eax, fcn.007c2bf0
mov edx, 3
xor ecx, ecx
sub edx, eax
mov eax, dword [0xbba1ec]
xor edx, fcn.007c2bf0
sete cl
or ecx, 0x9dd60b7a
add ecx, 0x900
mov edx, ecx
xor eax, ecx
shr edx, 0x1f
mov dword [0xbba1ec], eax
not eax
or edx, ecx
and cl, 7
imul edx, eax
xor dword [0xbba1f0], edx
mov dl, 1
shl dl, cl
or byte [0xbba1f7], dl
mov eax, fcn.007c2bf0
mov ecx, 3
sub ecx, eax
mov al, 0xfe
xor ecx, fcn.007c2bf0
sete cl
or cl, 2
xor cl, 7
rol al, cl
and byte [0xbba1f7], al
mov ecx, ebx
mov edx, 0xbba1ec
call fcn.00783720
test eax, eax
jne 0x818804
mov bl, 2
mov byte [esp + 3], 1
mov ebp, dword [esp + 0x18]
mov ecx, edi
mov edx, esi
push 0
call fcn.007ff8b0
add esp, 4
test eax, eax
mov dword [ebp], eax
je 0x8187fa
mov cl, byte [esp + 3]
mov byte [eax + 0xc], cl
mov eax, ebx
add esp, 4
pop esi
pop edi
pop ebx
pop ebp
ret
xor ebx, ebx
jmp 0x8187fa