Function at 0x4a9190
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
sub esp, 0xc8
mov eax, dword [0x64e2c0]
xor eax, esp
mov dword [esp + 0xc4], eax
cmp dword [esp + 0xdc], 4
mov eax, dword [esp + 0xd0]
push ebx
mov ebx, dword [esp + 0xd0]
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0xd8]
mov dword [esp + 0x30], eax
mov eax, dword [esp + 0xdc]
mov dword [esp + 0x34], eax
mov eax, dword [ebx]
push edi
mov dword [esp + 0x2c], ebx
mov dword [eax + 8], 0
ja 0x4a99ec
push ebx
call fcn.004af8f0
add esp, 4
test eax, eax
jne 0x4a921e
push eax
mov eax, dword [ebx]
push dword [eax + 8]
push ebx
call fcn.004afb40
add esp, 0xc
xor eax, eax
pop edi
pop ebx
mov ecx, dword [esp + 0xc4]
xor ecx, esp
call fcn.005b26e6
add esp, 0xc8
ret
mov ecx, dword [esp + 0xe4]
test ecx, ecx
jne 0x4a9240
mov eax, dword [ebx]
cmp dword [eax + 8], 3
setge cl
lea ecx, [ecx*2 + 1]
mov dword [esp + 0xe4], ecx
mov eax, dword [ebx]
mov eax, dword [eax + 8]
mov dword [esp + 0x1c], eax
cmp eax, 3
jne 0x4a9273
cmp dword [ebx + 0x47ec], eax
je 0x4a9268
cmp dword [ebx + 0x47e8], 0
jne 0x4a9273
cmp dword [ebx + 0x47e4], 0
jne 0x4a9273
mov edx, 1
mov dword [esp + 0x24], edx
jmp 0x4a927e
xor edx, edx
mov dword [esp + 0x24], edx
cmp eax, 3
jne 0x4a9290
cmp ecx, 3
jge 0x4a9290
test edx, edx
jne 0x4a9290
mov eax, 1
mov dword [esp + 0x1c], eax
mov dword [esp + 8], 0
push ebp
push esi
test eax, eax
jle 0x4a9370
lea edi, [esp + 0x64]
lea ebp, [ebx + 0x46a0]
nop dword [eax]
mov eax, dword [ebx]
mov eax, dword [eax]
add eax, 3
push eax
call fcn.005b7d4f
add esp, 4
mov dword [ebp + 0x34], eax
test eax, eax
je 0x4a99ce
mov eax, dword [ebx + 0x4684]
cdq
idiv dword [ebp]
mov dword [edi + 0xc], 0
mov dword [esp + 0x18], eax
mov dword [edi - 4], eax
mov eax, dword [ebx + 0x4688]
cdq
idiv dword [ebp + 4]
xor edx, edx
mov esi, eax
mov eax, dword [esp + 0x18]
mov ecx, esi
mov dword [edi], esi
sar ecx, 1
dec eax
mov dword [edi + 8], ecx
mov ecx, dword [ebx]
add eax, dword [ecx]
mov ecx, dword [esp + 0x18]
div ecx
mov dword [edi + 4], eax
mov eax, dword [ebp + 0x28]
mov dword [edi - 8], eax
mov dword [edi - 0xc], eax
cmp ecx, 1
jne 0x4a9331
cmp esi, ecx
jne 0x4a9325
mov eax, 0x4aaba0
jmp 0x4a9354
cmp esi, 2
jne 0x4a9331
mov eax, 0x4b8300
jmp 0x4a9354
cmp ecx, 2
jne 0x4a934f
cmp esi, 1
jne 0x4a9342
mov eax, 0x4b7fe0
jmp 0x4a9354
cmp esi, 2
jne 0x4a934f
mov eax, dword [ebx + 0x4814]
jmp 0x4a9354
mov eax, 0x4b7f90
mov esi, dword [esp + 0x10]
add ebp, 0x48
inc esi
mov dword [edi - 0x10], eax
add edi, 0x20
mov dword [esp + 0x10], esi
cmp esi, dword [esp + 0x24]
jl 0x4a92b0
mov eax, dword [ebx]
mov edi, dword [esp + 0xec]
mov esi, dword [eax + 4]
mov ecx, dword [eax]
test edi, edi
js 0x4a99ce
test ecx, ecx
js 0x4a99ce
je 0x4a93a0
mov eax, Ordinal_1
cdq
idiv ecx
cmp edi, eax
jg 0x4a99ce
mov ebp, ecx
imul ebp, edi
test ebp, ebp
js 0x4a99ce
test esi, esi
js 0x4a99ce
je 0x4a93c7
mov eax, Ordinal_1
cdq
idiv esi
cmp ebp, eax
jg 0x4a99ce
mov eax, ecx
imul eax, esi
imul eax, edi
cmp eax, 0x7ffffffe
jg 0x4a99ce
imul ecx, esi
imul ecx, edi
inc ecx
push ecx
call fcn.005b7d4f
mov ebp, eax
add esp, 4
mov eax, dword [ebx]
test ebp, ebp
je 0x4a99d0
xor ecx, ecx
mov dword [esp + 0x10], ecx
cmp dword [eax + 4], ecx
jbe 0x4a9974
mov edx, dword [esp + 0xec]
mov dword [esp + 0x18], ebp
mov esi, dword [eax]
imul esi, ecx
mov dword [esp + 0x1c], 0
imul esi, edx
add esi, ebp
cmp dword [esp + 0x24], 0
mov dword [esp + 0x14], esi
jle 0x4a94ea
mov esi, dword [esp + 0x24]
lea ebp, [ebx + 0x46bc]
mov ebx, dword [esp + 0x18]
lea edi, [esp + 0x6c]
mov eax, dword [edi - 8]
lea ecx, [edi - 0x10]
sar eax, 1
lea edx, [edi - 0x14]
mov dword [esp + 0x28], ecx
mov dword [esp + 0x30], edx
cmp dword [edi], eax
jl 0x4a9464
mov eax, dword [edx]
mov edx, ecx
mov dword [esp + 0x18], ecx
jmp 0x4a9474
mov eax, ecx
mov dword [esp + 0x30], edx
mov dword [esp + 0x18], eax
mov dword [esp + 0x28], eax
mov eax, dword [ecx]
push dword [edi - 0xc]
push dword [edi - 4]
push eax
push dword [edx]
push dword [ebp + 0x18]
call dword [edi - 0x18]
mov ecx, dword [esp + 0x30]
add esp, 0x14
mov dword [esp + ecx*4 + 0x44], eax
mov eax, dword [edi]
inc eax
mov dword [edi], eax
cmp eax, dword [edi - 8]
jl 0x4a94c0
mov edx, dword [esp + 0x18]
mov eax, dword [esp + 0x30]
inc dword [edi + 4]
mov dword [edi], 0
mov edx, dword [edx]
mov dword [eax], edx
mov eax, dword [edi + 4]
cmp eax, dword [ebp]
jge 0x4a94c0
mov eax, dword [ebp + 4]
add eax, edx
mov edx, dword [esp + 0x28]
mov dword [edx], eax
inc ecx
add edi, 0x20
add ebp, 0x48
mov dword [esp + 0x1c], ecx
cmp ecx, esi
jl 0x4a9443
mov esi, dword [esp + 0x14]
mov edx, dword [esp + 0xec]
mov ecx, dword [esp + 0x10]
mov dword [esp + 0x18], ebx
mov ebx, dword [esp + 0x34]
mov eax, dword [ebx]
cmp edx, 3
jl 0x4a9711
mov ecx, dword [eax + 8]
cmp ecx, 3
jne 0x4a9573
cmp dword [esp + 0x2c], 0
je 0x4a9553
xor edi, edi
cmp dword [eax], edi
jbe 0x4a995c
mov ecx, dword [esp + 0x48]
add esi, 2
mov ebp, dword [esp + 0x44]
mov eax, dword [esp + 0x4c]
sub ebp, ecx
sub eax, ecx
mov dword [esp + 0x14], eax
movzx eax, byte [ecx + ebp]
lea ecx, [ecx + 1]
mov byte [esi - 2], al
inc edi
movzx eax, byte [ecx - 1]
mov byte [esi - 1], al
mov eax, dword [esp + 0x14]
movzx eax, byte [eax + ecx - 1]
mov byte [esi], al
mov byte [esi + 1], 0xff
add esi, edx
mov eax, dword [ebx]
cmp edi, dword [eax]
jb 0x4a9525
jmp 0x4a995c
push edx
push dword [eax]
mov eax, dword [ebx + 0x4810]
push dword [esp + 0x54]
push dword [esp + 0x54]
push dword [esp + 0x54]
push esi
call eax
add esp, 0x18
jmp 0x4a9955
cmp ecx, 4
jne 0x4a96df
mov ecx, dword [ebx + 0x47e8]
test ecx, ecx
jne 0x4a9632
xor ebp, ebp
cmp dword [eax], ebp
jbe 0x4a995c
mov ecx, dword [esp + 0x48]
lea edi, [esi + 2]
mov esi, dword [esp + 0x50]
sub ecx, esi
mov eax, dword [esp + 0x44]
mov dword [esp + 0x14], ecx
sub eax, esi
mov ecx, dword [esp + 0x4c]
sub ecx, esi
mov dword [esp + 0x1c], eax
mov dword [esp + 0x20], ecx
nop dword [eax]
movzx ecx, byte [eax + esi]
lea esi, [esi + 1]
movzx edx, byte [esi - 1]
inc ebp
imul ecx, edx
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
shr eax, 8
mov byte [edi - 2], al
mov eax, dword [esp + 0x14]
movzx ecx, byte [eax + esi - 1]
imul ecx, edx
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
shr eax, 8
mov byte [edi - 1], al
mov eax, dword [esp + 0x20]
movzx ecx, byte [eax + esi - 1]
imul ecx, edx
mov edx, dword [esp + 0xec]
mov byte [edi + 1], 0xff
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
shr eax, 8
mov byte [edi], al
add edi, edx
mov eax, dword [ebx]
cmp ebp, dword [eax]
mov eax, dword [esp + 0x1c]
jb 0x4a95c0
jmp 0x4a995c
mov eax, dword [eax]
mov edi, dword [ebx + 0x4810]
push edx
push eax
push dword [esp + 0x54]
push dword [esp + 0x54]
push dword [esp + 0x54]
push esi
cmp ecx, 2
jne 0x4a96d5
call edi
mov eax, dword [ebx]
xor edi, edi
add esp, 0x18
cmp dword [eax], edi
jbe 0x4a9955
add esi, 2
mov eax, dword [esp + 0x50]
movzx edx, byte [eax + edi]
inc edi
movzx eax, byte [esi - 2]
not al
movzx ecx, al
imul ecx, edx
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
shr eax, 8
mov byte [esi - 2], al
movzx eax, byte [esi - 1]
not al
movzx ecx, al
imul ecx, edx
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
shr eax, 8
mov byte [esi - 1], al
movzx eax, byte [esi]
not al
movzx ecx, al
imul ecx, edx
mov edx, dword [esp + 0xec]
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
shr eax, 8
mov byte [esi], al
add esi, edx
mov eax, dword [ebx]
cmp edi, dword [eax]
jb 0x4a9666
jmp 0x4a995c
call edi
add esp, 0x18
jmp 0x4a9955
xor ecx, ecx
cmp dword [eax], ecx
jbe 0x4a995c
inc esi
nop word [eax + eax]
mov eax, dword [esp + 0x44]
mov al, byte [eax + ecx]
inc ecx
mov byte [esi + 1], al
mov byte [esi], al
mov byte [esi - 1], al
mov byte [esi + 2], 0xff
add esi, edx
mov eax, dword [ebx]
cmp ecx, dword [eax]
jb 0x4a96f0
jmp 0x4a995c
cmp dword [esp + 0x2c], 0
je 0x4a97dd
mov eax, dword [eax]
xor edi, edi
cmp edx, 1
jne 0x4a977a
test eax, eax
je 0x4a9960
mov edx, dword [esp + 0x44]
mov eax, dword [esp + 0x4c]
mov ebp, dword [esp + 0x48]
sub eax, edx
sub ebp, edx
mov dword [esp + 0x14], eax
sub esi, edx
movzx eax, byte [edx + ebp]
lea edx, [edx + 1]
imul ecx, eax, 0x96
inc edi
mov eax, dword [esp + 0x14]
movzx eax, byte [eax + edx - 1]
imul eax, eax, 0x1d
add ecx, eax
movzx eax, byte [edx - 1]
imul eax, eax, 0x4d
add ecx, eax
shr ecx, 8
mov byte [esi + edx - 1], cl
mov eax, dword [ebx]
cmp edi, dword [eax]
jb 0x4a9743
jmp 0x4a9955
test eax, eax
je 0x4a9960
mov edx, dword [esp + 0x44]
mov ebp, dword [esp + 0x48]
mov eax, dword [esp + 0x4c]
sub ebp, edx
sub eax, edx
mov dword [esp + 0x14], eax
nop word [eax + eax]
movzx eax, byte [edx + ebp]
lea edx, [edx + 1]
imul ecx, eax, 0x96
lea esi, [esi + 2]
mov eax, dword [esp + 0x14]
inc edi
movzx eax, byte [eax + edx - 1]
imul eax, eax, 0x1d
add ecx, eax
movzx eax, byte [edx - 1]
imul eax, eax, 0x4d
mov byte [esi - 1], 0xff
add ecx, eax
shr ecx, 8
mov byte [esi - 2], cl
mov eax, dword [ebx]
cmp edi, dword [eax]
jb 0x4a97a0
jmp 0x4a9955
cmp dword [eax + 8], 4
jne 0x4a9914
mov ecx, dword [ebx + 0x47e8]
test ecx, ecx
jne 0x4a98b7
mov dword [esp + 0x1c], ecx
cmp dword [eax], ecx
jbe 0x4a995c
mov ebp, dword [esp + 0x50]
mov eax, dword [esp + 0x48]
mov ecx, dword [esp + 0x44]
sub eax, ebp
mov dword [esp + 0x14], eax
sub ecx, ebp
mov eax, dword [esp + 0x4c]
sub eax, ebp
mov dword [esp + 0x28], ecx
mov dword [esp + 0x20], eax
movzx edi, byte [ecx + ebp]
lea ebp, [ebp + 1]
movzx eax, byte [ebp - 1]
mov ecx, dword [esp + 0x14]
mov edx, dword [esp + 0x20]
imul edi, eax
movzx ecx, byte [ecx + ebp - 1]
movzx edx, byte [edx + ebp - 1]
imul ecx, eax
imul edx, eax
sub edi, 0xffffff80
mov byte [esi + 1], 0xff
sub ecx, 0xffffff80
mov eax, ecx
sub edx, 0xffffff80
shr eax, 8
add eax, ecx
shr eax, 8
movzx eax, al
imul ecx, eax, 0x96
mov eax, edx
shr eax, 8
add eax, edx
mov edx, dword [esp + 0xec]
shr eax, 8
movzx eax, al
imul eax, eax, 0x1d
add ecx, eax
mov eax, edi
shr eax, 8
add eax, edi
shr eax, 8
movzx eax, al
imul eax, eax, 0x4d
add ecx, eax
shr ecx, 8
mov byte [esi], cl
add esi, edx
mov ecx, dword [esp + 0x1c]
mov eax, dword [ebx]
inc ecx
mov dword [esp + 0x1c], ecx
cmp ecx, dword [eax]
mov ecx, dword [esp + 0x28]
jb 0x4a9823
jmp 0x4a995c
cmp ecx, 2
jne 0x4a9914
xor ebp, ebp
cmp dword [eax], ebp
jbe 0x4a995c
mov eax, dword [esp + 0x44]
mov edx, dword [esp + 0x50]
sub eax, edx
mov edi, dword [esp + 0xec]
mov dword [esp + 0x14], eax
nop dword [eax + eax]
mov al, byte [edx + eax]
lea edx, [edx + 1]
not al
inc ebp
movzx ecx, al
movzx eax, byte [edx - 1]
imul ecx, eax
mov byte [esi + 1], 0xff
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
shr eax, 8
mov byte [esi], al
add esi, edi
mov eax, dword [ebx]
cmp ebp, dword [eax]
mov eax, dword [esp + 0x14]
jb 0x4a98e0
jmp 0x4a9955
mov eax, dword [eax]
xor ecx, ecx
cmp edx, 1
jne 0x4a9939
test eax, eax
je 0x4a995c
mov edi, dword [esp + 0x44]
sub edi, esi
mov al, byte [edi + esi]
lea esi, [esi + 1]
mov byte [esi - 1], al
inc ecx
mov eax, dword [ebx]
cmp ecx, dword [eax]
jb 0x4a9927
jmp 0x4a995c
test eax, eax
je 0x4a995c
mov edx, dword [esp + 0x44]
mov al, byte [edx + ecx]
lea esi, [esi + 2]
mov byte [esi - 2], al
inc ecx
mov byte [esi - 1], 0xff
mov eax, dword [ebx]
cmp ecx, dword [eax]
jb 0x4a9941
mov edx, dword [esp + 0xec]
mov ecx, dword [esp + 0x10]
mov eax, dword [ebx]
inc ecx
mov ebp, dword [esp + 0x18]
mov dword [esp + 0x10], ecx
cmp ecx, dword [eax + 4]
jb 0x4a9410
push 0
push dword [eax + 8]
push ebx
call fcn.004afb40
mov eax, dword [ebx]
add esp, 0xc
mov ecx, dword [esp + 0x38]
mov eax, dword [eax]
mov dword [ecx], eax
mov eax, dword [ebx]
mov ecx, dword [esp + 0x3c]
mov eax, dword [eax + 4]
mov dword [ecx], eax
mov eax, dword [esp + 0x40]
test eax, eax
je 0x4a99b3
mov ecx, dword [ebx]
xor edx, edx
cmp dword [ecx + 8], 3
setge dl
lea edx, [edx*2 + 1]
mov dword [eax], edx
mov eax, ebp
pop esi
pop ebp
pop edi
pop ebx
mov ecx, dword [esp + 0xc4]
xor ecx, esp
call fcn.005b26e6
add esp, 0xc8
ret
mov eax, dword [ebx]
push 0
push dword [eax + 8]
push ebx
call fcn.004afb40
add esp, 0xc
mov dword [0x655470], 0x5fa7ac
xor eax, eax
jmp 0x4a99b5
mov ecx, dword [esp + 0xcc]
xor eax, eax
pop edi
pop ebx
xor ecx, esp
mov dword [0x655470], 0x5fa95c
call fcn.005b26e6
add esp, 0xc8
ret