Function at 0x40f3a0
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ecx
push esi
mov esi, ecx
cmp dword [esi + 8], 0x1ff80
jbe 0x40f3bc
push 0
call fcn.0040f0f0
test eax, eax
jne 0x40fc73
push ebx
push ebp
push edi
mov edi, dword [esp + 0x18]
test edi, edi
jle 0x40f3cd
lea edi, [edi + edi - 1]
jmp 0x40f3d1
neg edi
shl edi, 1
mov ecx, dword [esp + 0x1c]
mov ebx, dword [ecx + 4]
lea eax, [edi + 1]
cdq
sub eax, edx
sar eax, 1
lea edx, [ebx + 0x10]
shr edx, 5
sub eax, edx
mov edx, dword [ecx]
add eax, ebx
mov dword [ecx + 4], eax
cmp eax, dword [edx*4 + 0x422338]
jae 0x40f3fb
dec edx
jmp 0x40f405
cmp eax, dword [edx*4 + 0x42233c]
jb 0x40f407
inc edx
mov dword [ecx], edx
mov eax, ebx
cdq
and edx, 0x1f
add eax, edx
sar eax, 5
cmp eax, 1
mov ecx, eax
jg 0x40f41e
mov ecx, 1
mov eax, edi
cdq
idiv ecx
mov dword [esp + 0x18], ecx
mov ebp, 8
mov edx, eax
imul edx, ecx
mov ecx, dword [esi + 0x10]
sub edi, edx
cmp eax, 0x3f
mov dword [esp + 0x10], edi
jge 0x40f55c
cmp ecx, 0x800000
ja 0x40f53f
mov ebx, 0x800000
mov ecx, dword [esi + 0xc]
cmp ecx, 0x7f800000
jae 0x40f4d1
mov edx, dword [esi + 8]
mov edi, dword [esi]
mov ecx, edx
shr ecx, 5
lea edi, [edi + ecx*4]
and edx, 0x1f
mov ecx, 0x18
sub ecx, edx
movzx edx, byte [esi + 0x18]
shl edx, cl
or dword [edi], edx
mov edi, dword [esi + 8]
mov edx, dword [esi + 0x14]
add edi, ebp
test edx, edx
mov dword [esi + 8], edi
mov ecx, edi
je 0x40f4c4
nop
mov edi, dword [esi]
mov edx, ecx
shr edx, 5
lea edx, [edi + edx*4]
mov edi, ecx
and edi, 0x1f
mov ecx, 0x18
sub ecx, edi
mov edi, 0xff
shl edi, cl
or dword [edx], edi
mov ecx, dword [esi + 8]
mov edi, dword [esi + 0x14]
add ecx, ebp
dec edi
mov edx, edi
test edx, edx
mov dword [esi + 8], ecx
mov dword [esi + 0x14], edi
jne 0x40f490
mov ecx, dword [esi + 0xc]
mov edx, ecx
shr edx, 0x17
mov byte [esi + 0x18], dl
jmp 0x40f520
test ecx, ecx
jns 0x40f51d
mov edx, dword [esi + 8]
mov edi, dword [esi]
mov ecx, edx
shr ecx, 5
lea edi, [edi + ecx*4]
and edx, 0x1f
mov ecx, 0x18
sub ecx, edx
xor edx, edx
mov dl, byte [esi + 0x18]
inc edx
and edx, 0xff
shl edx, cl
or dword [edi], edx
mov ecx, dword [esi + 0x14]
lea edx, [ecx*8 + 8]
add dword [esi + 8], edx
mov ecx, dword [esi + 0xc]
mov edx, ecx
shr edx, 0x17
mov dword [esi + 0x14], 0
mov byte [esi + 0x18], dl
jmp 0x40f520
inc dword [esi + 0x14]
mov edx, dword [esi + 0x10]
and ecx, 0x7fffff
shl ecx, 8
shl edx, 8
mov dword [esi + 0xc], ecx
mov ecx, edx
cmp ecx, ebx
mov dword [esi + 0x10], edx
jbe 0x40f454
movzx ecx, word [esi + 0x12]
mov edx, dword [eax*4 + 0x4224b8]
imul edx, ecx
mov dword [esi + 0x10], edx
mov eax, dword [eax*4 + 0x4223b8]
jmp 0x40f8ab
cmp ecx, 0x800000
ja 0x40f65f
mov ebx, 0x800000
lea ecx, [ecx]
mov ecx, dword [esi + 0xc]
cmp ecx, 0x7f800000
jae 0x40f5f1
mov edx, dword [esi + 8]
mov edi, dword [esi]
mov ecx, edx
shr ecx, 5
lea edi, [edi + ecx*4]
and edx, 0x1f
mov ecx, 0x18
sub ecx, edx
movzx edx, byte [esi + 0x18]
shl edx, cl
or dword [edi], edx
mov edi, dword [esi + 8]
mov edx, dword [esi + 0x14]
add edi, ebp
test edx, edx
mov dword [esi + 8], edi
mov ecx, edi
je 0x40f5e4
jmp 0x40f5b0
mov edi, dword [esi]
mov edx, ecx
shr edx, 5
lea edx, [edi + edx*4]
mov edi, ecx
and edi, 0x1f
mov ecx, 0x18
sub ecx, edi
mov edi, 0xff
shl edi, cl
or dword [edx], edi
mov ecx, dword [esi + 8]
mov edi, dword [esi + 0x14]
add ecx, ebp
dec edi
mov edx, edi
test edx, edx
mov dword [esi + 8], ecx
mov dword [esi + 0x14], edi
jne 0x40f5b0
mov ecx, dword [esi + 0xc]
mov edx, ecx
shr edx, 0x17
mov byte [esi + 0x18], dl
jmp 0x40f640
test ecx, ecx
jns 0x40f63d
mov edx, dword [esi + 8]
mov edi, dword [esi]
mov ecx, edx
shr ecx, 5
lea edi, [edi + ecx*4]
and edx, 0x1f
mov ecx, 0x18
sub ecx, edx
xor edx, edx
mov dl, byte [esi + 0x18]
inc edx
and edx, 0xff
shl edx, cl
or dword [edi], edx
mov ecx, dword [esi + 0x14]
lea edx, [ecx*8 + 8]
add dword [esi + 8], edx
mov ecx, dword [esi + 0xc]
mov edx, ecx
shr edx, 0x17
mov dword [esi + 0x14], 0
mov byte [esi + 0x18], dl
jmp 0x40f640
inc dword [esi + 0x14]
mov edx, dword [esi + 0x10]
and ecx, 0x7fffff
shl ecx, 8
shl edx, 8
mov dword [esi + 0xc], ecx
mov ecx, edx
cmp ecx, ebx
mov dword [esi + 0x10], edx
jbe 0x40f570
movzx ecx, word [esi + 0x12]
mov edi, dword [esi + 0xc]
mov edx, ecx
imul edx, edx, 0xffff
add edi, edx
mov ebx, 0x800000
cmp ecx, ebx
mov dword [esi + 0x10], ecx
mov dword [esi + 0xc], edi
ja 0x40f77f
jmp 0x40f690
mov ecx, dword [esi + 0xc]
cmp ecx, 0x7f800000
jae 0x40f711
mov edx, dword [esi + 8]
mov edi, dword [esi]
mov ecx, edx
shr ecx, 5
lea edi, [edi + ecx*4]
and edx, 0x1f
mov ecx, 0x18
sub ecx, edx
movzx edx, byte [esi + 0x18]
shl edx, cl
or dword [edi], edx
mov edi, dword [esi + 8]
mov edx, dword [esi + 0x14]
add edi, ebp
test edx, edx
mov dword [esi + 8], edi
mov ecx, edi
je 0x40f704
nop
mov edi, dword [esi]
mov edx, ecx
shr edx, 5
lea edx, [edi + edx*4]
mov edi, ecx
and edi, 0x1f
mov ecx, 0x18
sub ecx, edi
mov edi, 0xff
shl edi, cl
or dword [edx], edi
mov ecx, dword [esi + 8]
mov edi, dword [esi + 0x14]
add ecx, ebp
dec edi
mov edx, edi
test edx, edx
mov dword [esi + 8], ecx
mov dword [esi + 0x14], edi
jne 0x40f6d0
mov ecx, dword [esi + 0xc]
mov edx, ecx
shr edx, 0x17
mov byte [esi + 0x18], dl
jmp 0x40f760
test ecx, ecx
jns 0x40f75d
mov edx, dword [esi + 8]
mov edi, dword [esi]
mov ecx, edx
shr ecx, 5
lea edi, [edi + ecx*4]
and edx, 0x1f
mov ecx, 0x18
sub ecx, edx
xor edx, edx
mov dl, byte [esi + 0x18]
inc edx
and edx, 0xff
shl edx, cl
or dword [edi], edx
mov ecx, dword [esi + 0x14]
lea edx, [ecx*8 + 8]
add dword [esi + 8], edx
mov ecx, dword [esi + 0xc]
mov edx, ecx
shr edx, 0x17
mov dword [esi + 0x14], 0
mov byte [esi + 0x18], dl
jmp 0x40f760
inc dword [esi + 0x14]
mov edx, dword [esi + 0x10]
and ecx, 0x7fffff
shl ecx, 8
shl edx, 8
mov dword [esi + 0xc], ecx
mov ecx, edx
cmp ecx, ebx
mov dword [esi + 0x10], edx
jbe 0x40f690
movzx ecx, word [esi + 0x12]
mov edi, dword [esi + 0xc]
mov edx, eax
sar edx, 0x10
and edx, 0xffff
imul edx, ecx
add edi, edx
cmp ecx, ebx
mov dword [esi + 0x10], ecx
mov dword [esi + 0xc], edi
ja 0x40f89f
jmp 0x40f7b0
mov ecx, dword [esi + 0xc]
cmp ecx, 0x7f800000
jae 0x40f831
mov edx, dword [esi + 8]
mov edi, dword [esi]
mov ecx, edx
shr ecx, 5
lea edi, [edi + ecx*4]
and edx, 0x1f
mov ecx, 0x18
sub ecx, edx
movzx edx, byte [esi + 0x18]
shl edx, cl
or dword [edi], edx
mov edi, dword [esi + 8]
mov edx, dword [esi + 0x14]
add edi, ebp
test edx, edx
mov dword [esi + 8], edi
mov ecx, edi
je 0x40f824
nop
mov edi, dword [esi]
mov edx, ecx
shr edx, 5
lea edx, [edi + edx*4]
mov edi, ecx
and edi, 0x1f
mov ecx, 0x18
sub ecx, edi
mov edi, 0xff
shl edi, cl
or dword [edx], edi
mov ecx, dword [esi + 8]
mov edi, dword [esi + 0x14]
add ecx, ebp
dec edi
mov edx, edi
test edx, edx
mov dword [esi + 8], ecx
mov dword [esi + 0x14], edi
jne 0x40f7f0
mov ecx, dword [esi + 0xc]
mov edx, ecx
shr edx, 0x17
mov byte [esi + 0x18], dl
jmp 0x40f880
test ecx, ecx
jns 0x40f87d
mov edx, dword [esi + 8]
mov edi, dword [esi]
mov ecx, edx
shr ecx, 5
lea edi, [edi + ecx*4]
and edx, 0x1f
mov ecx, 0x18
sub ecx, edx
xor edx, edx
mov dl, byte [esi + 0x18]
inc edx
and edx, 0xff
shl edx, cl
or dword [edi], edx
mov ecx, dword [esi + 0x14]
lea edx, [ecx*8 + 8]
add dword [esi + 8], edx
mov ecx, dword [esi + 0xc]
mov edx, ecx
shr edx, 0x17
mov dword [esi + 0x14], 0
mov byte [esi + 0x18], dl
jmp 0x40f880
inc dword [esi + 0x14]
mov edx, dword [esi + 0x10]
and ecx, 0x7fffff
shl ecx, 8
shl edx, 8
mov dword [esi + 0xc], ecx
mov ecx, edx
cmp ecx, ebx
mov dword [esi + 0x10], edx
jbe 0x40f7b0
movzx ecx, word [esi + 0x12]
mov dword [esi + 0x10], ecx
and eax, 0xffff
imul eax, ecx
mov ecx, dword [esi + 0xc]
add ecx, eax
mov eax, dword [esp + 0x18]
cmp eax, 0x10000
mov dword [esi + 0xc], ecx
jl 0x40fb47
xor ebx, ebx
xor ecx, ecx
cmp eax, ebx
jle 0x40f8d9
lea ecx, [ecx]
inc ecx
mov edx, eax
sar edx, cl
test edx, edx
jg 0x40f8d0
mov eax, dword [esp + 0x18]
add ecx, 0xfffffff0
mov edi, 1
shl edi, cl
cdq
idiv edi
mov dword [esp + 0x1c], edi
mov edi, eax
mov eax, dword [esp + 0x10]
cdq
idiv dword [esp + 0x1c]
inc edi
mov dword [esp + 0x18], eax
cmp dword [esi + 0x10], 0x800000
mov dword [esp + 0x10], edx
ja 0x40f9ff
nop
mov eax, dword [esi + 0xc]
cmp eax, 0x7f800000
jae 0x40f98f
mov eax, dword [esi + 8]
mov edx, dword [esi]
mov ecx, eax
shr ecx, 5
lea edx, [edx + ecx*4]
and eax, 0x1f
mov ecx, 0x18
sub ecx, eax
movzx eax, byte [esi + 0x18]
shl eax, cl
or dword [edx], eax
mov edx, dword [esi + 8]
mov ecx, dword [esi + 0x14]
add edx, ebp
cmp ecx, ebx
mov dword [esi + 8], edx
mov eax, edx
je 0x40f982
mov edi, edi
mov edx, dword [esi]
mov ecx, eax
shr ecx, 5
lea edx, [edx + ecx*4]
and eax, 0x1f
mov ecx, 0x18
sub ecx, eax
mov eax, 0xff
shl eax, cl
or dword [edx], eax
mov eax, dword [esi + 8]
mov edx, dword [esi + 0x14]
add eax, ebp
dec edx
mov ecx, edx
cmp ecx, ebx
mov dword [esi + 8], eax
mov dword [esi + 0x14], edx
jne 0x40f950
mov eax, dword [esi + 0xc]
mov ecx, eax
shr ecx, 0x17
mov byte [esi + 0x18], cl
jmp 0x40f9de
test eax, eax
jns 0x40f9db
mov eax, dword [esi + 8]
mov ecx, dword [esi]
mov edx, eax
and eax, 0x1f
shr edx, 5
lea edx, [ecx + edx*4]
mov ecx, 0x18
sub ecx, eax
xor eax, eax
mov al, byte [esi + 0x18]
inc eax
and eax, 0xff
shl eax, cl
or dword [edx], eax
mov ecx, dword [esi + 0x14]
mov eax, dword [esi + 8]
lea edx, [ecx*8 + 8]
add eax, edx
mov dword [esi + 8], eax
mov eax, dword [esi + 0xc]
mov ecx, eax
shr ecx, 0x17
mov dword [esi + 0x14], ebx
mov byte [esi + 0x18], cl
jmp 0x40f9de
inc dword [esi + 0x14]
mov ecx, dword [esi + 0x10]
and eax, 0x7fffff
shl eax, 8
shl ecx, 8
mov dword [esi + 0xc], eax
mov eax, ecx
cmp eax, 0x800000
mov dword [esi + 0x10], ecx
jbe 0x40f910
mov eax, dword [esi + 0x10]
xor edx, edx
div edi
mov edi, dword [esi + 0xc]
mov edx, eax
imul edx, dword [esp + 0x18]
add edi, edx
cmp eax, 0x800000
mov dword [esi + 0x10], eax
mov dword [esi + 0xc], edi
ja 0x40fb24
jmp 0x40fa30
mov eax, dword [esi + 0xc]
cmp eax, 0x7f800000
jae 0x40fab4
mov eax, dword [esi + 8]
mov edx, dword [esi]
mov ecx, eax
shr ecx, 5
mov edi, dword [edx + ecx*4]
lea edx, [edx + ecx*4]
and eax, 0x1f
mov ecx, 0x18
sub ecx, eax
movzx eax, byte [esi + 0x18]
shl eax, cl
or edi, eax
mov dword [edx], edi
mov edx, dword [esi + 8]
mov ecx, dword [esi + 0x14]
add edx, ebp
cmp ecx, ebx
mov dword [esi + 8], edx
mov eax, edx
je 0x40faa7
mov edx, dword [esi]
mov ecx, eax
shr ecx, 5
lea edx, [edx + ecx*4]
and eax, 0x1f
mov ecx, 0x18
sub ecx, eax
mov eax, 0xff
shl eax, cl
or dword [edx], eax
mov edi, dword [esi + 8]
mov edx, dword [esi + 0x14]
add edi, ebp
dec edx
mov ecx, edx
cmp ecx, ebx
mov dword [esi + 8], edi
mov eax, edi
mov dword [esi + 0x14], edx
jne 0x40fa73
mov eax, dword [esi + 0xc]
mov ecx, eax
shr ecx, 0x17
mov byte [esi + 0x18], cl
jmp 0x40fb03
test eax, eax
jns 0x40fb00
mov eax, dword [esi + 8]
mov ecx, dword [esi]
mov edx, eax
and eax, 0x1f
shr edx, 5
lea edx, [ecx + edx*4]
mov ecx, 0x18
sub ecx, eax
xor eax, eax
mov al, byte [esi + 0x18]
inc eax
and eax, 0xff
shl eax, cl
or dword [edx], eax
mov ecx, dword [esi + 0x14]
mov edi, dword [esi + 8]
mov eax, dword [esi + 0xc]
lea edx, [ecx*8 + 8]
add edi, edx
mov ecx, eax
shr ecx, 0x17
mov dword [esi + 8], edi
mov dword [esi + 0x14], ebx
mov byte [esi + 0x18], cl
jmp 0x40fb03
inc dword [esi + 0x14]
mov ecx, dword [esi + 0x10]
and eax, 0x7fffff
shl eax, 8
shl ecx, 8
mov dword [esi + 0xc], eax
mov eax, ecx
cmp eax, 0x800000
mov dword [esi + 0x10], ecx
jbe 0x40fa30
mov eax, dword [esi + 0x10]
xor edx, edx
div dword [esp + 0x1c]
mov ecx, dword [esi + 0xc]
pop edi
pop ebp
pop ebx
mov dword [esi + 0x10], eax
imul eax, dword [esp + 4]
add ecx, eax
mov dword [esi + 0xc], ecx
xor eax, eax
pop esi
pop ecx
ret 8
cmp dword [esi + 0x10], 0x800000
ja 0x40fc55
mov edi, 0x800000
lea esp, [esp]
mov eax, dword [esi + 0xc]
cmp eax, 0x7f800000
jae 0x40fbe4
mov eax, dword [esi + 8]
mov ecx, dword [esi]
mov edx, eax
shr edx, 5
mov ebx, dword [ecx + edx*4]
lea edx, [ecx + edx*4]
and eax, 0x1f
mov ecx, 0x18
sub ecx, eax
movzx eax, byte [esi + 0x18]
shl eax, cl
or ebx, eax
mov dword [edx], ebx
mov edx, dword [esi + 8]
mov ecx, dword [esi + 0x14]
add edx, ebp
test ecx, ecx
mov dword [esi + 8], edx
mov eax, edx
je 0x40fbd7
mov edx, dword [esi]
mov ecx, eax
shr ecx, 5
lea edx, [edx + ecx*4]
and eax, 0x1f
mov ecx, 0x18
sub ecx, eax
mov eax, 0xff
shl eax, cl
or dword [edx], eax
mov ebx, dword [esi + 8]
mov edx, dword [esi + 0x14]
add ebx, ebp
dec edx
mov ecx, edx
test ecx, ecx
mov dword [esi + 8], ebx
mov eax, ebx
mov dword [esi + 0x14], edx
jne 0x40fba3
mov eax, dword [esi + 0xc]
mov ecx, eax
shr ecx, 0x17
mov byte [esi + 0x18], cl
jmp 0x40fc37
test eax, eax
jns 0x40fc34
mov eax, dword [esi + 8]
mov ecx, dword [esi]
mov edx, eax
and eax, 0x1f
shr edx, 5
lea edx, [ecx + edx*4]
mov ecx, 0x18
sub ecx, eax
xor eax, eax
mov al, byte [esi + 0x18]
inc eax
and eax, 0xff
shl eax, cl
or dword [edx], eax
mov ecx, dword [esi + 0x14]
mov ebx, dword [esi + 8]
mov eax, dword [esi + 0xc]
lea edx, [ecx*8 + 8]
add ebx, edx
mov ecx, eax
shr ecx, 0x17
mov dword [esi + 8], ebx
mov dword [esi + 0x14], 0
mov byte [esi + 0x18], cl
jmp 0x40fc37
inc dword [esi + 0x14]
mov ecx, dword [esi + 0x10]
and eax, 0x7fffff
shl eax, 8
shl ecx, 8
mov dword [esi + 0xc], eax
mov eax, ecx
cmp eax, edi
mov dword [esi + 0x10], ecx
jbe 0x40fb60
mov eax, dword [esi + 0x10]
xor edx, edx
div dword [esp + 0x18]
mov ecx, dword [esi + 0xc]
pop edi
pop ebp
pop ebx
mov dword [esi + 0x10], eax
imul eax, dword [esp + 4]
add ecx, eax
mov dword [esi + 0xc], ecx
xor eax, eax
pop esi
pop ecx
ret 8