Function at 0x1002d5a0
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
push ebx
mov ebx, dword [ebp + 0xc]
push esi
mov esi, dword [ebp + 8]
mov dword [ebp - 8], edx
mov dword [ebp - 4], ecx
cmp esi, edx
jne 0x1002d5c0
pop esi
mov eax, ecx
pop ebx
mov esp, ebp
pop ebp
ret
push edi
cmp esi, 1
jl 0x1002d5cb
cmp esi, 4
jle 0x1002d5e6
push 0x6a4
push 0x100fa1e8
push 0x100fa24c
call fcn.100ba3ee
add esp, 0xc
test esi, esi
js 0x1002d61e
test ebx, ebx
js 0x1002d61e
je 0x1002d5f9
xor edx, edx
mov eax, 0x7fffffff
div ebx
cmp esi, eax
jg 0x1002d61e
mov ecx, esi
imul ecx, ebx
mov dword [ebp - 0x18], ecx
test ecx, ecx
js 0x1002d61e
mov eax, dword [ebp + 0x10]
test eax, eax
js 0x1002d61e
je 0x1002d64b
mov edi, dword [ebp + 0x10]
xor edx, edx
mov eax, 0x7fffffff
div edi
cmp ecx, eax
jle 0x1002d64d
push dword [ebp - 4]
call fcn.100ba5ea
mov ecx, dword [0x1012e948]
add esp, 4
mov eax, dword fs:[0x2c]
pop edi
mov eax, dword [eax + ecx*4]
pop esi
pop ebx
mov dword [eax + 0x10], 0x100fa16c
xor eax, eax
mov esp, ebp
pop ebp
ret
mov edi, eax
mov eax, ecx
imul eax, edi
push eax
call fcn.100bbecb
mov edi, eax
add esp, 4
mov dword [ebp - 0x14], edi
test edi, edi
je 0x1002d61e
cmp dword [ebp + 0x10], 0
mov dword [ebp + 8], 0
jle 0x1002d926
mov eax, dword [ebp - 8]
lea ecx, [esi - 0xa]
mov esi, dword [ebp - 4]
mov dword [ebp - 0xc], esi
lea ecx, [ecx + eax*8]
imul eax, ebx
mov dword [ebp - 0x1c], ecx
mov dword [ebp - 8], eax
mov eax, edi
mov dword [ebp - 0x10], eax
cmp ecx, 0x19
ja case.0x1002d6a2.3
movzx ecx, byte [ecx + 0x1002d9b8]
jmp dword [ecx*4 + 0x1002d984]
lea edx, [ebx - 1]
test edx, edx
js 0x1002d8fe
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 0x1002d6b4
jmp 0x1002d8fe
lea edx, [ebx - 1]
test edx, edx
js 0x1002d8fe
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 0x1002d6d7
jmp 0x1002d8fe
lea edx, [ebx - 1]
test edx, edx
js 0x1002d8fe
nop dword [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 0x1002d700
jmp 0x1002d8fe
lea edx, [ebx - 1]
test edx, edx
js 0x1002d8fe
nop word [eax + eax]
sub edx, 1
mov cl, byte [esi]
mov byte [eax], cl
lea esi, [esi + 2]
lea eax, [eax + 1]
jns 0x1002d730
jmp 0x1002d8fe
lea edx, [ebx - 1]
test edx, edx
js 0x1002d8fe
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 0x1002d750
jmp 0x1002d8fe
lea edx, [ebx - 1]
test edx, edx
js 0x1002d8fe
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 0x1002d776
jmp 0x1002d8fe
lea edx, [ebx - 1]
test edx, edx
js 0x1002d8fe
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 0x1002d7a3
jmp 0x1002d8fe
lea edi, [ebx - 1]
test edi, edi
js 0x1002d8fe
nop word [eax + eax]
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 0x1002d7e0
jmp 0x1002d8fe
lea edi, [ebx - 1]
test edi, edi
js 0x1002d8fe
nop dword [eax]
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 0x1002d820
jmp 0x1002d8fe
lea edi, [ebx - 1]
test edi, edi
js 0x1002d8fe
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 0x1002d861
jmp 0x1002d8fe
lea edi, [ebx - 1]
test edi, edi
js 0x1002d8fe
nop word [eax + 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 0x1002d8a0
jmp 0x1002d8fe
lea edx, [ebx - 1]
test edx, edx
js 0x1002d8fe
nop dword [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 0x1002d8e0
mov ecx, dword [ebp + 8]
mov esi, dword [ebp - 0xc]
inc ecx
mov eax, dword [ebp - 0x10]
add esi, dword [ebp - 8]
add eax, dword [ebp - 0x18]
cmp ecx, dword [ebp + 0x10]
mov dword [ebp + 8], ecx
mov ecx, dword [ebp - 0x1c]
mov dword [ebp - 0xc], esi
mov dword [ebp - 0x10], eax
jl 0x1002d692
mov edi, dword [ebp - 0x14]
push dword [ebp - 4]
call fcn.100ba5ea
add esp, 4
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push 0x6c1
push 0x100fa178
push 0x100fa08c
call fcn.100ba3ee
push dword [ebp - 4]
call fcn.100ba5ea
push dword [ebp - 0x14]
call fcn.100ba5ea
mov ecx, dword [0x1012e948]
add esp, 0x14
mov eax, dword fs:[0x2c]
pop edi
mov eax, dword [eax + ecx*4]
pop esi
pop ebx
mov dword [eax + 0x10], 0x100fa0f4
xor eax, eax
mov esp, ebp
pop ebp
ret