Function at 0x999158
Capabilities:
Encode data using xor

Disassembly:
push ebp
xor eax, eax
mov ebp, esp
push edi
mov edx, dword [ebp + 0xc]
push esi
push ebx
test edx, edx
je 0x9993dc
mov edi, dword [ebp + 0x10]
mov ecx, edx
mov eax, dword [ebp + 8]
test edi, edi
mov ebx, eax
not ebx
je 0x9991a8
lea esi, [esi]
lea edi, [edi]
test cl, 3
je 0x9991a8
movzx eax, byte [ecx]
inc ecx
xor al, bl
movzx esi, al
shr ebx, 8
mov edx, dword [esi*4 + 0xd6e4e0]
xor ebx, edx
dec edi
jne 0x999188
lea esi, [esi]
mov esi, ecx
jmp 0x999366
mov edx, ebx
mov ebx, dword [esi]
xor edx, ebx
movzx ecx, dl
movzx eax, dh
mov ebx, dword [ecx*4 + 0xd6f0e0]
mov eax, dword [eax*4 + 0xd6ece0]
shr edx, 0x10
movzx ecx, dl
shr edx, 8
xor eax, ebx
mov ebx, dword [ecx*4 + 0xd6e8e0]
mov ecx, dword [edx*4 + 0xd6e4e0]
xor eax, ebx
mov ebx, dword [esi + 4]
xor eax, ecx
xor eax, ebx
movzx ecx, al
movzx edx, ah
mov ebx, dword [ecx*4 + 0xd6f0e0]
mov edx, dword [edx*4 + 0xd6ece0]
shr eax, 0x10
movzx ecx, al
xor edx, ebx
mov ebx, dword [ecx*4 + 0xd6e8e0]
shr eax, 8
mov ecx, dword [eax*4 + 0xd6e4e0]
xor edx, ebx
mov ebx, dword [esi + 8]
xor edx, ecx
xor edx, ebx
movzx ecx, dl
movzx eax, dh
mov ebx, dword [ecx*4 + 0xd6f0e0]
shr edx, 0x10
mov eax, dword [eax*4 + 0xd6ece0]
movzx ecx, dl
shr edx, 8
xor eax, ebx
mov ebx, dword [ecx*4 + 0xd6e8e0]
mov ecx, dword [edx*4 + 0xd6e4e0]
xor eax, ebx
mov ebx, dword [esi + 0xc]
xor eax, ecx
xor eax, ebx
movzx ecx, al
movzx edx, ah
mov ebx, dword [ecx*4 + 0xd6f0e0]
mov edx, dword [edx*4 + 0xd6ece0]
shr eax, 0x10
movzx ecx, al
shr eax, 8
xor edx, ebx
mov ebx, dword [ecx*4 + 0xd6e8e0]
mov ecx, dword [eax*4 + 0xd6e4e0]
xor edx, ebx
mov ebx, dword [esi + 0x10]
xor edx, ecx
xor edx, ebx
movzx ecx, dl
movzx eax, dh
mov ebx, dword [ecx*4 + 0xd6f0e0]
shr edx, 0x10
mov eax, dword [eax*4 + 0xd6ece0]
movzx ecx, dl
shr edx, 8
sub edi, 0x20
xor eax, ebx
mov ebx, dword [ecx*4 + 0xd6e8e0]
mov ecx, dword [edx*4 + 0xd6e4e0]
xor eax, ebx
mov ebx, dword [esi + 0x14]
xor eax, ecx
xor eax, ebx
movzx ecx, al
movzx edx, ah
mov ebx, dword [ecx*4 + 0xd6f0e0]
mov edx, dword [edx*4 + 0xd6ece0]
shr eax, 0x10
movzx ecx, al
xor edx, ebx
mov ebx, dword [ecx*4 + 0xd6e8e0]
shr eax, 8
mov ecx, dword [eax*4 + 0xd6e4e0]
xor edx, ebx
mov ebx, dword [esi + 0x18]
xor edx, ecx
xor edx, ebx
movzx ecx, dl
movzx eax, dh
mov ebx, dword [ecx*4 + 0xd6f0e0]
shr edx, 0x10
mov eax, dword [eax*4 + 0xd6ece0]
movzx ecx, dl
shr edx, 8
xor eax, ebx
mov ebx, dword [ecx*4 + 0xd6e8e0]
mov ecx, dword [edx*4 + 0xd6e4e0]
xor eax, ebx
mov ebx, dword [esi + 0x1c]
xor eax, ecx
add esi, 0x20
xor eax, ebx
movzx ecx, al
movzx edx, ah
mov ebx, dword [edx*4 + 0xd6ece0]
shr eax, 0x10
mov edx, dword [ecx*4 + 0xd6f0e0]
xor ebx, edx
movzx edx, al
mov ecx, dword [edx*4 + 0xd6e8e0]
shr eax, 8
xor ebx, ecx
mov ecx, dword [eax*4 + 0xd6e4e0]
xor ebx, ecx
cmp edi, 0x1f
ja 0x9991af
cmp edi, 3
jbe 0x9993ba
lea esi, [esi]
mov eax, ebx
mov ebx, dword [esi]
sub edi, 4
add esi, 4
xor eax, ebx
movzx ecx, al
movzx edx, ah
mov ebx, dword [edx*4 + 0xd6ece0]
shr eax, 0x10
mov edx, dword [ecx*4 + 0xd6f0e0]
xor ebx, edx
movzx edx, al
mov ecx, dword [edx*4 + 0xd6e8e0]
shr eax, 8
mov edx, dword [eax*4 + 0xd6e4e0]
xor ebx, ecx
xor ebx, edx
cmp edi, 3
ja 0x999378
mov edx, esi
test edi, edi
jmp 0x9993d6
movzx ecx, byte [edx]
inc edx
xor cl, bl
movzx eax, cl
shr ebx, 8
mov esi, dword [eax*4 + 0xd6e4e0]
xor ebx, esi
dec edi
jne 0x9993c0
mov eax, ebx
not eax
pop ebx
pop esi
pop edi
pop ebp
ret