Function at 0x100180e0
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x30
mov eax, dword [ebp + 0x18]
push esi
mov esi, dword [eax + 4]
mov dword [ebp - 4], esi
test esi, esi
jns 0x10018118
cmp dword [eax], 0
jg 0x10018118
push dword [ebp + 0xc]
mov eax, dword [ebp + 0x14]
mov ecx, dword [ebp + 0x10]
add eax, ecx
push eax
push ecx
call fcn.10016150
mov eax, dword [ebp + 8]
add esp, 0xc
mov dword [eax], edx
pop esi
mov esp, ebp
pop ebp
ret
mov eax, dword ds:[ebp + 0x10]
lea edx, [ebp - 0x24]
mov ecx, dword [ebp + 0x14]
push ebx
push edi
add ecx, eax
mov dword [ebp - 0x30], eax
push edx
push ecx
push eax
mov dword [ebp - 8], ecx
mov dword [ebp - 0x2c], ecx
mov dword [ebp - 0x28], 0
mov dword [ebp - 0x24], 0
call fcn.100249e0
mov edx, dword [ebp - 0x30]
add esp, 0xc
xor ebx, ebx
mov dword [ebp - 0x28], eax
mov byte [ebp - 0x20], 0
cmp edx, dword [ebp - 0x2c]
je 0x10018209
nop dword [eax]
mov dword [ebp - 0xc], ebx
cmp ebx, esi
jne 0x1001816f
test esi, esi
jns 0x10018209
mov edi, dword [ebp - 0x24]
cmp edi, 0x25fd
jae 0x1001819d
mov eax, 1
mov ecx, 0x1015aa58
cmp edi, dword [ecx]
jb 0x100181d7
add ecx, 4
xor eax, 3
cmp ecx, 0x1015ad80
jne 0x10018184
mov eax, 1
jmp 0x100181d7
mov eax, 0x1015aa58
mov edx, 0xca
mov esi, edx
shr esi, 1
cmp edi, dword [eax + esi*4]
lea ecx, [eax + esi*4]
jae 0x100181b7
mov edx, esi
jmp 0x100181c1
lea eax, [ecx + 4]
or ecx, 0xffffffff
sub ecx, esi
add edx, ecx
test edx, edx
jg 0x100181a7
mov esi, dword [ebp - 4]
sub eax, 0x1015aa58
mov edx, dword [ebp - 0x30]
sar eax, 2
and eax, 1
inc eax
mov ecx, 0x7fffffff
sub ecx, eax
cmp ecx, ebx
jl 0x10018275
add ebx, eax
cmp ebx, esi
jle 0x100181f2
test esi, esi
jns 0x10018270
lea ecx, [ebp - 0x30]
call fcn.10022fe0
mov edx, dword ds:[ebp - 0x30]
cmp edx, dword [ebp - 0x2c]
jne 0x10018160
mov dword [ebp - 8], edx
mov eax, dword [ebp + 0x10]
xor esi, esi
mov ecx, dword [ebp + 0xc]
xor edi, edi
mov dword [ebp - 0x18], eax
mov eax, dword [ebp + 0x18]
mov dword [ebp - 0xc], 1
mov dword [ebp - 4], esi
mov al, byte [eax + 9]
test al, al
movzx edx, al
cmove edx, dword [ebp - 0xc]
mov dword [ebp - 0xc], edx
mov edx, dword [ebp + 0x18]
mov edx, dword [edx]
cmp ebx, edx
jge 0x10018286
mov eax, dword [ebp - 0xc]
movzx eax, al
sub eax, 1
je 0x100182f0
sub eax, 1
je 0x10018282
sub eax, 1
jne 0x10018286
mov eax, edx
sub eax, ebx
cdq
sub eax, edx
mov edi, eax
mov eax, dword [ebp + 0x18]
sar edi, 1
mov esi, dword [eax]
sub esi, edi
sub esi, ebx
mov dword [ebp - 4], esi
jmp 0x10018289
mov ebx, dword [ebp - 0xc]
jmp 0x10018209
test esi, esi
jns 0x10018209
mov ebx, 0x7fffffff
jmp 0x1001820c
mov edi, edx
sub edi, ebx
mov eax, dword [ebp + 0x18]
lea ebx, [eax + 0xf]
movzx eax, byte [eax + 0xe]
mov dword [ebp + 0x18], eax
test edi, edi
jle 0x100182b5
lea esi, [eax + ebx]
nop word [eax + eax]
push ecx
push esi
push ebx
call fcn.10016150
dec edi
add esp, 0xc
mov ecx, edx
test edi, edi
jg 0x100182a0
mov esi, dword [ebp - 4]
mov edi, dword [ebp + 0x18]
mov eax, dword [ebp - 0x18]
mov edx, dword [ebp - 8]
sub edx, eax
push ecx
add edx, eax
push edx
push eax
call fcn.10016150
add esp, 0xc
test esi, esi
jle 0x100182e4
add edi, ebx
push edx
push edi
push ebx
call fcn.10016150
dec esi
add esp, 0xc
test esi, esi
jg 0x100182d3
mov eax, dword [ebp + 8]
pop edi
pop ebx
pop esi
mov dword [eax], edx
mov esp, ebp
pop ebp
ret
mov eax, dword ds:[ebp + 0x18]
mov esi, edx
sub esi, ebx
movzx edi, byte [eax + 0xe]
lea ebx, [eax + 0xf]
jmp 0x100182b8