Function at 0x1002e8d0
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xc
push ebx
push edi
mov edi, dword [ebp + 8]
test edi, edi
je 0x1002eb94
mov ebx, dword [ebp + 0xc]
test ebx, ebx
je 0x1002eb94
cmp dword [ebp + 0x10], 0
push esi
je 0x1002ea88
movzx eax, word [edi]
push eax
call fcn.10003aa0
mov dl, byte [edi + 2]
movzx esi, ax
movzx eax, byte [edi + 3]
imul eax, eax, 0xffff
add esi, eax
test dl, dl
jne 0x1002e974
push dword [edi + 8]
xor ecx, ecx
mov dword [ebp - 4], ecx
call fcn.10003ac0
test eax, eax
je 0x1002e967
mov ebx, 0x8c
mov edi, edi
push dword [ebx + edi + 4]
call fcn.10003ac0
push dword [ebx + edi + 4]
shl eax, 2
mov ecx, 0xffffffd8
sub ecx, eax
add esi, ecx
call fcn.10003ac0
push dword [edi + 8]
inc dword [ebp - 4]
lea ebx, [ebx + eax*4]
lea ebx, [ebx + 0x28]
call fcn.10003ac0
cmp dword [ebp - 4], eax
jb 0x1002e930
mov ebx, dword [ebp + 0xc]
cmp esi, 0x8c
jne 0x1002e97c
mov dh, byte [ebp + 0x14]
jmp 0x1002e9a3
cmp esi, 0x8c
ja 0x1002e98d
push 6
call sub.HCCore.dll__Core_SetLastError_4
pop esi
pop edi
or eax, 0xffffffff
pop ebx
mov esp, ebp
pop ebp
ret
mov dh, byte [ebp + 0x14]
cmp dl, dh
movzx ecx, dl
movzx eax, dh
cmova ecx, eax
test cl, cl
jne 0x1002eb7a
test dh, dh
jne 0x1002e9b8
push 0x84cc
push ebx
call fcn.100057d0
mov dword [ebx], 0x84cc
push dword [edi + 4]
call fcn.10003ac0
mov dword [ebx + 4], eax
push dword [edi + 8]
call fcn.10003ac0
mov esi, 0x8c
mov dword [ebx + 8], eax
lea eax, [ebx + 0x10]
mov dword [ebp - 4], eax
mov edi, eax
lea ebx, [esi - 0x7c]
mov edi, edi
push 0x800
push 0xff
push edi
call fcn.1005ea40
add esp, 0xc
add edi, 0x844
dec ebx
jne 0x1002e9e0
mov edi, dword [ebp + 8]
mov dword [ebp - 8], ebx
mov ebx, dword [ebp + 0xc]
cmp dword [ebx + 8], 0
jbe 0x1002eb7a
nop
push dword [esi + edi]
lea ebx, [esi + edi]
mov dword [ebp - 0xc], ebx
call fcn.10003ac0
mov ecx, dword [ebp - 4]
add esi, 0x28
mov dword [ecx - 4], eax
xor ecx, ecx
push dword [ebx + 4]
mov dword [ebp + 8], ecx
call fcn.10003ac0
test eax, eax
je 0x1002ea69
mov ebx, dword [ebp - 4]
jmp 0x1002ea40
mov eax, esi
shr eax, 2
push dword [edi + eax*4]
call fcn.10003ac0
inc dword [ebp + 8]
lea ebx, [ebx + 4]
mov dword [ebx - 4], eax
add esi, 4
mov eax, dword [ebp - 0xc]
push dword [eax + 4]
call fcn.10003ac0
cmp dword [ebp + 8], eax
jb 0x1002ea40
mov ecx, dword [ebp - 8]
mov eax, dword [ebp + 0xc]
inc ecx
add dword [ebp - 4], 0x844
mov dword [ebp - 8], ecx
cmp ecx, dword [eax + 8]
jb 0x1002ea10
pop esi
pop edi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
mov al, byte [ebp + 0x14]
mov byte [edi + 2], al
test al, al
jne 0x1002eb7a
cmp dword [ebx], 0x84cc
mov dword [ebp + 8], 0
jne 0x1002eb83
push dword [ebx + 8]
call fcn.10003ab0
push ebx
mov dword [edi + 8], eax
mov esi, 0x8c
call fcn.100285d0
mov ebx, eax
mov dword [ebp - 8], 0
mov eax, dword [ebp + 0xc]
add esp, 4
shr ebx, 2
cmp dword [eax + 8], 0
jbe 0x1002eb55
add eax, 0x10
mov dword [ebp - 4], eax
lea ecx, [ecx]
push dword [eax - 4]
call fcn.10003ab0
sub ebx, dword [ebp + 8]
mov ecx, esi
shr ecx, 2
add esi, 0x28
mov dword [edi + ecx*4], eax
cmp ebx, 0x2000
jae 0x1002eb83
lea eax, [ebp + 8]
push eax
lea eax, [esi + edi]
push 0
cmp ebx, 0x200
jb 0x1002eb1a
push 0x200
jmp 0x1002eb1b
push ebx
push dword [ebp - 4]
push eax
call sub.HCCoreDevCfg.dll__ConvertBufToChan_20
push dword [ebp + 8]
call fcn.10003ac0
mov edx, dword [ebp - 8]
lea ecx, [esi - 0x24]
shr ecx, 2
inc edx
mov dword [ebp - 8], edx
mov dword [edi + ecx*4], eax
mov eax, dword [ebp + 8]
mov ecx, dword [ebp + 0xc]
lea esi, [esi + eax*4]
mov eax, dword [ebp - 4]
add eax, 0x844
mov dword [ebp - 4], eax
cmp edx, dword [ecx + 8]
jb 0x1002eae0
cmp byte [edi + 2], 0
jne 0x1002eb7a
movzx eax, si
mov ecx, 0xffff
cdq
idiv ecx
push edx
mov esi, eax
call fcn.10003a90
push esi
mov word [edi], ax
call fcn.10003a90
mov byte [edi + 3], al
pop esi
pop edi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
push 0x11
call sub.HCCore.dll__Core_SetLastError_4
pop esi
pop edi
or eax, 0xffffffff
pop ebx
mov esp, ebp
pop ebp
ret
push 0x11
call sub.HCCore.dll__Core_SetLastError_4
pop edi
or eax, 0xffffffff
pop ebx
mov esp, ebp
pop ebp
ret