Function at 0x40f1b0
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
mov eax, dword [esp + 4]
sub esp, 0x1c
push esi
mov esi, ecx
push 1
lea ecx, [esp + 0x28]
push ecx
mov ecx, esi
mov dword [esi + 0x60c], 0x40ed70
mov dword [esi + 0x614], eax
call fcn.00404470
movzx eax, byte [esp + 0x24]
inc eax
cmp eax, 2
mov dword [esi + 0x618], eax
jge 0x40f1f2
xor eax, eax
pop esi
add esp, 0x1c
ret 8
cmp byte [esi + 0x41dd], 0x18
push ebx
push ebp
push edi
jne 0x40f2ad
mov ecx, 0xff
cmp word [esi + 0x41e0], cx
jne 0x40f2ad
cmp word [esi + 0x41e2], cx
jne 0x40f2ad
cmp word [esi + 0x41e4], cx
jne 0x40f2ad
lea edx, [eax + eax*2]
push edx
mov ecx, esi
call fcn.004046e0
mov eax, dword [esi + 0x618]
mov ecx, dword [esi + 0x1c4]
lea eax, [eax + eax*2]
push eax
push ecx
mov ecx, esi
call fcn.00404470
mov eax, dword [esi + 0x618]
xor edi, edi
test eax, eax
jle 0x40f5b1
xor edx, edx
lea ecx, [esi + 0x61c]
lea esp, [esp]
mov eax, dword [esi + 0x1c4]
movzx ebx, byte [eax + edx + 2]
movzx ebp, byte [eax + edx + 1]
add eax, edx
movzx eax, byte [eax]
or ebx, 0x200
shl ebx, 8
or ebx, ebp
shl ebx, 8
or ebx, eax
mov dword [ecx], ebx
mov eax, dword [esi + 0x618]
inc edi
add ecx, 4
add edx, 3
cmp edi, eax
jl 0x40f270
jmp 0x40f5b1
movzx ecx, byte [esi + 0x41dc]
shr ecx, 3
imul ecx, eax
push ecx
mov ecx, esi
call fcn.004046e0
movzx edx, byte [esi + 0x41dc]
mov eax, dword [esi + 0x1c4]
shr edx, 3
imul edx, dword [esi + 0x618]
push edx
push eax
mov ecx, esi
call fcn.00404470
mov bl, byte [esi + 0x41dc]
cmp bl, 8
mov al, byte [esi + 0x41e6]
mov di, word [esi + 0x41e0]
mov cl, byte [esi + 0x41e7]
mov bp, word [esi + 0x41e2]
mov dl, byte [esi + 0x41e8]
je 0x40f4d6
cmp bl, 0x10
je 0x40f3f8
xor ebx, ebx
cmp dword [esi + 0x618], ebx
jle 0x40f5b1
movzx edx, dl
mov dword [esp + 0x14], edx
movzx edx, word [esi + 0x41e4]
movzx ecx, cl
mov dword [esp + 0x10], edx
movzx edx, al
movzx eax, di
mov dword [esp + 0x18], ecx
lea ecx, [esi + 0x61c]
movzx ebp, bp
mov dword [esp + 0x1c], edx
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], ecx
lea esp, [esp]
mov edx, dword [esi + 0x1c4]
mov edi, dword [edx + ebx*4]
mov ecx, dword [esp + 0x14]
mov eax, edi
shr eax, cl
mov ecx, dword [esp + 0x10]
xor edx, edx
and eax, ecx
imul eax, eax, 0xff
div ecx
mov ecx, dword [esp + 0x18]
xor edx, edx
movzx eax, al
or eax, 0x200
shl eax, 8
mov dword [esp + 0x28], eax
mov eax, edi
shr eax, cl
mov ecx, dword [esp + 0x28]
and eax, ebp
imul eax, eax, 0xff
div ebp
xor edx, edx
movzx eax, al
or ecx, eax
shl ecx, 8
mov dword [esp + 0x28], ecx
mov ecx, dword [esp + 0x1c]
mov eax, edi
shr eax, cl
mov ecx, dword [esp + 0x20]
and eax, ecx
imul eax, eax, 0xff
div ecx
movzx ecx, al
mov eax, dword [esp + 0x28]
or eax, ecx
mov ecx, eax
mov eax, dword [esp + 0x24]
mov dword [eax], ecx
add eax, 4
mov dword [esp + 0x24], eax
mov eax, dword [esi + 0x618]
inc ebx
cmp ebx, eax
jl 0x40f360
jmp 0x40f5b1
xor ebx, ebx
cmp dword [esi + 0x618], ebx
jle 0x40f5b1
movzx edx, dl
mov dword [esp + 0x14], edx
movzx edx, word [esi + 0x41e4]
movzx ecx, cl
mov dword [esp + 0x10], edx
movzx edx, al
movzx eax, di
mov dword [esp + 0x18], ecx
lea ecx, [esi + 0x61c]
movzx ebp, bp
mov dword [esp + 0x1c], edx
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], ecx
lea ebx, [ebx]
mov edx, dword [esi + 0x1c4]
movzx edi, word [edx + ebx*2]
mov ecx, dword [esp + 0x14]
mov eax, edi
shr eax, cl
mov ecx, dword [esp + 0x10]
and eax, ecx
imul eax, eax, 0xff
cdq
idiv ecx
mov ecx, dword [esp + 0x18]
movzx eax, al
or eax, 0x200
shl eax, 8
mov dword [esp + 0x28], eax
mov eax, edi
shr eax, cl
mov ecx, dword [esp + 0x28]
and eax, ebp
imul eax, eax, 0xff
cdq
idiv ebp
movzx eax, al
or ecx, eax
shl ecx, 8
mov dword [esp + 0x28], ecx
mov ecx, dword [esp + 0x1c]
mov eax, edi
shr eax, cl
mov ecx, dword [esp + 0x20]
and eax, ecx
imul eax, eax, 0xff
cdq
idiv ecx
movzx ecx, al
mov eax, dword [esp + 0x28]
or eax, ecx
mov ecx, eax
mov eax, dword [esp + 0x24]
mov dword [eax], ecx
add eax, 4
mov dword [esp + 0x24], eax
mov eax, dword [esi + 0x618]
inc ebx
cmp ebx, eax
jl 0x40f440
jmp 0x40f5b1
xor ebx, ebx
cmp dword [esi + 0x618], ebx
jle 0x40f5b1
movzx edx, dl
mov dword [esp + 0x14], edx
movzx edx, word [esi + 0x41e4]
movzx ecx, cl
mov dword [esp + 0x10], edx
movzx edx, al
movzx eax, di
mov dword [esp + 0x18], ecx
lea ecx, [esi + 0x61c]
movzx ebp, bp
mov dword [esp + 0x1c], edx
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], ecx
jmp 0x40f520
mov edx, dword [esi + 0x1c4]
movzx edi, byte [edx + ebx]
mov ecx, dword [esp + 0x14]
mov eax, edi
shr eax, cl
mov ecx, dword [esp + 0x10]
and eax, ecx
imul eax, eax, 0xff
cdq
idiv ecx
mov ecx, dword [esp + 0x18]
movzx eax, al
or eax, 0x200
shl eax, 8
mov dword [esp + 0x28], eax
mov eax, edi
shr eax, cl
mov ecx, dword [esp + 0x28]
and eax, ebp
imul eax, eax, 0xff
cdq
idiv ebp
movzx eax, al
or ecx, eax
shl ecx, 8
mov dword [esp + 0x28], ecx
mov ecx, dword [esp + 0x1c]
mov eax, edi
shr eax, cl
mov ecx, dword [esp + 0x20]
and eax, ecx
imul eax, eax, 0xff
cdq
idiv ecx
movzx ecx, al
mov eax, dword [esp + 0x28]
or eax, ecx
mov ecx, eax
mov eax, dword [esp + 0x24]
mov dword [eax], ecx
add eax, 4
mov dword [esp + 0x24], eax
mov eax, dword [esi + 0x618]
inc ebx
cmp ebx, eax
jl 0x40f520
mov edi, dword [esi + 0x618]
xor eax, eax
cmp edi, 2
setne al
pop edi
pop ebp
pop ebx
pop esi
dec eax
and eax, 0xfffffff9
add eax, 8
add esp, 0x1c
ret 8