Function at 0x4c1f19
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
mov eax, 0x5b461c
call fcn.00576dcc
sub esp, 0x588
mov eax, dword [ebp + 0x18]
xor edx, edx
mov dword [ebp - 0x20], ecx
mov dword [ecx], edx
mov ecx, eax
push ebx
and ecx, 2
push esi
cmp cl, 2
mov esi, dword [ebp + 8]
sete byte [ebp - 0x4c]
xor ebx, ebx
or dword [ebp - 0x74], 0xffffffff
inc ebx
push edi
and al, bl
mov edi, 0x100
mov byte [ebp + 0x1b], al
lea eax, [ebp - 0x1c]
push eax
push edi
push esi
mov dword [ebp - 0x14], edx
mov dword [ebp - 0x1c], edx
mov dword [ebp - 0x44], ebx
mov dword [ebp - 0x78], ebx
mov dword [ebp - 0x34], edx
mov dword [ebp - 0x3e], edx
call fcn.004d7bd7
lea eax, [ebp - 0x14]
push eax
push 0x101
push esi
call fcn.004d7bd7
lea eax, [ebp - 0x78]
push eax
push 0x115
push esi
call fcn.004d7bd7
lea eax, [ebp - 0x44]
push eax
push 0x102
push esi
call fcn.004d7bd7
lea eax, [ebp - 0x74]
push eax
push 0x116
push esi
call fcn.004d7bd7
lea eax, [ebp - 0x34]
push eax
push 0x106
push esi
call fcn.004d7bd7
add esp, 0x48
lea eax, [ebp - 0x3e]
push eax
push 0x112
push esi
call fcn.004d7bd7
mov eax, dword [ebp - 0x34]
add esp, 0xc
cmp word [ebp - 0x44], 8
jb 0x4c1fe7
cmp ax, 2
je 0x4c2854
cmp ax, 6
je 0x4c2854
cmp ax, 5
je 0x4c2854
cmp ax, 0x804d
je 0x4c2854
or dword [ebp - 0x7c], 0xffffffff
and byte [ebp - 0x3f], 0
cmp byte [ebp + 0x1b], 0
mov byte [ebp - 0x39], 1
je 0x4c201a
mov dword [ebp - 0x3e], ebx
lea eax, [ebp - 0x7c]
mov ecx, dword [ebp - 0x20]
push eax
lea eax, [ebp - 0x3f]
push eax
lea eax, [ebp - 0x39]
push eax
movzx eax, word [ebp - 0x3e]
push eax
call fcn.004c28a3
push 0x400
lea eax, [ebp - 0x488]
push 0
push eax
call fcn.005771b0
movzx eax, word [ebp - 0x34]
add esp, 0xc
test eax, eax
jl 0x4c2215
cmp eax, ebx
jle 0x4c2197
cmp eax, 3
jne 0x4c2215
xor eax, eax
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x48], eax
mov dword [ebp - 0x24], eax
lea eax, [ebp - 0x24]
push eax
lea eax, [ebp - 0x48]
push eax
lea eax, [ebp - 0x18]
push eax
push 0x140
push esi
call fcn.004d7bd7
add esp, 0x14
cmp dword [ebp - 0x18], 0
je 0x4c2189
mov edx, dword [ebp - 0x48]
test edx, edx
je 0x4c2189
cmp dword [ebp - 0x24], 0
je 0x4c2189
mov cl, byte [ebp - 0x44]
and dword [ebp - 0x28], 0
mov dword [ebp + 0x18], ebx
shl dword [ebp + 0x18], cl
mov ecx, dword [ebp + 0x18]
test ecx, ecx
jle 0x4c20f4
mov esi, dword [ebp - 0x18]
lea eax, [edx + ecx*2]
sub esi, edx
mov dword [ebp - 0x68], esi
mov esi, dword [ebp - 0x24]
sub esi, edx
mov dword [ebp - 0x10], esi
mov esi, dword [ebp - 0x68]
dec ecx
dec eax
dec eax
cmp word [esi + eax], di
jae 0x4c20f1
cmp word [eax], di
jae 0x4c20f1
mov esi, dword [ebp - 0x10]
cmp word [esi + eax], di
jae 0x4c20f1
test ecx, ecx
jg 0x4c20d1
jmp 0x4c20f4
mov dword [ebp - 0x28], ebx
mov eax, dword [ebp + 0x18]
lea esi, [eax - 1]
test esi, esi
jl 0x4c2215
mov edi, dword [ebp - 0x18]
mov eax, dword [ebp - 0x24]
sub edi, edx
sub eax, edx
lea ecx, [edx + esi*2]
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x28], 0
je 0x4c2160
movzx eax, word [ecx + edi]
imul eax, eax, 0xff
cdq
mov ebx, 0xffff
idiv ebx
mov byte [ebp + esi*4 - 0x486], al
movzx eax, word [ecx]
imul eax, eax, 0xff
cdq
idiv ebx
mov byte [ebp + esi*4 - 0x487], al
mov eax, dword [ebp - 0x10]
movzx eax, word [ecx + eax]
imul eax, eax, 0xff
cdq
idiv ebx
mov byte [ebp + esi*4 - 0x488], al
mov eax, dword [ebp - 0x10]
jmp 0x4c217d
mov dl, byte [ecx + edi]
mov byte [ebp + esi*4 - 0x486], dl
mov dl, byte [ecx]
mov byte [ebp + esi*4 - 0x487], dl
mov dl, byte [ecx + eax]
mov byte [ebp + esi*4 - 0x488], dl
dec esi
dec ecx
dec ecx
test esi, esi
jge 0x4c2112
jmp 0x4c2215
mov eax, dword [ebp - 0x20]
mov dword [eax], 0x14
jmp 0x4c285d
cmp word [ebp - 0x44], bx
jne 0x4c21d1
cmp word [ebp - 0x34], bx
jne 0x4c21ba
or byte [ebp - 0x484], 0xff
or byte [ebp - 0x483], 0xff
or byte [ebp - 0x482], 0xff
jmp 0x4c2215
or byte [ebp - 0x488], 0xff
or byte [ebp - 0x487], 0xff
or byte [ebp - 0x486], 0xff
jmp 0x4c2215
cmp word [ebp - 0x34], bx
jne 0x4c21f5
xor eax, eax
mov byte [ebp + eax*4 - 0x488], al
mov byte [ebp + eax*4 - 0x487], al
mov byte [ebp + eax*4 - 0x486], al
inc eax
cmp eax, edi
jl 0x4c21d9
jmp 0x4c2215
xor ecx, ecx
or al, 0xff
sub al, cl
mov byte [ebp + ecx*4 - 0x488], al
mov byte [ebp + ecx*4 - 0x487], al
mov byte [ebp + ecx*4 - 0x486], al
inc ecx
cmp ecx, edi
jl 0x4c21f7
lea ecx, [ebp - 0x594]
call fcn.004b62a1
mov edx, dword [ebp - 0x1c]
xor edi, edi
cmp byte [ebp - 0x4c], 0
mov ebx, edx
mov dword [ebp - 0x64], ebx
mov dword [ebp - 0x68], edi
je 0x4c224b
lea ebx, [edx*8 + 0x1f]
mov edi, 0x428
shr ebx, 5
shl ebx, 2
mov dword [ebp - 0x64], ebx
mov dword [ebp - 0x68], edi
mov esi, dword [ebp - 0x14]
mov eax, ebx
imul eax, esi
add eax, edi
cmp dword [ebp - 0x7c], 0xffffffff
mov ecx, eax
mov dword [ebp - 0x60], ebx
je 0x4c2287
cmp byte [ebp - 0x4c], 0
mov dword [ebp - 0x60], esi
je 0x4c2279
lea esi, [esi*8 + 0x1f]
shr esi, 5
shl esi, 2
mov dword [ebp - 0x60], esi
mov ecx, esi
mov dword [ebp - 0x48], eax
imul ecx, edx
add ecx, edi
cmp eax, ecx
ja 0x4c228a
mov dword [ebp - 0x48], ecx
lea ecx, [ebp - 0x5c]
call fcn.004c3a7c
push dword [ebp - 0x48]
lea ecx, [ebp - 0x5c]
call fcn.004c3a88
mov eax, dword [ebp - 0x54]
test eax, eax
jne 0x4c22b2
mov eax, dword [ebp - 0x20]
mov dword [eax], 1
jmp 0x4c285d
cmp byte [ebp - 0x4c], 0
mov dword [ebp - 0x24], eax
je 0x4c22c0
add eax, edi
mov dword [ebp - 0x24], eax
mov edi, dword [ebp + 8]
push edi
call fcn.004dab41
neg eax
sbb al, al
pop ecx
inc al
push edi
mov byte [ebp + 0x1b], al
je 0x4c24c3
call fcn.004da68d
pop ecx
xor esi, esi
push eax
lea ecx, [ebp - 0x70]
mov dword [ebp - 0x6c], esi
mov dword [ebp - 0x70], esi
call fcn.004d00a4
push edi
mov dword [ebp - 4], esi
call fcn.004da6d4
mov dword [ebp - 0x18], eax
mov eax, dword [ebp - 0x14]
cmp eax, esi
pop ecx
mov dword [ebp + 0x18], esi
jbe 0x4c246a
mov ecx, dword [ebp - 0x74]
mov esi, 0x62cf44
mov edx, dword [ebp + 0x18]
lea edi, [edx + ecx]
cmp edi, eax
jbe 0x4c2325
sub eax, edx
mov dword [ebp - 0x10], eax
jmp 0x4c2328
mov dword [ebp - 0x10], ecx
mov eax, dword [ebp - 0x10]
mov edi, dword [ebp + 8]
imul eax, dword [ebp - 0x18]
push eax
push dword [ebp - 0x6c]
push 0
push dword [ebp + 0x18]
push edi
call fcn.004da578
add esp, 0xc
push eax
push edi
call fcn.004d9d49
add esp, 0x10
cmp eax, 0xffffffff
je 0x4c247e
and dword [ebp - 0x28], 0
cmp dword [ebp - 0x10], 0
jbe 0x4c2417
mov edi, dword [ebp - 0x10]
mov eax, dword [ebp + 0x18]
lea esi, [edi + eax]
mov eax, dword [ebp - 0x18]
neg esi
neg eax
dec edi
mov dword [ebp - 0x2c], eax
imul edi, dword [ebp - 0x18]
cmp word [ebp - 0x44], 0x10
jne 0x4c23d2
cmp word [ebp - 0x34], 1
je 0x4c2392
cmp word [ebp - 0x34], 0
jne 0x4c23d2
mov eax, dword [ebp - 0x6c]
add eax, edi
mov dword [ebp - 0x38], eax
mov eax, dword [ebp - 0x14]
lea ecx, [esi + eax]
imul ecx, ebx
add ecx, dword [ebp - 0x24]
test ebx, ebx
jbe 0x4c23ff
mov dword [ebp - 0x50], ebx
mov eax, dword [ebp - 0x38]
mov ebx, 0xffff
add dword [ebp - 0x38], 2
movzx eax, word [eax]
imul eax, eax, 0xff
cdq
idiv ebx
mov byte [ecx], al
inc ecx
dec dword [ebp - 0x50]
jne 0x4c23ad
mov ebx, dword [ebp - 0x64]
jmp 0x4c23ff
mov eax, dword [ebp - 0x14]
lea ecx, [ebp - 0x594]
add eax, esi
imul eax, ebx
add eax, dword [ebp - 0x24]
push eax
movzx eax, word [ebp - 0x44]
push eax
mov eax, dword [ebp - 0x6c]
push 1
add eax, edi
push ebx
push eax
call fcn.004c7338
test eax, eax
je 0x4c2493
inc dword [ebp - 0x28]
mov eax, dword [ebp - 0x28]
add edi, dword [ebp - 0x2c]
inc esi
cmp eax, dword [ebp - 0x10]
jb 0x4c237d
mov esi, 0x62cf44
mov ecx, esi
call fcn.004b1763
cmp dword [eax + 4], 1
jne 0x4c2452
mov ecx, esi
call fcn.004b1763
cmp dword [eax], 0
je 0x4c2452
mov ecx, esi
call fcn.004b1763
mov ecx, esi
mov edi, eax
call fcn.004b1763
push dword [eax + 8]
push dword [ebp - 0x14]
push dword [ebp + 0x18]
call dword [edi]
neg eax
sbb eax, eax
inc eax
jmp 0x4c2454
xor eax, eax
test eax, eax
jne 0x4c24b8
mov ecx, dword [ebp - 0x74]
mov eax, dword [ebp - 0x14]
add dword [ebp + 0x18], ecx
cmp dword [ebp + 0x18], eax
jb 0x4c2314
mov esi, dword [ebp - 0x20]
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x70]
call fcn.004c7789
jmp 0x4c26bd
mov ecx, dword [ebp - 0x20]
mov dword [ecx], 0x14
mov eax, dword [edi + 0x250]
test eax, eax
je 0x4c249e
jmp 0x4c249c
mov eax, dword [ebp - 0x594]
mov ecx, dword [ebp - 0x20]
mov dword [ecx], eax
lea ecx, [ebp - 0x5c]
call fcn.004c3b85
lea ecx, [ebp - 0x5c]
call fcn.004c3be9
mov esi, eax
lea ecx, [ebp - 0x70]
jmp 0x4c2692
mov esi, dword [ebp - 0x20]
mov dword [esi], 0xe
jmp 0x4c246d
call fcn.004d9cfa
and dword [ebp - 0x2c], 0
and dword [ebp - 0x30], 0
pop ecx
push eax
lea ecx, [ebp - 0x30]
call fcn.004d00a4
xor esi, esi
inc esi
cmp dword [ebp - 0x2c], 0
mov dword [ebp - 4], esi
jne 0x4c24fa
mov eax, dword [ebp - 0x20]
lea ecx, [ebp - 0x5c]
mov dword [eax], esi
call fcn.004c3b85
xor esi, esi
jmp 0x4c268f
lea eax, [ebp - 0x38]
push eax
push 0x142
push edi
call fcn.004d7bd7
lea eax, [ebp - 0x28]
push eax
push 0x143
push edi
call fcn.004d7bd7
mov ecx, dword [ebp - 0x14]
mov edx, dword [ebp - 0x1c]
and dword [ebp - 0x10], 0
mov dword [ebp - 0x3e], esi
lea eax, [ecx - 1]
add esp, 0x18
mov dword [ebp + 0x18], eax
mov eax, dword [ebp - 0x38]
lea esi, [eax + edx]
mov eax, dword [ebp - 0x54]
neg esi
test ecx, ecx
mov dword [ebp - 0x50], eax
jbe 0x4c26ae
mov ebx, 0x62cf44
mov edi, dword [ebp - 0x10]
xor edx, edx
mov eax, edi
div dword [ebp - 0x28]
mov eax, dword [ebp - 0x28]
sub eax, edx
lea edx, [eax + edi]
cmp edx, ecx
jbe 0x4c2566
sub ecx, edi
mov dword [ebp - 0x18], ecx
jmp 0x4c2569
mov dword [ebp - 0x18], eax
xor edi, edi
cmp dword [ebp - 0x1c], edi
jbe 0x4c260b
push 0
push 0
push dword [ebp - 0x10]
mov ebx, dword [ebp + 8]
push edi
push dword [ebp - 0x2c]
push ebx
call fcn.004da04c
add esp, 0x18
test eax, eax
jl 0x4c2668
push ebx
call fcn.004d9c2e
pop ecx
xor edx, edx
mov ecx, eax
mov eax, dword [ebp - 0x10]
div dword [ebp - 0x28]
mov eax, dword [ebp - 0x38]
imul ecx, edx
lea edx, [edi + eax]
cmp edx, dword [ebp - 0x1c]
jbe 0x4c25cf
movzx ebx, word [ebp - 0x78]
mov edx, dword [ebp - 0x1c]
push ebx
mov ebx, dword [ebp - 0x2c]
sub edx, edi
sub eax, edx
add ebx, ecx
push ebx
lea ecx, [eax + esi]
push ecx
push eax
push dword [ebp - 0x18]
push edx
jmp 0x4c25e1
movzx edx, word [ebp - 0x78]
push edx
mov edx, dword [ebp - 0x2c]
add edx, ecx
push edx
push esi
push 0
push dword [ebp - 0x18]
push eax
mov eax, dword [ebp + 0x18]
push dword [ebp + 0x18]
imul eax, dword [ebp - 0x1c]
add eax, edi
push edi
add eax, dword [ebp - 0x50]
push eax
call fcn.004c2870
add edi, dword [ebp - 0x38]
add esp, 0x24
cmp edi, dword [ebp - 0x1c]
jb 0x4c2574
mov ebx, 0x62cf44
mov eax, dword [ebp - 0x18]
mov ecx, ebx
sub dword [ebp + 0x18], eax
call fcn.004b1763
cmp dword [eax + 4], 1
jne 0x4c264c
mov ecx, ebx
call fcn.004b1763
cmp dword [eax], 0
je 0x4c264c
mov ecx, ebx
call fcn.004b1763
mov ecx, ebx
mov edi, eax
call fcn.004b1763
push dword [eax + 8]
push dword [ebp - 0x14]
push dword [ebp - 0x10]
call dword [edi]
neg eax
sbb eax, eax
inc eax
jmp 0x4c264e
xor eax, eax
test eax, eax
jne 0x4c26a2
mov eax, dword [ebp - 0x10]
mov ecx, dword [ebp - 0x14]
add eax, dword [ebp - 0x18]
cmp eax, ecx
mov dword [ebp - 0x10], eax
jb 0x4c2549
jmp 0x4c26ab
mov ecx, dword [ebp - 0x20]
mov dword [ecx], 0x14
mov eax, dword [ebx + 0x250]
test eax, eax
je 0x4c267d
mov dword [ecx], eax
lea ecx, [ebp - 0x5c]
call fcn.004c3b85
lea ecx, [ebp - 0x5c]
call fcn.004c3be9
mov esi, eax
lea ecx, [ebp - 0x30]
or dword [ebp - 4], 0xffffffff
call fcn.004c7789
mov eax, esi
jmp 0x4c285f
mov eax, dword [ebp - 0x20]
mov dword [eax], 0xe
mov ebx, dword [ebp - 0x64]
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x30]
call fcn.004c7789
mov esi, dword [ebp - 0x20]
cmp dword [esi], 0
je 0x4c26cf
lea ecx, [ebp - 0x5c]
call fcn.004c3b85
jmp 0x4c284a
movzx eax, word [ebp - 0x3e]
push eax
mov ecx, esi
call fcn.004c2c09
test eax, eax
je 0x4c2766
and dword [ebp - 0x2c], 0
and dword [ebp - 0x30], 0
mov edi, dword [ebp - 0x48]
lea ecx, [ebp - 0x30]
sub edi, dword [ebp - 0x68]
mov dword [ebp - 4], 2
push edi
call fcn.004d00a4
xor eax, eax
cmp dword [ebp - 0x30], eax
jle 0x4c2715
mov ecx, dword [ebp - 0x2c]
and byte [ecx + eax], 0
inc eax
cmp eax, dword [ebp - 0x30]
jl 0x4c2708
cmp dword [ebp - 0x2c], 0
jne 0x4c2723
mov dword [esi], 1
jmp 0x4c2758
push dword [ebp - 0x4c]
lea eax, [ebp - 0x14]
mov ecx, esi
push dword [ebp - 0x60]
push ebx
push 8
push eax
lea eax, [ebp - 0x1c]
push eax
push dword [ebp - 0x2c]
push dword [ebp - 0x24]
push dword [ebp - 0x3e]
call fcn.004c2a78
push edi
mov dword [esi], eax
push dword [ebp - 0x2c]
push dword [ebp - 0x24]
call fcn.00576e70
mov ebx, dword [ebp - 0x60]
add esp, 0xc
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x30]
call fcn.004c7789
jmp 0x4c2783
push dword [ebp - 0x4c]
lea eax, [ebp - 0x14]
mov ecx, esi
push ebx
push 8
push eax
lea eax, [ebp - 0x1c]
push eax
push dword [ebp - 0x24]
push dword [ebp - 0x3e]
call fcn.004c293c
mov dword [esi], eax
xor edi, edi
cmp dword [esi], edi
je 0x4c2796
lea ecx, [ebp - 0x5c]
call fcn.004c3b85
jmp 0x4c285d
cmp byte [ebp - 0x4c], 0
je 0x4c2823
lea eax, [ebp - 0x88]
mov ecx, esi
push eax
push dword [ebp + 8]
call fcn.004c2b97
push 4
lea eax, [ebp - 0x88]
push 1
push eax
lea ecx, [ebp - 0x594]
call fcn.004b62f8
mov eax, dword [ebp - 0x54]
push 0x400
mov dword [eax], 0x28
mov ecx, dword [ebp - 0x1c]
mov dword [eax + 4], ecx
mov ecx, dword [ebp - 0x14]
mov dword [eax + 8], ecx
mov word [eax + 0xc], 1
mov word [eax + 0xe], 8
mov dword [eax + 0x10], edi
imul ebx, dword [ebp - 0x14]
mov dword [eax + 0x14], ebx
mov ecx, dword [ebp - 0x88]
mov dword [eax + 0x18], ecx
mov ecx, dword [ebp - 0x84]
mov dword [eax + 0x1c], ecx
mov dword [eax + 0x20], 0x100
mov dword [eax + 0x24], edi
lea eax, [ebp - 0x488]
push eax
mov eax, dword [ebp - 0x54]
add eax, 0x28
push eax
jmp 0x4c2832
lea eax, [ebp - 0x488]
push 0x400
push eax
push dword [ebp + 0x14]
call fcn.00576e70
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp - 0x1c]
add esp, 0xc
mov dword [eax], ecx
mov eax, dword [ebp + 0x10]
mov ecx, dword [ebp - 0x14]
mov dword [eax], ecx
lea ecx, [ebp - 0x5c]
call fcn.004c3be9
jmp 0x4c285f
mov eax, dword [ebp - 0x20]
mov dword [eax], 0x1c
xor eax, eax
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
pop ebx
mov dword fs:[0], ecx
leave
ret 0x14