Function at 0x4c794630
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
mov eax, dword [ebp + 8]
sub esp, 0x14
sub eax, 4
push ebx
push esi
push edi
je 0x4c794860
sub eax, 1
je 0x4c7947b0
sub eax, 1
jne 0x4c7949b2
mov ebx, dword [ebp + 0x10]
xor edi, edi
cmp dword [ebp + 0x28], edi
mov dword [ebp - 0x14], edi
mov dword [ebp + 0x18], edi
mov dword [ebp - 8], edi
mov dword [ebp - 0x10], edi
mov dword [ebp - 4], edi
mov dword [ebp - 0xc], edi
mov dword [ebp + 8], 1
je 0x4c79468a
mov eax, dword [ebp + 0xc]
lea ebx, [ebx + eax*4 - 4]
mov dword [ebp + 8], 0xffffffff
mov eax, dword [ebp + 0x1c]
lea ecx, [ebp - 0x14]
push ecx
lea edx, [ebp - 0x10]
push edx
push eax
call fcn.4c793760
test eax, eax
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
jne 0x4c7946bf
push 0x9f5
push 0x4c7821a4
call esi
push eax
push 0x4c78142c
call fcn.4c7c02b0
add esp, 0x10
mov eax, dword [ebp + 0x20]
lea ecx, [ebp + 0x18]
push ecx
lea edx, [ebp - 4]
push edx
push eax
call fcn.4c793760
test eax, eax
jne 0x4c7946ee
push 0x9fa
push 0x4c7821a4
call esi
push eax
push 0x4c78142c
call fcn.4c7c02b0
add esp, 0x10
mov eax, dword [ebp + 0x24]
lea ecx, [ebp - 8]
push ecx
lea edx, [ebp - 0xc]
push edx
push eax
call fcn.4c793760
test eax, eax
jne 0x4c79471d
push 0x9ff
push 0x4c7821a4
call esi
push eax
push 0x4c78142c
call fcn.4c7c02b0
add esp, 0x10
cmp dword [ebp + 0xc], edi
je 0x4c7949b2
mov ecx, dword [ebp + 8]
mov edi, dword [ebp + 0x14]
lea edx, [ecx*4]
mov dword [ebp + 0x10], edx
mov esi, dword [ebx]
movsx ecx, word [ebp + 0x18]
mov eax, esi
and eax, dword [ebp + 0x20]
xor edx, edx
shr eax, cl
movsx ecx, word [ebp - 8]
imul eax, eax, 0xff
div dword [ebp - 4]
xor edx, edx
add ebx, dword [ebp + 0x10]
add edi, 1
movzx eax, al
mov dword [ebp + 0x14], eax
mov eax, esi
and eax, dword [ebp + 0x24]
shr eax, cl
mov ecx, dword [ebp + 0x14]
imul eax, eax, 0xff
div dword [ebp - 0xc]
xor edx, edx
movzx eax, al
lea ecx, [eax + ecx*2]
mov eax, esi
imul ecx, ecx, 0x26
and eax, dword [ebp + 0x1c]
imul eax, eax, 0xff
div dword [ebp - 0x10]
movzx eax, al
lea edx, [eax*8]
sub edx, eax
lea eax, [ecx + edx*2]
shr eax, 7
sub dword [ebp + 0xc], 1
mov byte [edi - 1], al
jne 0x4c794736
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x24
mov eax, dword [ebp + 0x10]
mov edx, dword [ebp + 0xc]
xor edi, edi
cmp dword [ebp + 0x28], edi
mov esi, 3
je 0x4c7947cc
lea ecx, [eax + edx*2]
lea eax, [edx + ecx - 3]
lea esi, [edi - 3]
mov ecx, dword [ebp + 0x18]
cmp ecx, edi
je 0x4c79481d
cmp word [ecx + 8], 4
jne 0x4c79481d
cmp edx, edi
je 0x4c7949b2
movzx ecx, byte [eax + 1]
movzx edi, byte [eax]
lea edi, [edi + ecx*2]
movzx ecx, byte [eax + 2]
imul edi, edi, 0x26
lea ebx, [ecx*8]
sub ebx, ecx
lea ecx, [edi + ebx*2]
mov edi, dword [ebp + 0x14]
shr ecx, 7
mov byte [edi], cl
add edi, 1
add eax, esi
sub edx, 1
mov dword [ebp + 0x14], edi
jne 0x4c7947e2
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x24
cmp edx, edi
je 0x4c7949b2
movzx ecx, byte [eax + 1]
movzx edi, byte [eax + 2]
lea edi, [edi + ecx*2]
movzx ecx, byte [eax]
imul edi, edi, 0x26
lea ebx, [ecx*8]
sub ebx, ecx
lea ecx, [edi + ebx*2]
mov edi, dword [ebp + 0x14]
shr ecx, 7
mov byte [edi], cl
add edi, 1
add eax, esi
sub edx, 1
mov dword [ebp + 0x14], edi
jne 0x4c794825
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x24
mov ebx, dword [ebp + 0x10]
xor edi, edi
cmp dword [ebp + 0x28], edi
mov dword [ebp - 0x14], edi
mov dword [ebp + 0x18], edi
mov dword [ebp - 0xc], edi
mov dword [ebp - 4], edi
mov dword [ebp - 0x10], edi
mov dword [ebp - 8], edi
mov dword [ebp + 8], 1
je 0x4c794891
mov edx, dword [ebp + 0xc]
lea ebx, [ebx + edx*2 - 2]
mov dword [ebp + 8], 0xffffffff
mov edx, dword [ebp + 0x1c]
lea eax, [ebp - 0x14]
push eax
lea ecx, [ebp - 4]
push ecx
push edx
call fcn.4c793760
test eax, eax
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
jne 0x4c7948c6
push 0x9a4
push 0x4c7821a4
call esi
push eax
push 0x4c78142c
call fcn.4c7c02b0
add esp, 0x10
mov edx, dword [ebp + 0x20]
lea eax, [ebp + 0x18]
push eax
lea ecx, [ebp - 0x10]
push ecx
push edx
call fcn.4c793760
test eax, eax
jne 0x4c7948f5
push 0x9a9
push 0x4c7821a4
call esi
push eax
push 0x4c78142c
call fcn.4c7c02b0
add esp, 0x10
mov edx, dword [ebp + 0x24]
lea eax, [ebp - 0xc]
push eax
lea ecx, [ebp - 8]
push ecx
push edx
call fcn.4c793760
test eax, eax
jne 0x4c794924
push 0x9ae
push 0x4c7821a4
call esi
push eax
push 0x4c78142c
call fcn.4c7c02b0
add esp, 0x10
cmp dword [ebp + 0xc], edi
je 0x4c7949b2
mov eax, dword [ebp + 8]
mov edi, dword [ebp + 0x14]
lea ecx, [eax + eax]
mov dword [ebp + 0x10], ecx
lea esp, [esp]
movzx esi, word [ebx]
movsx ecx, word [ebp + 0x18]
mov eax, esi
and eax, dword [ebp + 0x20]
xor edx, edx
shr eax, cl
movsx ecx, word [ebp - 0xc]
imul eax, eax, 0xff
div dword [ebp - 0x10]
xor edx, edx
add ebx, dword [ebp + 0x10]
add edi, 1
movzx eax, al
mov dword [ebp + 0x14], eax
mov eax, esi
and eax, dword [ebp + 0x24]
shr eax, cl
imul eax, eax, 0xff
div dword [ebp - 8]
movzx edx, al
mov eax, dword [ebp + 0x14]
lea ecx, [edx + eax*2]
mov eax, esi
imul ecx, ecx, 0x26
and eax, dword [ebp + 0x1c]
xor edx, edx
imul eax, eax, 0xff
div dword [ebp - 4]
movzx eax, al
lea edx, [eax*8]
sub edx, eax
lea eax, [ecx + edx*2]
shr eax, 7
sub dword [ebp + 0xc], 1
mov byte [edi - 1], al
jne 0x4c794940
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x24