Function at 0x1008b710
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
sub esp, 0x14
push ebx
mov ebx, dword [esp + 0x24]
mov eax, edx
push ebp
push esi
mov esi, dword [esp + 0x28]
mov ebp, ecx
push edi
mov edi, dword [esp + 0x28]
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], ebp
cmp edi, eax
jne 0x1008b73f
pop edi
pop esi
mov eax, ebp
pop ebp
pop ebx
add esp, 0x14
ret 0xc
test edi, edi
js 0x1008baa5
test esi, esi
js 0x1008baa5
je 0x1008b762
xor edx, edx
mov eax, 0x7fffffff
div esi
cmp edi, eax
jg 0x1008baa5
mov ecx, edi
imul ecx, esi
mov dword [esp + 0x20], ecx
test ecx, ecx
js 0x1008baa5
test ebx, ebx
js 0x1008baa5
je 0x1008b78e
xor edx, edx
mov eax, 0x7fffffff
div ebx
cmp ecx, eax
jg 0x1008baa5
mov eax, ecx
imul eax, ebx
push eax
call fcn.1012c06c
add esp, 4
mov dword [esp + 0x1c], eax
test eax, eax
je 0x1008baa5
mov dword [esp + 0x28], 0
test ebx, ebx
jle 0x1008ba6d
mov ecx, dword [esp + 0x10]
lea ebx, [esi - 1]
mov dword [esp + 0x18], eax
lea ebp, [ecx*8 - 0xa]
add ebp, edi
imul ecx, esi
mov dword [esp + 0x10], ecx
mov ecx, dword [esp + 0x14]
mov dword [esp + 0x2c], ecx
nop dword [eax + eax]
mov esi, ecx
cmp ebp, 0x19
ja case.0x1008b7f2.3
movzx ecx, byte [ebp + 0x1008baf0]
jmp dword [ecx*4 + 0x1008babc]
mov edx, ebx
test edx, edx
js 0x1008ba3e
sub edx, 1
mov cl, byte [esi]
mov byte [eax], cl
lea esi, [esi + 1]
mov byte [eax + 1], 0xff
lea eax, [eax + 2]
jns 0x1008b803
jmp 0x1008ba3e
mov edx, ebx
test edx, edx
js 0x1008ba3e
sub edx, 1
mov cl, byte [esi]
mov byte [eax + 2], cl
lea esi, [esi + 1]
mov byte [eax + 1], cl
lea eax, [eax + 3]
mov byte [eax - 3], cl
jns 0x1008b825
jmp 0x1008ba3e
mov edx, ebx
test edx, edx
js 0x1008ba3e
nop word [eax + eax]
sub edx, 1
mov cl, byte [esi]
mov byte [eax + 2], cl
lea esi, [esi + 1]
mov byte [eax + 1], cl
lea eax, [eax + 4]
mov byte [eax - 4], cl
mov byte [eax - 1], 0xff
jns 0x1008b850
jmp 0x1008ba3e
mov edx, ebx
test edx, edx
js 0x1008ba3e
nop dword [eax]
sub edx, 1
mov cl, byte [esi]
mov byte [eax], cl
lea esi, [esi + 2]
lea eax, [eax + 1]
jns 0x1008b880
jmp 0x1008ba3e
mov edx, ebx
test edx, edx
js 0x1008ba3e
nop
sub edx, 1
mov cl, byte [esi]
mov byte [eax + 2], cl
lea esi, [esi + 2]
mov byte [eax + 1], cl
lea eax, [eax + 3]
mov byte [eax - 3], cl
jns 0x1008b8a0
jmp 0x1008ba3e
mov edx, ebx
test edx, edx
js 0x1008ba3e
sub edx, 1
mov cl, byte [esi]
mov byte [eax + 2], cl
lea esi, [esi + 2]
mov byte [eax + 1], cl
lea eax, [eax + 4]
mov byte [eax - 4], cl
movzx ecx, byte [esi - 1]
mov byte [eax - 1], cl
jns 0x1008b8c5
jmp 0x1008ba3e
mov edx, ebx
test edx, edx
js 0x1008ba3e
sub edx, 1
movzx ecx, byte [esi]
mov byte [eax], cl
lea esi, [esi + 3]
movzx ecx, byte [esi - 2]
lea eax, [eax + 4]
mov byte [eax - 3], cl
movzx ecx, byte [esi - 1]
mov byte [eax - 2], cl
mov byte [eax - 1], 0xff
jns 0x1008b8f1
jmp 0x1008ba3e
mov edi, ebx
test edi, edi
js 0x1008ba3e
movzx ecx, byte [esi + 1]
lea esi, [esi + 3]
imul edx, ecx, 0x96
lea eax, [eax + 1]
movzx ecx, byte [esi - 1]
imul ecx, ecx, 0x1d
add edx, ecx
movzx ecx, byte [esi - 3]
imul ecx, ecx, 0x4d
add edx, ecx
shr edx, 8
sub edi, 1
mov byte [eax - 1], dl
jns 0x1008b922
jmp 0x1008ba3e
mov edi, ebx
test edi, edi
js 0x1008ba3e
nop
movzx ecx, byte [esi + 1]
lea esi, [esi + 3]
imul edx, ecx, 0x96
lea eax, [eax + 2]
movzx ecx, byte [esi - 1]
imul ecx, ecx, 0x1d
add edx, ecx
movzx ecx, byte [esi - 3]
imul ecx, ecx, 0x4d
mov byte [eax - 1], 0xff
add edx, ecx
shr edx, 8
sub edi, 1
mov byte [eax - 2], dl
jns 0x1008b960
jmp 0x1008ba3e
mov edi, ebx
test edi, edi
js 0x1008ba3e
movzx ecx, byte [esi + 1]
lea esi, [esi + 4]
imul edx, ecx, 0x96
lea eax, [eax + 1]
movzx ecx, byte [esi - 2]
imul ecx, ecx, 0x1d
add edx, ecx
movzx ecx, byte [esi - 4]
imul ecx, ecx, 0x4d
add edx, ecx
shr edx, 8
sub edi, 1
mov byte [eax - 1], dl
jns 0x1008b9a0
jmp 0x1008ba3e
mov edi, ebx
test edi, edi
js 0x1008ba3e
nop dword [eax]
movzx ecx, byte [esi + 1]
lea esi, [esi + 4]
imul edx, ecx, 0x96
lea eax, [eax + 2]
movzx ecx, byte [esi - 2]
imul ecx, ecx, 0x1d
add edx, ecx
movzx ecx, byte [esi - 4]
imul ecx, ecx, 0x4d
add edx, ecx
shr edx, 8
sub edi, 1
mov byte [eax - 2], dl
mov cl, byte [esi - 1]
mov byte [eax - 1], cl
jns 0x1008b9e0
jmp 0x1008ba3e
mov edx, ebx
test edx, edx
js 0x1008ba3e
nop dword [eax + eax]
sub edx, 1
movzx ecx, byte [esi]
mov byte [eax], cl
lea esi, [esi + 4]
movzx ecx, byte [esi - 3]
lea eax, [eax + 3]
mov byte [eax - 2], cl
movzx ecx, byte [esi - 2]
mov byte [eax - 1], cl
jns 0x1008ba20
mov esi, dword [esp + 0x28]
mov ecx, dword [esp + 0x2c]
inc esi
mov eax, dword [esp + 0x18]
add ecx, dword [esp + 0x10]
add eax, dword [esp + 0x20]
mov dword [esp + 0x28], esi
mov dword [esp + 0x2c], ecx
mov dword [esp + 0x18], eax
cmp esi, dword [esp + 0x30]
jl 0x1008b7e0
mov ebp, dword [esp + 0x14]
push ebp
call fcn.1012b039
mov eax, dword [esp + 0x20]
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret 0xc
push dword [esp + 0x14]
call fcn.1012b039
push dword [esp + 0x20]
call fcn.1012b039
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret 0xc
push ebp
call fcn.1012b039
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret 0xc