Function at 0x4d24c0
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
sub esp, 0x20
mov eax, dword [0x57f7c4]
xor eax, esp
mov dword [esp + 0x1c], eax
mov eax, dword [esi + 0x30]
test eax, eax
je 0x4d27a5
push ebx
mov bl, byte [eax + 0x4a]
test bl, bl
je 0x4d27a4
movzx ecx, word [eax + 0x3e]
test cx, cx
je 0x4d27a4
cmp cx, 0x63
ja 0x4d27a4
mov eax, dword [eax + 0xa0]
cmp eax, 1
push ebp
push edi
jl 0x4d2512
cmp eax, 0xf
jle 0x4d2603
mov eax, esi
call fcn.004d2110
test al, al
jne 0x4d2603
movzx ecx, bl
lea eax, [ecx - 1]
cmp eax, 8
ja case.default.0x4d2530
jmp dword [eax*4 + 0x4d27b4]
xor eax, eax
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], eax
mov byte [esp + 0x18], al
call fcn.0051bd66
cdq
mov ecx, 9
idiv ecx
mov byte [esp + edx + 0x10], 0xff
jmp 0x4d26e5
xor eax, eax
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], eax
mov byte [esp + 0x18], al
lea ebx, [ebx]
mov byte [esp + eax + 0x1c], al
inc eax
cmp eax, 9
jl 0x4d2570
xor ebp, ebp
test ecx, ecx
jle 0x4d26e5
lea edi, [esp + 0x24]
mov ebx, 9
mov edx, edi
sub ebx, edx
call fcn.0051bd66
cdq
lea ecx, [ebx + edi]
idiv ecx
mov cl, byte [edi]
inc ebp
dec edi
lea eax, [esp + edx + 0x1c]
movzx edx, byte [eax]
mov byte [esp + edx + 0x10], 0xff
mov edx, dword [esi + 0x30]
mov byte [eax], cl
movzx eax, byte [edx + 0x4a]
cmp ebp, eax
jl 0x4d2591
jmp 0x4d26e5
or eax, 0xffffffff
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], eax
mov byte [esp + 0x18], al
call fcn.0051bd66
cdq
mov ecx, 9
idiv ecx
mov byte [esp + edx + 0x10], 0
jmp 0x4d26e5
or eax, 0xffffffff
mov dword [esp + 0x14], eax
mov byte [esp + 0x18], al
jmp 0x4d26e1
xor eax, eax
mov dword [esp + 0x14], eax
mov byte [esp + 0x18], al
jmp 0x4d26e1
movzx ecx, bl
lea eax, [ecx - 1]
cmp eax, 5
ja case.0x4d2612.6
jmp dword [eax*4 + 0x4d27d8]
xor eax, eax
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], eax
mov byte [esp + 0x18], al
call fcn.0051bd66
cdq
mov ecx, 6
idiv ecx
mov byte [esp + edx + 0x10], 0xff
jmp 0x4d26e5
xor eax, eax
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], eax
mov byte [esp + 0x18], al
lea esp, [esp]
mov byte [esp + eax + 0x1c], al
inc eax
cmp eax, 6
jl 0x4d2650
xor ebp, ebp
test ecx, ecx
jle 0x4d26e5
lea edi, [esp + 0x21]
mov ebx, 6
mov edx, edi
sub ebx, edx
call fcn.0051bd66
cdq
lea ecx, [ebx + edi]
idiv ecx
mov cl, byte [edi]
inc ebp
dec edi
lea eax, [esp + edx + 0x1c]
movzx edx, byte [eax]
mov byte [esp + edx + 0x10], 0xff
mov edx, dword [esi + 0x30]
mov byte [eax], cl
movzx eax, byte [edx + 0x4a]
cmp ebp, eax
jl 0x4d2671
jmp 0x4d26e5
or eax, 0xffffffff
mov dword [esp + 0x10], eax
mov word [esp + 0x14], ax
mov byte [esp + 0x16], 0
mov byte [esp + 0x17], 0
mov byte [esp + 0x18], 0
call fcn.0051bd66
cdq
mov ecx, 6
idiv ecx
mov byte [esp + edx + 0x10], 0
jmp 0x4d26e5
or eax, 0xffffffff
mov byte [esp + 0x18], 0
mov byte [esp + 0x17], 0
mov byte [esp + 0x16], 0
mov word [esp + 0x14], ax
mov dword [esp + 0x10], eax
xor edi, edi
lea ebp, [esi + 0x84]
lea ecx, [ecx]
cmp byte [esp + edi + 0x10], 0xff
jne 0x4d276f
call fcn.0051bd66
mov edx, dword [esi + 0x30]
movzx ecx, word [edx + 0x3e]
cdq
inc ecx
idiv ecx
mov bl, dl
call fcn.0051bd66
mov edx, dword [esi + 0x30]
movzx ecx, word [edx + 0x3e]
cdq
inc ecx
idiv ecx
mov byte [esp + 0xf], dl
call fcn.0051bd66
mov edx, dword [esi + 0x30]
movzx ecx, word [edx + 0x3e]
cdq
inc ecx
idiv ecx
mov al, byte [esp + 0xf]
cmp bl, al
jae 0x4d2737
mov al, bl
cmp al, dl
jb 0x4d273d
mov al, dl
movzx dx, al
mov word [ebp], dx
movzx eax, al
cdq
mov ecx, 0xa
idiv ecx
movzx ecx, word [edi*2 + 0x581c74]
add al, 0x30
mov byte [ecx + esi + 0x4c], al
movzx eax, word [edi*2 + 0x581c74]
add dl, 0x30
mov byte [eax + esi + 0x4d], dl
jmp 0x4d2789
movzx ecx, word [edi*2 + 0x581c74]
mov byte [ecx + esi + 0x4c], 0x30
movzx edx, word [edi*2 + 0x581c74]
mov byte [edx + esi + 0x4d], 0x30
inc edi
add ebp, 2
cmp edi, 9
jl 0x4d26f0
pop edi
mov byte [esi + 0x5e], 0x30
mov byte [esi + 0x5f], 0x30
mov byte [esi + 0x60], 0
pop ebp
pop ebx
mov ecx, dword [esp + 0x1c]
xor ecx, esp
call fcn.0051a8be
add esp, 0x20
ret