Function at 0x40c580
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
push edi
push esi
mov esi, ecx
push ebx
sub esp, 0x2c
mov eax, dword [0x4b610c]
mov ebx, dword [esp + 0x40]
test eax, eax
je 0x40c796
test bl, bl
je 0x40c678
mov eax, dword [0x4b610c]
mov ecx, esi
mov dword [esp + 0x18], eax
mov eax, dword [esi]
call dword [eax + 0x18]
mov edi, eax
mov cl, byte [eax]
test cl, cl
je 0x40c78f
mov ebx, eax
xor eax, eax
lea esi, [esi]
inc ebx
mov dl, 0x10
sub edx, ebx
and ecx, 0xff
add edx, edi
add eax, ecx
movsx ebp, byte [ebx]
movsx edx, dl
imul edx, ebp
mov ecx, ebp
test edx, edx
jne 0x40c5c8
mov ecx, 0x65
xor edx, edx
div ecx
lea eax, [edx + edx*2]
mov ebx, dword [esp + 0x18]
lea ecx, [ebx + eax*4]
mov ebp, dword [ecx]
test ebp, ebp
je 0x40c823
xor ebx, ebx
mov dword [esp + 0x1c], ecx
jmp 0x40c625
je 0x40c873
mov eax, dword [ebp]
mov ebx, ebp
test eax, eax
je 0x40c81f
mov ebp, eax
mov dword [esp + 4], edi
mov eax, dword [ebp + 4]
mov dword [esp], eax
call sub.msvcrt.dll_strcmp
test eax, eax
jle 0x40c610
mov dword [esp], 0xc
call fcn.0041c330
test ebx, ebx
mov ecx, dword [esp + 0x1c]
mov dword [eax], ebp
mov dword [eax + 4], edi
mov dword [eax + 8], esi
je 0x40c8e6
mov dword [ebx], eax
mov edi, dword [ecx + 8]
mov eax, dword [esp + 0x18]
inc edi
mov dword [ecx + 8], edi
mov ebp, dword [eax + 0x4bc]
inc ebp
mov dword [eax + 0x4bc], ebp
lea esi, [esi]
mov eax, dword [esi]
mov ecx, esi
mov ebp, dword [0x4b6108]
call dword [eax + 0x14]
mov ecx, 0x65
xor edx, edx
mov edi, eax
div ecx
lea eax, [edx + edx*2]
lea ecx, [ebp + eax*4]
mov ebx, dword [ecx]
test ebx, ebx
je 0x40c710
xor edx, edx
jmp 0x40c6b8
je 0x40c768
mov eax, dword [ebx]
mov edx, ebx
test eax, eax
je 0x40c710
mov ebx, eax
mov eax, dword [ebx + 4]
sub eax, edi
test eax, eax
jle 0x40c6a8
mov dword [esp], 0xc
mov dword [esp + 0x1c], edx
mov dword [esp + 0x18], ecx
call fcn.0041c330
mov edx, dword [esp + 0x1c]
mov ecx, dword [esp + 0x18]
mov dword [eax], ebx
mov dword [eax + 4], edi
mov dword [eax + 8], esi
test edx, edx
je 0x40c8ba
mov dword [edx], eax
mov esi, dword [ecx + 8]
inc esi
mov dword [ecx + 8], esi
mov edi, dword [ebp + 0x4bc]
inc edi
mov dword [ebp + 0x4bc], edi
add esp, 0x2c
pop ebx
pop esi
pop edi
pop ebp
ret 4
mov ebx, dword [ecx + 4]
mov dword [esp + 0x18], ecx
test ebx, ebx
mov dword [esp], 0xc
je 0x40c895
call fcn.0041c330
mov ecx, dword [esp + 0x18]
mov edx, dword [ecx + 4]
mov dword [eax], 0
mov dword [eax + 4], edi
mov dword [eax + 8], esi
mov dword [edx], eax
mov dword [ecx + 4], eax
mov eax, dword [ecx + 8]
inc eax
mov dword [ecx + 8], eax
mov eax, dword [ebp + 0x4bc]
inc eax
mov dword [ebp + 0x4bc], eax
add esp, 0x2c
pop ebx
pop esi
pop edi
pop ebp
ret 4
mov eax, dword [0x4b61c0]
mov dword [esp + 8], 0x488453
mov dword [esp + 4], 0x488463
mov dword [esp], eax
call fcn.004256d0
add esp, 0x2c
pop ebx
pop esi
pop edi
pop ebp
ret 4
xor edx, edx
jmp 0x40c5ef
mov dword [esp], 0x4c0
call fcn.00480020
mov edx, eax
lea ecx, [eax + 0x4bc]
lea esi, [esi]
mov dword [edx], 0
mov dword [edx + 4], 0
mov dword [edx + 8], 0
add edx, 0xc
cmp ecx, edx
jne 0x40c7b0
mov dword [eax + 0x4bc], 0
mov dword [esp], 0x4c0
mov dword [0x4b610c], eax
call fcn.00480020
mov edx, eax
lea ecx, [eax + 0x4bc]
nop
mov dword [edx], 0
mov dword [edx + 4], 0
mov dword [edx + 8], 0
add edx, 0xc
cmp edx, ecx
jne 0x40c7f0
mov dword [eax + 0x4bc], 0
mov dword [0x4b6108], eax
jmp 0x40c59a
mov ecx, dword [esp + 0x1c]
mov ebx, dword [ecx + 4]
mov dword [esp + 0x1c], ecx
test ebx, ebx
mov dword [esp], 0xc
je 0x40c8c1
call fcn.0041c330
mov ecx, dword [esp + 0x1c]
mov edx, dword [ecx + 4]
mov dword [eax], 0
mov dword [eax + 4], edi
mov dword [eax + 8], esi
mov dword [edx], eax
mov dword [ecx + 4], eax
mov eax, dword [ecx + 8]
inc eax
mov dword [ecx + 8], eax
mov eax, dword [esp + 0x18]
mov ebp, dword [eax + 0x4bc]
inc ebp
mov dword [eax + 0x4bc], ebp
jmp 0x40c678
mov eax, dword [0x4b61c0]
mov dword [esp + 8], 0x488453
mov dword [esp + 4], 0x488463
mov dword [esp], eax
call fcn.004256d0
jmp 0x40c678
call fcn.0041c330
mov ecx, dword [esp + 0x18]
mov edx, dword [ecx]
mov dword [eax], edx
mov edx, dword [ecx + 4]
mov dword [eax + 4], edi
mov dword [eax + 8], esi
test edx, edx
mov dword [ecx], eax
jne 0x40c743
jmp 0x40c740
mov dword [ecx], eax
jmp 0x40c6ef
call fcn.0041c330
mov ecx, dword [esp + 0x1c]
mov edx, dword [ecx]
mov dword [eax], edx
mov edx, dword [ecx + 4]
mov dword [eax + 4], edi
mov dword [eax + 8], esi
test edx, edx
mov dword [ecx], eax
jne 0x40c856
jmp 0x40c853
mov dword [ecx], eax
jmp 0x40c65a