Function at 0x4a4574
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffffff4
mov eax, dword [ebp + 8]
cmp byte [eax + 0x1c], 1
jne 0x4a4835
mov eax, dword [0x52db98]
movzx eax, byte [eax]
call sub.Vcl40.bpl__System__RandInt_qqrv
mov byte [ebp - 3], al
xor eax, eax
mov al, byte [ebp - 3]
mov edx, dword [0x52d7d8]
mov edx, dword [edx]
mov al, byte [edx + eax + 1]
mov edx, dword [ebp + 8]
mov byte [edx - 0xbf], al
mov eax, 6
call sub.Vcl40.bpl__System__RandInt_qqrv
mov edx, dword [ebp + 8]
mov byte [edx - 0x45], al
mov eax, dword [ebp + 8]
movzx eax, byte [eax - 0x45]
lea eax, [eax + eax*2]
mov edx, dword [0x52d7dc]
cmp byte [edx + eax*4], 0
je 0x4a45b1
mov eax, dword [ebp + 8]
mov al, byte [eax - 0x45]
mov byte [ebp - 1], al
mov eax, 0xc
call sub.Vcl40.bpl__System__RandInt_qqrv
mov edx, dword [ebp + 8]
mov byte [edx - 0x46], al
mov eax, dword [ebp + 8]
mov word [eax - 0xbe], 0
mov eax, dword [ebp + 8]
cmp byte [eax - 0x45], 0
jne 0x4a4611
mov eax, dword [ebp + 8]
mov byte [eax - 0xc0], 5
jmp 0x4a4621
mov eax, dword [ebp + 8]
mov al, byte [eax - 0x45]
dec eax
mov edx, dword [ebp + 8]
mov byte [edx - 0xc0], al
mov eax, dword [ebp + 8]
cmp byte [eax - 0x46], 0
jne 0x4a4636
mov eax, dword [ebp + 8]
mov byte [eax - 0xc1], 0xb
jmp 0x4a4646
mov eax, dword [ebp + 8]
mov al, byte [eax - 0x46]
dec eax
mov edx, dword [ebp + 8]
mov byte [edx - 0xc1], al
mov eax, dword [ebp + 8]
mov al, byte [eax - 0x46]
mov byte [ebp - 2], al
mov eax, dword [ebp + 8]
movzx eax, byte [eax - 0x45]
lea eax, [eax + eax*2]
mov edx, dword [0x52d7dc]
mov ecx, dword [ebp + 8]
mov cl, byte [ecx - 0x46]
cmp cl, 0xf
ja 0x4a4672
and ecx, 0x7f
bt dword [edx + eax*4 + 5], ecx
jae 0x4a46f8
mov eax, dword [ebp + 8]
movzx eax, byte [eax - 0xbf]
shl eax, 4
lea eax, [eax + eax*8]
mov edx, dword [0x52d900]
mov edx, dword [edx]
lea eax, [edx + eax*8]
mov edx, dword [ebp + 8]
movzx edx, byte [edx - 0x45]
add edx, edx
lea edx, [edx + edx*8]
lea eax, [eax + edx*8]
mov edx, dword [ebp + 8]
movzx edx, byte [edx - 0x46]
lea edx, [edx + edx*2]
cmp word [eax + edx*4 + 4], 0
jg 0x4a46f8
push ebp
call fcn.004a44f8
pop ecx
test al, al
je 0x4a46f8
mov eax, dword [ebp + 8]
mov al, byte [eax - 0x46]
push eax
mov eax, dword [ebp + 8]
mov eax, dword [eax - 0x14]
push eax
push 0xffffffffffffffff
mov eax, dword [ebp + 8]
mov cl, byte [eax - 0x45]
mov eax, dword [ebp + 8]
mov dl, byte [eax - 0xbf]
mov ax, 2
call fcn.0041bc00
mov eax, dword [ebp + 8]
mov word [eax - 0xbe], 0xffff
jmp 0x4a480a
mov eax, dword [ebp + 8]
inc word [eax - 0xbe]
mov eax, dword [ebp + 8]
mov al, byte [eax - 0x46]
mov edx, dword [ebp + 8]
cmp al, byte [edx - 0xc1]
je 0x4a4749
mov eax, dword [ebp + 8]
movzx eax, byte [eax - 0x45]
lea eax, [eax + eax*2]
mov edx, dword [0x52d7dc]
lea eax, [edx + eax*4]
mov dword [ebp - 8], eax
mov eax, dword [ebp + 8]
cmp byte [eax - 0x46], 0xb
jae 0x4a473d
mov eax, dword [ebp + 8]
inc byte [eax - 0x46]
jmp 0x4a480a
mov eax, dword [ebp + 8]
mov byte [eax - 0x46], 0
jmp 0x4a480a
mov eax, dword [ebp + 8]
mov al, byte [eax - 0x45]
mov edx, dword [ebp + 8]
cmp al, byte [edx - 0xc0]
je 0x4a47c2
mov eax, dword [ebp + 8]
cmp byte [eax - 0x45], 5
jae 0x4a476b
mov eax, dword [ebp + 8]
inc byte [eax - 0x45]
jmp 0x4a4772
mov eax, dword [ebp + 8]
mov byte [eax - 0x45], 0
mov eax, dword [ebp + 8]
movzx eax, byte [eax - 0x45]
lea eax, [eax + eax*2]
mov edx, dword [0x52d7dc]
cmp byte [edx + eax*4], 0
jne 0x4a4799
mov eax, dword [ebp + 8]
mov al, byte [eax - 0x45]
mov edx, dword [ebp + 8]
cmp al, byte [edx - 0xc0]
jne 0x4a475a
mov eax, dword [ebp + 8]
movzx eax, byte [eax - 0x45]
lea eax, [eax + eax*2]
mov edx, dword [0x52d7dc]
lea eax, [edx + eax*4]
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0xc]
cmp byte [eax], 0
je 0x4a480a
mov eax, dword [ebp + 8]
mov dl, byte [ebp - 2]
mov byte [eax - 0x46], dl
jmp 0x4a480a
mov eax, dword [ebp + 8]
movzx eax, byte [eax - 0xbf]
inc eax
mov ecx, 0x83
xor edx, edx
div ecx
mov eax, dword [ebp + 8]
mov byte [eax - 0xbf], dl
mov eax, dword [ebp + 8]
mov al, byte [eax - 0xbf]
mov edx, dword [0x52dbbc]
and eax, 0xff
bt dword [edx], eax
jae 0x4a47c2
mov eax, dword [ebp + 8]
mov dl, byte [ebp - 1]
mov byte [eax - 0x45], dl
mov eax, dword [ebp + 8]
mov dl, byte [ebp - 2]
mov byte [eax - 0x46], dl
mov eax, dword [ebp + 8]
movzx eax, word [eax - 0xbe]
mov edx, dword [0x52db98]
movzx edx, byte [edx]
add edx, edx
lea edx, [edx + edx*2]
shl edx, 2
lea edx, [edx + edx*2]
cmp eax, edx
jbe 0x4a464f
jmp 0x4a4920
mov eax, dword [0x52d7b0]
mov al, byte [eax]
mov edx, dword [ebp + 8]
mov byte [edx - 0xbf], al
mov eax, dword [0x52db68]
mov al, byte [eax]
mov edx, dword [ebp + 8]
mov byte [edx - 0x45], al
mov eax, dword [0x52d778]
mov al, byte [eax]
mov edx, dword [ebp + 8]
mov byte [edx - 0x46], al
mov eax, dword [ebp + 8]
mov al, byte [eax - 0xbf]
mov edx, dword [0x52dbbc]
and eax, 0xff
bt dword [edx], eax
jae 0x4a4920
mov eax, dword [ebp + 8]
movzx eax, byte [eax - 0x45]
lea eax, [eax + eax*2]
mov edx, dword [0x52d7dc]
mov ecx, dword [ebp + 8]
mov cl, byte [ecx - 0x46]
cmp cl, 0xf
ja 0x4a489f
and ecx, 0x7f
bt dword [edx + eax*4 + 5], ecx
jae 0x4a4920
mov eax, dword [ebp + 8]
movzx eax, byte [eax - 0xbf]
shl eax, 4
lea eax, [eax + eax*8]
mov edx, dword [0x52d900]
mov edx, dword [edx]
lea eax, [edx + eax*8]
mov edx, dword [ebp + 8]
movzx edx, byte [edx - 0x45]
add edx, edx
lea edx, [edx + edx*8]
lea eax, [eax + edx*8]
mov edx, dword [ebp + 8]
movzx edx, byte [edx - 0x46]
lea edx, [edx + edx*2]
cmp word [eax + edx*4 + 4], 0
jg 0x4a4920
push ebp
call fcn.004a44f8
pop ecx
test al, al
je 0x4a4920
mov eax, dword [ebp + 8]
mov al, byte [eax - 0x46]
push eax
mov eax, dword [ebp + 8]
mov eax, dword [eax - 0x14]
push eax
push 0xffffffffffffffff
mov eax, dword [ebp + 8]
mov cl, byte [eax - 0x45]
mov eax, dword [ebp + 8]
mov dl, byte [eax - 0xbf]
mov ax, 2
call fcn.0041bc00
mov eax, dword [ebp + 8]
movzx eax, byte [eax - 0x45]
mov edx, dword [ebp + 8]
mov dword [edx - 0xc8], eax
mov esp, ebp
pop ebp
ret