Function at 0x40f370
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
mov ax, word [esp + 0xc]
push ebx
push esi
mov esi, dword [esp + 0x10]
test ax, ax
jne 0x40f38f
mov cl, byte [esp + 0xc]
test cl, cl
jne 0x40f3a4
test si, si
jne 0x40f3a4
jmp 0x40f3d0
cmp ax, 1
jne 0x40f3a4
mov cl, byte [esp + 0xc]
test cl, cl
jne 0x40f3a4
mov bl, al
jmp 0x40f429
mov cl, byte [0x4b64e8]
test cl, cl
je 0x40f3c2
cmp ax, 2
jb 0x40f3be
cmp ax, 5
ja 0x40f3be
mov bl, 2
jmp 0x40f40c
mov bl, 3
jmp 0x40f429
cmp ax, 2
setne bl
add ebx, 2
test bl, bl
jne 0x40f407
pop esi
mov dword [0x4bf1e8], 0x6d7fe8
mov dword [0x4bf1e4], 0x6cfbe4
mov dword [0x4bf1e0], 0x7e0200
mov dword [0x4bf1dc], 0x7e0412
mov dword [0x4bf1d8], 0x7e0628
xor al, al
pop ebx
ret
cmp bl, 2
jne 0x40f429
mov al, byte [esp + 0x18]
cmp al, 1
je 0x40f429
test al, al
je 0x40f422
mov al, byte [0x7e083c]
mov byte [0x7e1860], al
mov byte [0x7e083c], 1
mov ecx, dword [esp + 0xc]
push esi
push ecx
call fcn.00409ee0
mov ecx, dword [0x7e083c]
add esp, 8
and ecx, 0xff
cmp ecx, 0xa
ja case.0x40f44c.8
jmp dword [ecx*4 + 0x40f81c]
cmp bl, 1
jne case.0x40f44c.8
mov dword [0x5c7220], eax
mov al, byte [0x80c4d7]
cmp al, 4
jne 0x40f489
mov edx, dword [esp + 0xc]
inc esi
push esi
push edx
call fcn.00409ee0
add esp, 8
mov dword [0x5c7224], eax
mov byte [0x7e083c], bl
xor al, al
pop esi
pop ebx
ret
pop esi
mov dword [0x5c7224], 0xffffffff
mov byte [0x7e083c], 1
xor al, al
pop ebx
ret
cmp bl, 2
jne case.0x40f44c.8
mov ecx, dword [0x5c7228]
and ecx, 0xff
mov dword [ecx*4 + 0x5c722c], eax
mov cl, byte [0x5c7228]
mov al, byte [0x4b64e8]
inc cl
test al, al
mov al, byte [esp + 0x18]
mov byte [0x5c7228], cl
je 0x40f529
test al, al
mov eax, dword [0x5c7228]
jne 0x40f4fb
mov edx, eax
and edx, 0xff
and edx, 0x80000003
jns 0x40f4f4
dec edx
or edx, 0xfffffffc
inc edx
jne 0x40f4fb
pop esi
mov al, 1
pop ebx
ret
and eax, 0xff
and eax, 0x80000003
jns 0x40f50c
dec eax
or eax, 0xfffffffc
inc eax
jne 0x40f51a
pop esi
mov byte [0x7e083c], 2
xor al, al
pop ebx
ret
mov al, byte [0x7e1860]
pop esi
mov byte [0x7e083c], al
xor al, al
pop ebx
ret
test al, al
jne 0x40f532
pop esi
mov al, 1
pop ebx
ret
cmp byte [0x5c7228], 1
jne 0x40f547
pop esi
mov byte [0x7e083c], 2
xor al, al
pop ebx
ret
mov cl, byte [0x7e1860]
pop esi
mov byte [0x7e083c], cl
xor al, al
pop ebx
ret
cmp bl, 3
jne case.0x40f44c.8
mov edx, dword [0x5c726c]
and edx, 0xff
mov dword [edx*4 + 0x5c7270], eax
mov bl, byte [0x5c726c]
movzx ax, byte [0x7e1533]
inc bl
push eax
mov byte [0x5c726c], bl
call fcn.0040a430
movzx cx, byte [0x5c726c]
add esp, 4
cmp cx, ax
jne case.0x40f44c.8
mov cl, byte [0x4b64e8]
pop esi
test cl, cl
sete dl
add edx, 3
xor al, al
mov byte [0x7e083c], dl
pop ebx
ret
cmp bl, 3
jne case.0x40f44c.8
mov dword [0x5c7374], eax
mov byte [0x7e083c], bl
pop esi
xor al, al
pop ebx
ret
cmp bl, 3
jne case.0x40f44c.8
mov dword [0x5c7370], eax
pop esi
mov byte [0x7e083c], 5
xor al, al
pop ebx
ret
cmp bl, 3
jne case.0x40f44c.8
xor edx, edx
push 0
div dword [0x4b64f0]
push 2
push eax
push 0x4bf1e4
call fcn.004119b0
mov cl, al
mov eax, dword [0x6cfbe0]
and ecx, 0xff
xor edx, edx
add eax, ecx
xor ecx, ecx
mov cx, word [0x803b7c]
mov dword [0x6cfbe0], eax
div ecx
add esp, 0x10
inc word [0x5c7380]
add ecx, 0xfffffff0
and edx, 0xffff
cmp edx, ecx
jne 0x40f679
mov esi, 8
push 0
push 2
push 0xffff
push 0x4bf1e4
call fcn.004119b0
mov ecx, dword [0x6cfbe0]
and eax, 0xff
add esp, 0x10
add ecx, eax
dec esi
mov dword [0x6cfbe0], ecx
jne 0x40f64d
mov dx, word [0x7e1638]
push edx
call fcn.0040a430
add esp, 4
cmp word [0x5c7380], ax
jne case.0x40f44c.8
pop esi
mov byte [0x7e083c], 7
xor al, al
pop ebx
ret
cmp bl, 3
jne case.0x40f44c.8
push ebp
push edi
mov dword [0x5c7378], eax
mov ebp, 4
mov ebx, 0x10
mov edx, str.1111
or ecx, 0xffffffff
mov edi, edx
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
test cx, cx
jbe 0x40f6f3
mov esi, ecx
and esi, 0xffff
mov edi, dword [0x4bf1e0]
mov al, byte [edx]
mov byte [edi], al
mov eax, dword [0x4bf1e0]
inc eax
inc edx
dec esi
mov dword [0x4bf1e0], eax
jne 0x40f6da
cmp cx, bx
jae 0x40f71b
and ecx, 0xffff
mov eax, ebx
sub eax, ecx
mov ecx, dword [0x4bf1e0]
mov byte [ecx], 0
mov edx, dword [0x4bf1e0]
inc edx
dec eax
mov dword [0x4bf1e0], edx
jne 0x40f702
mov ecx, dword [0x7e01fc]
add ecx, ebx
dec ebp
mov dword [0x7e01fc], ecx
jne 0x40f6bc
pop edi
pop ebp
pop esi
mov byte [0x7e083c], 9
xor al, al
pop ebx
ret
cmp bl, 3
jne case.0x40f44c.8
mov dword [0x5c737c], eax
pop esi
mov byte [0x7e083c], 0xa
xor al, al
pop ebx
ret
cmp bl, 3
jne case.0x40f44c.8
cmp word [0x7e1738], 0
je 0x40f7c8
mov dl, byte [0x44e400]
push 0
mov byte [0x7e164c], dl
xor edx, edx
div dword [0x4b64f0]
push 2
push eax
push 0x4bf1d8
call fcn.004119b0
mov ebx, dword [0x7e0624]
and eax, 0xff
add ebx, eax
mov ax, word [0x7e1738]
inc word [0x7e0622]
push eax
mov dword [0x7e0624], ebx
call fcn.0040a430
add esp, 0x14
cmp word [0x7e0622], ax
jne case.0x40f44c.8
pop esi
mov byte [0x7e083c], 6
xor al, al
pop ebx
ret
pop esi
mov byte [0x7e164c], 0xff
mov byte [0x7e083c], 6
mov al, 2
pop ebx
ret
cmp bl, 3
jne case.0x40f44c.8
xor edx, edx
push 0
div dword [0x4b64f0]
push 2
push eax
push 0x4bf1e8
call fcn.004119b0
mov ecx, dword [0x6d7fe4]
and eax, 0xff
add ecx, eax
add esp, 0x10
inc word [0x5c7382]
mov dword [0x6d7fe4], ecx
pop esi
xor al, al
pop ebx
ret