Function at 0x4a1c20
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
mov eax, 0x1018
call fcn.004af830
mov edx, dword [esp + 0x101c]
push ebx
push ebp
push esi
test edx, edx
push edi
je 0x4a2034
mov ecx, dword [esp + 0x1034]
test ecx, ecx
je 0x4a2034
mov eax, dword [esp + 0x1038]
test eax, eax
je 0x4a2034
mov dword [0x724eec], edx
mov dword [ecx], 0x769b78
mov ecx, dword [0x724eec]
add ecx, 4
mov dword [eax], ecx
mov ebx, dword [0x724eec]
mov edx, dword [ebx]
and edx, 0xffffff
cmp edx, 0x43504d
je 0x4a1c98
pop edi
pop esi
pop ebp
mov eax, 0xfffffffe
pop ebx
add esp, 0x1018
ret
mov eax, dword [esp + 0x1030]
test eax, eax
jne 0x4a1e48
lea edi, [esp + 0x28]
xor edx, edx
mov dword [esp + 0x18], edi
cmp edx, 0x20
mov ecx, edx
jge 0x4a1d0f
movsx esi, dl
shl esi, 7
mov al, dl
mov ebp, edi
sar esi, 7
shl al, 3
and esi, 7
and eax, 0xff
or esi, eax
movsx eax, cl
shl eax, 7
mov bl, cl
add edi, 4
sar eax, 7
shl bl, 3
and eax, 7
and ebx, 0xff
or eax, ebx
add ebp, 0x80
sub eax, esi
imul eax, eax
mov dword [edi - 4], eax
mov dword [ebp - 0x80], eax
inc ecx
cmp ecx, 0x20
jl 0x4a1cd2
mov edi, dword [esp + 0x18]
mov ebx, dword [0x724eec]
inc edx
add edi, 0x84
cmp edx, 0x20
mov dword [esp + 0x18], edi
jl 0x4a1cb1
mov eax, 0x724ef8
xor edx, edx
lea esi, [ebx + 4]
cmp eax, 0x734ff8
mov dword [esp + 0x20], edx
mov dword [esp + 0x10], eax
mov dword [esp + 0x1c], eax
mov dword [esp + 0x14], esi
jge 0x4a1dcb
mov dword [esp + 0x18], eax
mov edi, dword [esp + 0x14]
xor eax, eax
mov ax, word [esi]
xor ecx, ecx
mov cx, word [edi]
mov edi, eax
shr edi, 0xa
mov ebx, ecx
and edi, 0x1f
shr ebx, 0xa
shl edi, 5
and ebx, 0x1f
mov ebp, ecx
add edi, ebx
mov ebx, eax
shr ebx, 5
mov edi, dword [esp + edi*4 + 0x28]
and ebx, 0x1f
shr ebp, 5
shl ebx, 5
and ebp, 0x1f
and eax, 0x1f
add ebx, ebp
and ecx, 0x1f
shl eax, 5
mov ebp, dword [esp + ebx*4 + 0x28]
add eax, ecx
add edi, ebp
mov ecx, dword [esp + eax*4 + 0x28]
add edi, ecx
mov ecx, dword [esp + 0x10]
cmp edi, 0x3e8
setle al
mov byte [ecx + edx], al
mov ecx, dword [esp + 0x18]
inc edx
add esi, 2
mov byte [ecx], al
add ecx, 0x100
cmp edx, 0x100
mov dword [esp + 0x18], ecx
jl 0x4a1d48
mov eax, dword [esp + 0x1c]
mov edx, dword [esp + 0x20]
mov esi, dword [esp + 0x14]
mov edi, dword [esp + 0x10]
add eax, 0x101
inc edx
add esi, 2
add edi, 0x100
cmp eax, 0x734ff8
mov dword [esp + 0x20], edx
mov dword [esp + 0x14], esi
mov dword [esp + 0x1c], eax
mov dword [esp + 0x10], edi
jl 0x4a1d44
mov esi, 0x769abc
call fcn.004b00cb
cdq
mov ecx, 5
idiv ecx
lea edi, [edx + edx*4]
shl edi, 6
call fcn.004b00cb
cdq
mov ecx, 5
add esi, 4
idiv ecx
cmp esi, 0x769b78
lea edx, [edi + edx - 0x282]
mov dword [esi - 4], edx
jl 0x4a1e06
mov ebx, dword [0x724eec]
mov eax, dword [esp + 0x1030]
lea eax, [eax + eax*2]
xor edi, edi
lea eax, [eax + eax*4]
lea eax, [eax + eax*4]
shl eax, 7
add eax, ebx
mov dword [esp + 0x1c], eax
add eax, 0x204
mov dword [esp + 0x14], eax
mov ecx, dword [esp + 0x14]
xor esi, esi
mov dword [esp + 0x10], ecx
mov edx, dword [esp + 0x10]
mov ax, word [edx]
cmp ax, 0xfde8
jb 0x4a1eb3
and eax, 0xffff
lea edx, [edi + esi]
sub eax, 0xfde8
mov ecx, eax
shl ecx, 8
or ecx, eax
shl ecx, 8
or ecx, eax
shl ecx, 8
or eax, ecx
lea ecx, [edx*4 + 0x769b78]
mov edx, 4
mov dword [ecx], eax
add ecx, 0x140
dec edx
jne 0x4a1ea6
jmp 0x4a1eea
cmp ax, 0x34bc
jae 0x4a1c88
and eax, 0xffff
mov edx, 4
shl eax, 4
lea ecx, [eax + ebx + 0x23484]
lea eax, [edi + esi]
lea eax, [eax*4 + 0x769b78]
mov ebp, dword [ecx]
add ecx, 4
mov dword [eax], ebp
add eax, 0x140
dec edx
jne 0x4a1edb
mov ecx, dword [esp + 0x10]
inc esi
add ecx, 2
cmp esi, 0x50
mov dword [esp + 0x10], ecx
jl 0x4a1e6f
mov edx, dword [esp + 0x14]
add edi, 0x140
add edx, 0xa0
cmp edi, 0x4b00
mov dword [esp + 0x14], edx
jl 0x4a1e65
mov ecx, dword [esp + 0x1c]
mov bl, byte [0x77c778]
mov esi, 0x500
add ecx, 0x2a6
mov dword [esp + 0x20], esi
mov dword [esp + 0x18], ecx
mov edx, dword [esp + 0x18]
mov dword [esp + 0x14], 4
mov dword [esp + 0x10], edx
mov eax, dword [esp + 0x10]
mov ax, word [eax]
cmp ax, 0xfde8
jb 0x4a1fe2
add eax, 0x18
mov dword [esp + 0x1c], 4
and eax, 0xff
shl eax, 8
mov ecx, dword [esp + 0x14]
mov edi, 4
inc bl
cmp bl, 0x2f
mov byte [0x77c778], bl
jb 0x4a1f8e
xor bl, bl
mov byte [0x77c778], bl
mov edx, dword [0x77c778]
and edx, 0xff
mov edx, dword [edx*4 + 0x769abc]
add edx, esi
mov dl, byte [edx + ecx + 0x769b78]
mov byte [esp + 0x24], dl
mov ebp, dword [esp + 0x24]
and ebp, 0xff
cmp byte [eax + ebp + 0x724ef8], 0
je 0x4a1fc9
mov byte [esi + ecx + 0x769b78], dl
inc ecx
dec edi
jne 0x4a1f79
mov ecx, dword [esp + 0x1c]
add esi, 0x140
dec ecx
mov dword [esp + 0x1c], ecx
jne 0x4a1f70
mov esi, dword [esp + 0x20]
mov eax, dword [esp + 0x14]
mov edi, dword [esp + 0x10]
add eax, 4
add edi, 2
cmp eax, 0x13c
mov dword [esp + 0x10], edi
mov dword [esp + 0x14], eax
jl 0x4a1f4c
mov edx, dword [esp + 0x18]
add esi, 0x500
add edx, 0xa0
cmp esi, 0x12700
mov dword [esp + 0x18], edx
mov dword [esp + 0x20], esi
jl 0x4a1f3c
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x1018
ret
pop edi
pop esi
pop ebp
or eax, 0xffffffff
pop ebx
add esp, 0x1018
ret