Function at 0x40f940
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ecx
mov al, byte [0x4b64e8]
push esi
xor esi, esi
mov dword [esp + 4], 0x5c739c
test al, al
je 0x40f95d
call fcn.00410c30
pop esi
pop ecx
ret
push edi
xor edi, edi
xor eax, eax
push 0
mov al, byte [edi + 0x7e1520]
push 1
lea ecx, [esp + 0x10]
push eax
push ecx
call fcn.004119b0
and eax, 0xff
add esp, 0x10
add esi, eax
inc edi
cmp edi, 0x10
jl 0x40f960
mov edx, dword [0x7e1530]
push 0
and edx, 0xff
push 1
lea eax, [esp + 0x10]
push edx
push eax
call fcn.004119b0
xor ecx, ecx
push 0
mov cl, byte [0x7e1533]
push 1
lea edx, [esp + 0x20]
and eax, 0xff
push ecx
push edx
add esi, eax
call fcn.004119b0
and eax, 0xff
add esp, 0x20
add esi, eax
mov edi, 0x7e1534
mov eax, dword [edi]
push 0
cmp eax, 0xffffffff
push 2
je 0x40f9ea
xor edx, edx
div dword [0x4b64f0]
push eax
lea eax, [esp + 0x14]
push eax
jmp 0x40f9f0
lea ecx, [esp + 0x10]
push eax
push ecx
call fcn.004119b0
and eax, 0xff
add edi, 4
add esp, 0x10
add esi, eax
cmp edi, 0x7e1554
jl 0x40f9cf
mov edx, dword [0x7e1638]
push 0
and edx, 0xffff
push 2
lea eax, [esp + 0x10]
push edx
push eax
call fcn.004119b0
and eax, 0xff
xor edx, edx
add esi, eax
mov eax, dword [0x7e163c]
div dword [0x4b64f0]
push 0
push 2
lea ecx, [esp + 0x20]
push eax
push ecx
call fcn.004119b0
and eax, 0xff
xor edx, edx
add esi, eax
mov eax, dword [0x7e1640]
div dword [0x4b64f0]
push 0
push 2
lea edx, [esp + 0x30]
push eax
push edx
call fcn.004119b0
and eax, 0xff
push 0
add esi, eax
xor eax, eax
mov al, byte [0x7e1531]
push 1
lea ecx, [esp + 0x40]
push eax
push ecx
call fcn.004119b0
add esp, 0x40
and eax, 0xff
xor edx, edx
add esi, eax
mov dl, byte [0x7e1532]
push 0
push 1
lea eax, [esp + 0x10]
push edx
push eax
call fcn.004119b0
xor ecx, ecx
push 0
mov cl, byte [0x7e1663]
push 1
lea edx, [esp + 0x20]
and eax, 0xff
push ecx
push edx
add esi, eax
call fcn.004119b0
and eax, 0xff
push 1
add esi, eax
mov eax, dword [0x7e1664]
and eax, 0xffff
push 2
lea ecx, [esp + 0x30]
push eax
push ecx
call fcn.004119b0
and eax, 0xff
xor edx, edx
mov dx, word [0x7e1666]
add esi, eax
push 1
push 2
lea eax, [esp + 0x40]
push edx
push eax
call fcn.004119b0
add esp, 0x40
xor ecx, ecx
mov cl, byte [0x7e1669]
lea edx, [esp + 8]
push 0
push 1
and eax, 0xff
push ecx
push edx
add esi, eax
call fcn.004119b0
and eax, 0xff
push 0
add esi, eax
mov eax, dword [0x7e1674]
and eax, 0xff
push 1
lea ecx, [esp + 0x20]
push eax
push ecx
call fcn.004119b0
and eax, 0xff
xor edx, edx
mov dx, word [0x7e1676]
add esi, eax
push 0
push 2
lea eax, [esp + 0x30]
push edx
push eax
call fcn.004119b0
mov ecx, dword [0x7e1678]
push 0
and ecx, 0xff
push 1
lea edx, [esp + 0x40]
and eax, 0xff
push ecx
push edx
add esi, eax
call fcn.004119b0
and eax, 0xff
add esp, 0x40
add esi, eax
xor eax, eax
mov ax, word [0x7e167a]
push 0
push 2
lea ecx, [esp + 0x10]
push eax
push ecx
call fcn.004119b0
mov edx, dword [0x7e167c]
and eax, 0xff
add esi, eax
push 0
and edx, 0xff
push 1
lea eax, [esp + 0x20]
push edx
push eax
call fcn.004119b0
xor ecx, ecx
push 0
mov cx, word [0x7e167e]
push 2
lea edx, [esp + 0x30]
and eax, 0xff
push ecx
push edx
add esi, eax
call fcn.004119b0
and eax, 0xff
xor edx, edx
add esi, eax
mov eax, dword [0x7e1644]
div dword [0x4b64f0]
push 0
push 2
push eax
lea eax, [esp + 0x44]
push eax
call fcn.004119b0
and eax, 0xff
xor edx, edx
add esi, eax
mov eax, dword [0x7e1648]
div dword [0x4b64f0]
add esp, 0x40
lea ecx, [esp + 8]
push 0
push 2
push eax
push ecx
call fcn.004119b0
mov edx, dword [0x7e164c]
and eax, 0xff
add esi, eax
push 0
and edx, 0xff
push 1
lea eax, [esp + 0x20]
push edx
push eax
call fcn.004119b0
xor ecx, ecx
push 0
mov cx, word [0x7e164e]
push 2
lea edx, [esp + 0x30]
and eax, 0xff
push ecx
push edx
add esi, eax
call fcn.004119b0
and eax, 0xff
push 0
add esi, eax
mov eax, dword [0x7e1650]
and eax, 0xffff
push 2
lea ecx, [esp + 0x40]
push eax
push ecx
call fcn.004119b0
add esp, 0x40
and eax, 0xff
xor edx, edx
add esi, eax
mov dx, word [0x7e1652]
push 0
push 2
lea eax, [esp + 0x10]
push edx
push eax
call fcn.004119b0
and eax, 0xff
add esp, 0x10
add esi, eax
cmp esi, 0x1f0
jge 0x40fce4
mov eax, 0x1f0
sub eax, esi
add esi, eax
mov ecx, dword [esp + 8]
mov byte [ecx], 0xff
mov edx, dword [esp + 8]
inc edx
dec eax
mov dword [esp + 8], edx
jne 0x40fcd1
cmp esi, 0x1f8
mov ecx, 0x7e16c8
jge 0x40fd0f
mov eax, 0x1f8
sub eax, esi
add esi, eax
mov edi, dword [esp + 8]
mov dl, byte [ecx]
mov byte [edi], dl
mov edx, dword [esp + 8]
inc edx
inc ecx
dec eax
mov dword [esp + 8], edx
jne 0x40fcfa
cmp esi, 0x200
mov ecx, 0x7e16d0
jge 0x40fd3a
mov eax, 0x200
sub eax, esi
add esi, eax
mov edi, dword [esp + 8]
mov dl, byte [ecx]
mov byte [edi], dl
mov edx, dword [esp + 8]
inc edx
inc ecx
dec eax
mov dword [esp + 8], edx
jne 0x40fd25
mov ax, si
pop edi
pop esi
pop ecx
ret