Function at 0x405cad
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x44c
mov esi, dword [ebp + 8]
test esi, esi
je 0x405f33
cmp byte [esi], 0
je 0x405f33
xor eax, eax
or ecx, 0xffffffff
mov edi, esi
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov dword [ebp - 0x42c], ecx
xor ebx, ebx
mov edi, 0x3e
call sub.msvcrt.dll_rand
cdq
idiv edi
movzx eax, dl
call fcn.00405c8c
mov byte [ebp + ebx - 0x1b], al
inc ebx
cmp ebx, 3
jne 0x405ce6
xor eax, eax
mov dword [ebp + eax*4 - 0x424], eax
inc eax
cmp eax, 0x100
jne 0x405d02
xor ax, ax
xor ecx, ecx
xor edx, edx
mov ebx, dword [ebp + edx*4 - 0x424]
add cl, byte [ebp + eax - 0x1b]
add ecx, ebx
movzx ecx, cl
mov edi, dword [ebp + ecx*4 - 0x424]
mov dword [ebp + edx*4 - 0x424], edi
mov dword [ebp + ecx*4 - 0x424], ebx
inc eax
xor ebx, ebx
cmp eax, 3
setl bl
neg ebx
and eax, ebx
inc edx
cmp edx, 0x100
jne 0x405d18
mov dword [esp + 4], 1
mov eax, dword [ebp - 0x42c]
add eax, 8
mov dword [esp], eax
call sub.msvcrt.dll_calloc
mov dword [ebp - 0x430], eax
mov edi, eax
mov ecx, dword [ebp - 0x42c]
rep movsb byte es:[edi], byte [esi]
mov eax, dword [ebp - 0x42c]
add eax, 2
mov ebx, 3
cdq
idiv ebx
lea edi, [eax + eax*2]
xor edx, edx
xor eax, eax
mov dword [ebp - 0x434], edi
jmp 0x405ddf
inc edx
movzx edx, dl
mov esi, dword [ebp + edx*4 - 0x424]
mov ebx, esi
mov byte [ebp - 0x42c], bl
add ecx, ebx
movzx ecx, cl
mov ebx, dword [ebp + ecx*4 - 0x424]
mov dword [ebp + edx*4 - 0x424], ebx
mov dword [ebp + ecx*4 - 0x424], esi
add ebx, esi
movzx ebx, bl
mov ebx, dword [ebp + ebx*4 - 0x424]
mov edi, dword [ebp - 0x430]
xor byte [edi + eax], bl
inc eax
cmp eax, dword [ebp - 0x434]
jl 0x405d9c
mov edi, dword [ebp - 0x434]
mov dword [esp + 4], 1
mov eax, edi
shl eax, 4
inc eax
mov dword [esp], eax
call sub.msvcrt.dll_calloc
mov dword [ebp - 0x42c], eax
mov ecx, eax
mov esi, dword [ebp - 0x430]
jmp 0x405e8f
movzx eax, byte [esi]
cmp edi, 1
jne 0x405e22
inc esi
xor ebx, ebx
xor edx, edx
jmp 0x405e30
movzx edx, byte [esi + 1]
cmp edi, 2
jne 0x405e35
add esi, 2
xor ebx, ebx
xor di, di
jmp 0x405e3f
movzx ebx, byte [esi + 2]
add esi, 3
sub edi, 3
shl eax, 0x10
or eax, ebx
shl edx, 8
or eax, edx
mov ebx, 4
mov dword [ebp - 0x440], esi
mov esi, 0x3e
xor edx, edx
div esi
mov dword [ebp - 0x434], eax
movzx eax, dl
mov dword [ebp - 0x438], ecx
call fcn.00405c8c
mov ecx, dword [ebp - 0x438]
mov byte [ecx + ebx], al
dec ebx
mov eax, dword [ebp - 0x434]
cmp ebx, 0xffffffff
jne 0x405e54
mov esi, dword [ebp - 0x440]
add ecx, 5
test edi, edi
jg 0x405e13
xor eax, eax
or ecx, 0xffffffff
mov edi, dword [ebp - 0x42c]
repne scasb al, byte es:[edi]
not ecx
mov dword [esp + 4], 1
add ecx, 7
mov dword [esp], ecx
call sub.msvcrt.dll_calloc
mov ebx, eax
call sub.msvcrt.dll_rand
mov esi, 0x3e
cdq
idiv esi
movzx eax, dl
call fcn.00405c8c
mov byte [ebx], al
mov al, byte [ebp - 0x1b]
mov byte [ebx + 1], al
call sub.msvcrt.dll_rand
cdq
idiv esi
movzx eax, dl
call fcn.00405c8c
mov byte [ebx + 2], al
mov al, byte [ebp - 0x1a]
mov byte [ebx + 3], al
call sub.msvcrt.dll_rand
cdq
idiv esi
movzx eax, dl
call fcn.00405c8c
mov byte [ebx + 4], al
mov al, byte [ebp - 0x19]
mov byte [ebx + 5], al
mov edi, dword [ebp - 0x42c]
mov dword [esp + 4], edi
lea eax, [ebx + 6]
mov dword [esp], eax
call sub.msvcrt.dll_strcpy
mov dword [esp], edi
call fcn.0041afa8
mov edi, dword [ebp - 0x430]
mov dword [esp], edi
call fcn.0041afa8
jmp 0x405f50
cmp byte [esi], 0
jne 0x405f4e
mov dword [ebp + 8], 0x483544
add esp, 0x44c
pop ebx
pop esi
pop edi
pop ebp
jmp sub.msvcrt.dll__strdup
xor ebx, ebx
mov eax, ebx
add esp, 0x44c
pop ebx
pop esi
pop edi
pop ebp
ret