Function at 0x421406
Capabilities:
Encrypt data using rc4 prga

Disassembly:
mov edi, edi
sub esp, 0x44
push ebx
push ebp
push esi
mov esi, ecx
push edi
mov edi, esi
cmp edx, 2
mov dword [esp + 0x34], edx
mov dword [esp + 0x30], edi
jae 0x42142f
pop edi
pop esi
pop ebp
mov eax, 2
pop ebx
add esp, 0x44
ret 0x10
mov al, byte [esp + 0x64]
mov ebp, dword [esp + 0x60]
dec al
mov byte [esp + 0x12], 0
mov byte [esp + 0x13], al
mov ax, word [esp + 0x12]
lea ecx, [ebp + ebp]
mov word [esi], ax
add esi, 2
sub ecx, edi
mov dword [esp + 0x14], esi
lea eax, [ecx + esi]
cmp eax, edx
jg 0x4216db
mov eax, 0x2c
test ebp, ebp
mov dword [esp + 0x3c], eax
mov dword [esp + 0x40], eax
jbe 0x4214cd
mov ecx, dword [esp + 0x58]
lea eax, [esp + 0x44]
mov edx, ebp
movsx ebx, word [ecx]
mov dword [eax], ebx
mov word [esi], bx
add ecx, 2
add esi, 2
add eax, 4
dec edx
jne 0x42147d
mov dword [esp + 0x14], esi
mov ebx, dword [esp + 0x5c]
mov dword [esp + 0x2c], ebp
mov eax, ebx
cdq
sub eax, edx
xor edx, edx
sar eax, 1
sub eax, esi
add edi, eax
test edi, edi
setl dl
dec edx
and edx, edi
lea edi, [ebp - 1]
shr ebx, 1
cmp ebp, ebx
mov dword [esp + 0x1c], edx
mov dword [esp + 0x5c], edi
mov dword [esp + 0x38], ebx
jae 0x4216d3
jmp 0x4214db
mov ecx, dword [esp + 0x58]
jmp 0x421495
mov ecx, dword [esp + 0x58]
mov ebp, dword [esp + 0x60]
mov edx, dword [esp + 0x30]
mov ebx, dword [esp + 0x34]
mov eax, esi
sub eax, edx
add eax, 2
cmp eax, ebx
jg 0x4216e5
cmp ebp, 2
jne 0x421504
xor edx, edx
test edi, edi
sete dl
mov edi, edx
mov dword [esp + 0x5c], edi
movsx eax, word [ecx]
mov esi, dword [esp + edi*4 + 0x44]
add ecx, 2
mov dword [esp + 0x58], ecx
mov dword [esp + edi*4 + 0x4c], eax
mov ecx, eax
sub eax, esi
mov edi, dword [esp + edi*4 + 0x3c]
xor ebx, ebx
cdq
xor eax, edx
sub eax, edx
mov edx, dword ds:[edi*4 + 0x44144c]
cmp ecx, esi
mov esi, dword [esp + 0x64]
setge bl
and esi, 0xff
mov ebp, edx
mov ecx, esi
dec ebx
shr ebp, cl
and ebx, 0x40
cmp eax, ebp
jae 0x42157f
test edi, edi
je 0x42156a
mov esi, dword [esp + 0x14]
lea ecx, [edi - 1]
mov edi, dword [esp + 0x5c]
mov byte [esi], 0x80
inc esi
mov dword [esp + edi*4 + 0x3c], ecx
mov dword [esp + 0x14], esi
jmp 0x4216be
mov esi, dword [esp + 0x14]
mov edi, dword [esp + 0x5c]
mov byte [esi], 0x80
inc esi
mov dword [esp + 0x14], esi
jmp 0x4216be
lea ecx, [edx + edx]
cmp eax, ecx
jbe 0x421649
mov ebp, dword [esp + 0x14]
mov edi, dword [esp + 0x5c]
mov ecx, dword [esp + edi*4 + 0x3c]
cmp ecx, 0x58
jge 0x4215d7
cmp dword [esp + 0x1c], 0
je 0x4215d7
add ecx, 8
cmp ecx, 0x58
mov dword [esp + edi*4 + 0x3c], ecx
jle 0x4215b6
mov dword [esp + edi*4 + 0x3c], 0x58
mov edx, dword [esp + edi*4 + 0x3c]
mov ecx, dword [esp + 0x1c]
inc ebp
dec ecx
mov edx, dword ds:[edx*4 + 0x44144c]
mov byte [ebp - 1], 0x81
mov dword [esp + 0x1c], ecx
lea ecx, [edx + edx]
cmp eax, ecx
ja 0x421592
mov dword [esp + 0x14], ebp
mov cl, byte [esp + 0x13]
mov ebp, edx
shr ebp, cl
lea ecx, [esi - 2]
mov esi, 1
shl esi, cl
mov dword [esp + 0x20], 0
mov dword [esp + 0x24], 0
mov dword [esp + 0x18], 1
mov dword [esp + 0x28], 0x20
cmp esi, 0x20
ja 0x421616
mov dword [esp + 0x28], esi
mov ecx, dword [esp + 0x24]
lea esi, [ecx + edx]
mov ecx, dword [esp + 0x20]
cmp esi, eax
ja 0x421631
or ecx, dword [esp + 0x18]
mov dword [esp + 0x24], esi
mov dword [esp + 0x20], ecx
mov esi, dword [esp + 0x28]
cmp dword [esp + 0x18], esi
je 0x42164f
mov ecx, dword [esp + 0x18]
shr edx, 1
shl ecx, 1
mov dword [esp + 0x18], ecx
jmp 0x421616
mov edi, dword [esp + 0x5c]
jmp 0x4215db
mov edx, dword [esp + 0x24]
mov eax, dword [esp + edi*4 + 0x44]
add edx, ebp
test ebx, ebx
je 0x42166d
sub eax, edx
cmp eax, 0xffff8000
jge 0x42167b
mov eax, 0xffff8000
jmp 0x42167b
add eax, edx
cmp eax, 0x7fff
jle 0x42167b
mov eax, 0x7fff
mov esi, dword [esp + 0x14]
mov dl, cl
or dl, bl
and ecx, 0x1f
mov dword [esp + edi*4 + 0x44], eax
mov byte [esi], dl
mov eax, dword ds:[ecx*4 + 0x4413cc]
mov ecx, dword [esp + edi*4 + 0x3c]
inc esi
add ecx, eax
mov dword [esp + 0x14], esi
mov dword [esp + edi*4 + 0x3c], ecx
mov eax, ecx
jns 0x4216b1
mov dword [esp + edi*4 + 0x3c], 0
jmp 0x4216be
cmp eax, 0x58
jle 0x4216be
mov dword [esp + edi*4 + 0x3c], 0x58
mov eax, dword [esp + 0x2c]
mov ecx, dword [esp + 0x38]
inc eax
cmp eax, ecx
mov dword [esp + 0x2c], eax
jb 0x4214d3
mov ecx, dword [esp + 0x30]
mov eax, esi
sub eax, ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x44
ret 0x10
mov eax, esi
pop edi
sub eax, edx
pop esi
pop ebp
add eax, 2
pop ebx
add esp, 0x44
ret 0x10