Function at 0x10030040
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
mov ebp, esp
mov ecx, dword [ebp + 8]
push ebx
push esi
mov esi, dword [ebp + 0xc]
mov eax, dword [ecx + 0x2c]
push edi
mov edi, dword [ebp + 0x10]
cmp dword [eax], 0
jne 0x100300ce
mov ecx, dword [ecx + 8]
mov edx, dword [ebp + 0x14]
mov eax, dword [ecx + 0x28]
movsx edx, byte [eax + edx]
cmp edx, 1
jne 0x1003008a
cmp dword [ecx + 0xbc8], 0
je 0x10030077
mov edx, 8
xor ebx, ebx
cmp edx, 0x20
jge 0x1003009c
mov ecx, edx
or eax, 0xffffffff
shl eax, cl
movzx edx, ax
jmp 0x1003009e
test edx, edx
jns 0x10030077
neg edx
mov ebx, 1
lea ecx, [edx - 1]
shl ebx, cl
jmp 0x10030079
xor edx, edx
mov ecx, esi
test edi, edi
je 0x100300cb
mov esi, edi
movsx eax, word [ecx]
add eax, ebx
test edx, eax
je 0x100300bb
test eax, eax
jns 0x100300b7
xor eax, eax
jmp 0x100300bb
mov eax, edx
not eax
sub eax, ebx
mov word [ecx], ax
add ecx, 2
sub esi, 1
jne 0x100300a6
mov esi, dword [ebp + 0xc]
mov ecx, dword [ebp + 8]
mov eax, dword [ecx + 8]
mov edx, dword [ebp + 0x14]
mov eax, dword [eax + 0x28]
movsx eax, byte [eax + edx]
cdq
xor eax, edx
sub eax, edx
cmp eax, 1
je 0x10030258
cmp eax, 8
jle 0x10030258
cmp eax, 0x10
jg 0x10030159
mov eax, dword [ecx + 0x24]
mov edx, dword [eax + 0xc0]
mov ecx, dword [eax + 0x5c]
test edi, edi
je 0x10030275
cmp dword [eax + 0x58], ecx
je 0x10030140
movzx ecx, word [esi]
lea esi, [esi + 2]
lea edx, [edx + 2]
mov eax, ecx
mov dword [ebp + 8], eax
mov al, byte [ebp + 9]
mov byte [ebp + 8], al
mov byte [ebp + 9], cl
mov ax, word [ebp + 8]
mov word [edx - 2], ax
sub edi, 1
jne 0x10030110
pop edi
pop esi
xor eax, eax
pop ebx
pop ebp
ret
mov ax, word [esi]
lea edx, [edx + 2]
mov word [edx - 2], ax
lea esi, [esi + 2]
sub edi, 1
jne 0x10030140
pop edi
pop esi
xor eax, eax
pop ebx
pop ebp
ret
cmp eax, 0x20
jg 0x10030275
mov ecx, dword [ecx + 0x24]
mov eax, dword [ecx + 0x58]
mov edx, dword [ecx + 0xc0]
cmp eax, dword [ecx + 0x5c]
je 0x100301b5
test edi, edi
je 0x10030275
nop dword [eax + eax]
movsx ecx, word [esi]
lea esi, [esi + 2]
mov dword [ebp + 8], ecx
lea edx, [edx + 4]
movzx eax, byte [ebp + 0xb]
mov byte [ebp + 8], al
movzx eax, byte [ebp + 0xa]
mov byte [ebp + 0xb], cl
mov cl, byte [ebp + 9]
mov byte [ebp + 9], al
mov byte [ebp + 0xa], cl
mov eax, dword [ebp + 8]
mov dword [edx - 4], eax
sub edi, 1
jne 0x10030180
pop edi
pop esi
xor eax, eax
pop ebx
pop ebp
ret
xor ecx, ecx
test edi, edi
je 0x10030275
cmp edi, 0x10
jb 0x10030233
lea eax, [edi - 1]
lea eax, [esi + eax*2]
lea ebx, [edi - 1]
lea ebx, [edx + ebx*4]
cmp edx, eax
ja 0x100301d8
cmp ebx, esi
jae 0x10030233
mov eax, edi
and eax, 0xfffffff0
nop dword [eax]
movq xmm0, qword [esi]
add ecx, 0x10
punpcklwd xmm0, xmm0
psrad xmm0, 0x10
movups xmmword [edx], xmm0
movq xmm0, qword [esi + 8]
punpcklwd xmm0, xmm0
psrad xmm0, 0x10
movups xmmword [edx + 0x10], xmm0
movq xmm0, qword [esi + 0x10]
punpcklwd xmm0, xmm0
psrad xmm0, 0x10
movups xmmword [edx + 0x20], xmm0
movq xmm0, qword [esi + 0x18]
add esi, 0x20
punpcklwd xmm0, xmm0
psrad xmm0, 0x10
movups xmmword [edx + 0x30], xmm0
add edx, 0x40
cmp ecx, eax
jb 0x100301e0
cmp ecx, edi
jae 0x10030275
sub edi, ecx
nop dword [eax]
movsx eax, word [esi]
lea edx, [edx + 4]
mov dword [edx - 4], eax
lea esi, [esi + 2]
sub edi, 1
jne 0x10030240
pop edi
pop esi
xor eax, eax
pop ebx
pop ebp
ret
mov eax, dword [ecx + 0x24]
mov ecx, dword [eax + 0xc0]
test edi, edi
je 0x10030275
mov al, byte [esi]
lea ecx, [ecx + 1]
mov byte [ecx - 1], al
lea esi, [esi + 2]
sub edi, 1
jne 0x10030265
pop edi
pop esi
xor eax, eax
pop ebx
pop ebp
ret