Function at 0x645d63
Capabilities:
Encrypt data using rc4 prga

Disassembly:
sub esp, 0x30
mov edx, dword [esp + 0x3c]
mov eax, dword [esp + 0x44]
mov ecx, dword [esp + 0x40]
push ebx
push ebp
lea eax, [eax + edx*2]
add eax, 2
mov dword [esp + 0x1c], eax
lea eax, [edx + 1]
mov dword [esp + 0x10], eax
xor eax, eax
push esi
push edi
xor edi, edi
xor esi, esi
lea ebp, [eax + 1]
shl ebp, cl
mov dword [esp + 0x10], ebp
lea edx, [edi + ecx]
xor ecx, ecx
lea eax, [ebp - 1]
mov ebp, dword [esp + 0x4c]
mov dword [esp + 0x14], eax
mov ebx, eax
xor eax, eax
bts eax, edx
cmp edx, 0x20
cmovae ecx, eax
xor eax, ecx
cmp edx, 0x40
lea edx, [ebp*2 + 2]
mov ebp, dword [esp + 0x10]
cmovae ecx, eax
add edx, eax
adc esi, ecx
add edx, 8
adc esi, edi
cmp esi, edi
ja 0x646077
jb 0x645de3
cmp edx, dword [esp + 0x58]
ja 0x646077
cmp dword [esp + 0x4c], 0xff
ja 0x646077
mov eax, dword [esp + 0x50]
cmp eax, 0xc
jbe 0x645e01
push 0xffffffffffffffd4
jmp 0x646079
mov esi, dword [esp + 0x4c]
lea ecx, [eax - 1]
xor edx, edx
mov word [esp + 0x58], ax
inc edx
mov eax, edx
mov word [esp + 0x5a], dx
shl ax, cl
mov edx, edi
movzx eax, ax
mov dword [esp + 0x20], eax
add esi, 1
je 0x645e85
mov ebp, dword [esp + 0x44]
mov edi, dword [esp + 0x48]
add ebp, 6
mov eax, dword [esp + 0x54]
sub edi, eax
lea ebp, [ebp + ebx*4]
movzx ecx, word [eax + edi]
mov esi, ecx
mov dword [esp + 0x1c], esi
or esi, 0xffffffff
cmp cx, si
jne 0x645e5b
mov byte [ebp], dl
xor ecx, ecx
dec ebx
sub ebp, 4
inc ecx
jmp 0x645e70
cmp cx, word [esp + 0x20]
jl 0x645e69
xor ecx, ecx
mov word [esp + 0x5a], cx
mov ecx, dword [esp + 0x1c]
movzx ecx, cx
mov esi, dword [esp + 0x18]
inc edx
mov word [eax], cx
add eax, 2
cmp edx, esi
jb 0x645e3d
mov ebp, dword [esp + 0x10]
xor edi, edi
push 4
lea eax, [esp + 0x5c]
push eax
push dword [esp + 0x4c]
call fcn.0064a810
mov ecx, ebp
mov eax, ebp
shr ecx, 3
add esp, 0xc
add ecx, 3
shr eax, 1
add eax, ecx
lea ecx, [ebp - 1]
mov dword [esp + 0x58], eax
cmp ebx, ecx
jne 0x645fd8
mov ecx, dword [esp + 0x4c]
mov eax, edi
mov dword [esp + 0x1c], eax
xorps xmm0, xmm0
movlpd qword [esp + 0x28], xmm0
mov esi, edi
mov dword [esp + 0x20], edi
add ecx, 1
je 0x645f70
mov ebx, dword [esp + 0x2c]
mov ebp, dword [esp + 0x28]
mov ecx, dword [esp + 0x48]
add eax, dword [esp + 0x24]
push 8
mov dword [esp + 0x34], ebp
movsx ecx, word [ecx + esi*2]
mov dword [esp + 0x1c], ecx
lea ecx, [esp + 0x34]
push ecx
push eax
mov dword [esp + 0x40], ebx
mov dword [esp + 0x34], eax
call fcn.0064a810
mov ecx, dword [esp + 0x24]
add esp, 0xc
push 8
pop edi
cmp ecx, edi
jle 0x645f45
mov esi, ecx
push 8
lea eax, [esp + 0x3c]
mov dword [esp + 0x3c], ebp
push eax
mov eax, dword [esp + 0x30]
add eax, edi
mov dword [esp + 0x44], ebx
push eax
call fcn.0064a810
add edi, 8
add esp, 0xc
cmp edi, esi
jl 0x645f18
mov esi, dword [esp + 0x20]
mov ecx, dword [esp + 0x18]
mov eax, dword [esp + 0x1c]
add eax, ecx
mov ecx, 0x1010101
inc esi
mov dword [esp + 0x1c], eax
add ebp, ecx
mov dword [esp + 0x20], esi
adc ebx, ecx
mov ecx, dword [esp + 0x4c]
inc ecx
cmp esi, ecx
jb 0x645edf
mov ebp, dword [esp + 0x10]
xor edi, edi
mov dword [esp + 0x4c], edi
mov esi, edi
mov dword [esp + 0x20], esi
mov edx, edi
test ebp, ebp
je 0x646073
mov eax, dword [esp + 0x24]
mov ebp, edx
mov edx, dword [esp + 0x14]
add eax, esi
mov ebx, edi
mov dword [esp + 0x28], eax
mov esi, eax
mov edi, dword [esp + 0x44]
mov ecx, ebp
mov al, byte [ebx + esi]
and ecx, edx
inc ebx
mov byte [edi + ecx*4 + 6], al
mov edi, dword [esp + 0x58]
add ebp, edi
cmp ebx, 2
jb 0x645f98
mov edx, dword [esp + 0x4c]
mov esi, dword [esp + 0x20]
add esi, 2
push 0
lea edx, [edx + edi*2]
mov dword [esp + 0x24], esi
and edx, dword [esp + 0x18]
mov dword [esp + 0x50], edx
pop edi
cmp esi, dword [esp + 0x10]
jb 0x645f84
jmp 0x646031
mov ecx, edi
mov edx, edi
test esi, esi
je 0x64602d
mov ebp, dword [esp + 0x48]
xor eax, eax
mov esi, edi
cmp ax, word [ebp]
mov eax, dword [esp + 0x58]
jge 0x646013
mov edi, dword [esp + 0x44]
mov byte [edi + ecx*4 + 6], dl
add ecx, eax
and ecx, dword [esp + 0x14]
cmp ecx, ebx
ja 0x645ffa
movsx eax, word [ebp]
inc esi
cmp esi, eax
mov eax, dword [esp + 0x58]
jl 0x645ff6
xor edi, edi
mov esi, dword [esp + 0x4c]
inc edx
inc esi
add ebp, 2
cmp edx, esi
jb 0x645fe4
mov ebp, dword [esp + 0x10]
test ecx, ecx
je 0x64602d
or eax, 0xffffffff
jmp 0x64607a
test ebp, ebp
je 0x646073
mov ebx, dword [esp + 0x44]
add ebx, 7
movzx edx, byte [ebx - 1]
mov eax, dword [esp + 0x54]
mov ebp, dword [esp + 0x54]
movzx esi, word [eax + edx*2]
mov ecx, esi
lea eax, [esi + 1]
mov word [ebp + edx*2], ax
mov ebp, dword [esp + 0x10]
bsr eax, ecx
mov cl, byte [esp + 0x50]
sub cl, al
shl si, cl
sub si, bp
mov byte [ebx], cl
inc edi
mov word [ebx - 3], si
lea ebx, [ebx + 4]
cmp edi, ebp
jb 0x646038
xor eax, eax
jmp 0x64607a
push 0xffffffffffffffd2
pop eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x30
ret