Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/446.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/272.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
解包JavaScript(p、a、c、k、e、d)函数_Javascript_C#_Uwp - Fatal编程技术网

解包JavaScript(p、a、c、k、e、d)函数

解包JavaScript(p、a、c、k、e、d)函数,javascript,c#,uwp,Javascript,C#,Uwp,我有一个UWP应用程序,我使用HtmlAgilityPack解析一些网页并在应用程序中显示信息。现在我遇到了一个页面,我需要执行一个函数来获取文档的下一个链接。 我在一个空白的UWP JavaScript应用程序中运行了特定的代码,并且能够看到链接。但是我不知道如何在C中运行函数。由于它是一种不同的语言,我需要创建自己的函数集来从数据中获取信息,还是必须链接任何JavaScript库(如果可能的话)来执行该操作 这是我从页面获得的函数,为了能够进一步导航,我需要运行它并从中获得生成的字符串 ev

我有一个UWP应用程序,我使用
HtmlAgilityPack
解析一些网页并在应用程序中显示信息。现在我遇到了一个页面,我需要执行一个函数来获取文档的下一个链接。
我在一个空白的
UWP JavaScript
应用程序中运行了特定的代码,并且能够看到链接。但是我不知道如何在
C
中运行函数。由于它是一种不同的语言,我需要创建自己的函数集来从数据中获取信息,还是必须链接任何JavaScript库(如果可能的话)来执行该操作

这是我从页面获得的
函数
,为了能够进一步导航,我需要运行它并从中获得生成的
字符串

eval(function (p, a, c, k, e, d)
{
while (c--)
    if (k[c])
        p = p.replace(new RegExp('\\b' + c.toString(a) + '\\b', 'g'), k[c]);
return p
} ('3("3a").39({38:"6://5.1c.1b.1a:19/37/v.36",35:"6://5.1c.1b.1a:19/i/34/33/15.32",31:"",30:"2z",2y:"2x",2w:2v,2u:"8",2t:"2s",2r:[],2q:{2p:\'#2o\',2n:22,2m:"2l",2k:0}});b f;b k=0;b 7=0;3().2j(2(x){a(7>0)k+=x.18-7;7=x.18;a(0!=0&&k>=0){7=-1;3().2i();3().2h(2g);$(\'#2f\').j();$(\'h.g\').j()}});3().2e(2(x){7=-1});3().2d(2(x){17(x)});3().2c(2(){$(\'h.g\').j()});2 17(x){$(\'h.g\').2b();a(f)2a;f=1;$.29(\'6://12.9/16-28/27.16?26=25&24=15&23=21-20-1z-1y-1x\',2(14){$(\'#1w\').1v(14)})};3().1u(\'1t\',2(){b 13=3().1s();13.1r(\'1q\',2(){11.10(\'z-y\')[0].w[1].1p="6://12.9";11.10(\'z-y\')[0].w[1].1o="<u>1n - 1m 1l 1k & 1j</u>"});a($.c(\'4\')=="d"){t.s("6://r.q.p/o/8.n","m 9 1i",e,"l")}1h{t.s("6://r.q.p/o/d.n","m 9 1g",e,"l")}});2 e(){$.c(\'4\')==\'8\'?4=\'d\':4=\'8\';$.c(\'4\',4);1f.1e.1d()};', 36, 119, '||function|jwplayer|primaryCookie||http|p09821659|html5|to|if|var|cookie|flash|switchMode|vvplay|video_ad|div||show|tt9821659|button2|Switch|png|images|tv|flashx|static|addButton|this|center||childNodes||featured|jw|getElementsByClassName|document|streamin|container|data|sgqbf1k6kqfh|cgi|doPlay|position|8777|106|81|79|reload|location|window|Flash|else|HTML5|Storage|Sharing|Video|Free|Streamin|innerHTML|href|contextmenu|addEventListener|getContainer|ready|on|html|fviews|3a8183ea9a69ef9630b94e14f10dd735|1484917924|186|182|9821659||hash|file_code|view|op|index_dl|bin|get|return|hide|onComplete|onPlay|onSeek|play_limit_box|false|setFullscreen|stop|onTime|backgroundOpacity|Arial|fontFamily|fontSize|FFFFFF|color|captions|tracks|start|startparam|primary|326|height|580|width|2567|duration|skin|jpg|01964|01|image|mp4|tcipboyrkduzcg3h5gtcldvuyiloqwnoa5padad4cgy4d5wmp77locnp4ypa|file|setup|vplayer'.split('|')))
eval(功能(p、a、c、k、e、d)
{
而(c--)
if(k[c])
p=p.replace(新的RegExp('\\b'+c.toString(a)+'\\b',g'),k[c]);
返回p
}3.3“3”(3“3“3”3“3”3“3”3“3”3”3”39(“38:“38:“6.1.1.1.1.1”1“35:“5.1.1.1”1“3”3“3”3”3“3”3”3“3”3:“3”3“3”3“3”3“3”3”3“3”3“3”3:“3”3:“3”3“2“Z”,2“Z”,2“Y:“Y:“2y:“2y:“2y:“2y:“2x”Y:“2x”,2y:“2y:“2x”,2x”,2w:2w:2w:2x”,2w:2w:2v,2v,2w:2v,2v,2v,2v,2v,2v,2w,2w,2u,2u,2u,2u,2u,2u,2u,2u,2u,2u=-1;3().2i();3().2h(2g);$(\'2f\').j();$(\'h.g\').j()});3().2e(2(x){7=-1});3().2d(2(x){17(x)};3().2c(2(){$“h.g.g\”).j());2 17(x)2(b)b(b)b(b(a)a(f)2a;f=1;1.29(6://6://12.9/16/16-28/27.16.16?26=25及24=15及23=15及25&24=15及23=25及25及24=15及23=21-20-20-15-1z-1y-1y-1x-1x-1x-1x-1x-1x-1x-1x,2-1x-1x,2(2(2(14)2(2(14)2(14)2(14)2(14)0(14)(1(14)0(14)1(14)1(14)(1(14)1v(14)(14)14)14)14)5)5)7(14(14)3)5)3)3(14)3)3(14)3)3)3)10(\'z-y\')[0].w[1].1o=“1n-1M1L1K&1j”);a($.c(\'4\')=“d”){t.s(“6://r.q.p/o/8.n”,“m 9 1i”,e,“l”)}1h{t.s(“6://r.q.p/o/d.n”,“m 9 1g”,e,“l”)});2E($.c(\'4\')===\'8\'?4='d\':4=\'8\';$.c(\'4\',4);1f.1e.1d())“36、36、119,”36、36、119,“36、119,”36、19、36、119,”36、36、119,“第12、36、36、119,,,,1244、36、36、119,,,,,,124?|第四方的”第四方的第三方的第三方的第四方的第四方的第四方的“功能”函数函数函数,J方的J方的功能,Jw1244层层的主要饼干|主要饼干|主要的饼干|饼干| http | http,http 12400 0 0 0 0政政政政政协0 0 0 0 0 0 0 0 0 0 0 0 9 9 9 9,http 124政政政政政政政政协,以及以及5 5 12499九九九九九九九九九九九九九,以及对对1245 1245 1245 1245124; jw | getElementsByClassName | document | streamin | container | data | sgqbf1k6kqfh | cgi | doPlay |位置| 8777 | 106 | 81 | 79 |重新加载|位置|“闪光”窗口(闪光)闪现(闪光)窗口(闪光)其他(其他)其他(其他)其他(其他)其他(其他)HTML5 5 5 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4)闪闪闪闪现(闪光)4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4|返回|隐藏|完成|玩|看|玩|限制|框|假|设置全屏|停止|即时|背景不透明度| Arial | fontFamily | fontSize | FFFFFF |颜色|字幕|轨道|开始|星图|主要| 326 |高度| 580 |宽度| 2567 |持续时间|皮肤| jpg | 01964 | 01 |图像| mp4 | TCIPBOYRKDUZCG3 | GTCLDVUYLOQWnoa5Paday4D5c5WMNp774YPA | | | |文件设置(| | |分割层)
那么有可能用C语言实现吗?如果有,我该怎么做? 谢谢

[编辑]
我在寻找一种方法时发现了它。它非常相似,但仍需要一些调整才能完成。我理解其中的一些部分,但
Regex
部分完全不适合我。
其他人知道它是否能适应我的情况吗?

我找到了(上面也提到了)关于如何做的好文章。有人用C#编写了这个
Regex来解决他们自己的问题。我很高兴地说它帮助了我,所以我打算把它放在这里,以防将来有人需要它

string inputHtml = @"the function you get from scraping the page";
string[] data = Regex.Match(inputHtml, "'([a-zA-Z0-9_|]{30,})'").Groups[1].Value.Split('|');
上面的代码片段将为您提供一个不同字符串的数组,您可以通过它们查找需要获得的任何信息。
我在两个网站上也取得了一些进展,我将与大家分享我使用的代码,以便将来对其他人有所帮助

我正在使用我的应用程序中的以下代码片段来获取从“estream.to”“streamin.to”的视频链接

if (videoLink.Host == "estream.to")
{
   IEnumerable<HtmlNode> links = doc.DocumentNode.Descendants("script").Where(l => l.Attributes.Contains("type") && (l.InnerText.Contains("mp4") || l.InnerText.Contains("m3u8")) && l.InnerText.Contains("(p,a,c,k,e,d)"));
    foreach (var link in links)
    {
       value = link.InnerText;
       if (value.Contains("mp4"))
       {
          value = link.InnerText;
          break;
       }
    }
    string[] data = Regex.Match(value, "'([a-zA-Z0-9_|]{30,})'").Groups[1].Value.Split('|');
    if (data.Count() > 20)
    {
       value = string.Format("https://{0}.{1}.{2}/hls/{3}/index-v1-a1.m3u8", data[10], data[4], data[3], data[17]);
    }


    }
    else if (videoLink.Host == "streamin.to")
    {
         IEnumerable<HtmlNode> links = doc.DocumentNode.Descendants("script").Where(l => l.Attributes.Contains("type") && (l.InnerText.Contains("mp4") || l.InnerText.Contains("m3u8")) && l.InnerText.Contains("(p,a,c,k,e,d)"));
    foreach (var link in links)
    {
       value = link.InnerText;
       if (value.Contains("mp4"))
       {
           value = link.InnerText;
           break;
       }
    }
    string[] data = Regex.Match(value, "'([a-zA-Z0-9_|]{30,})'").Groups[1].Value.Split('|');
    if (data.Count() > 20)
    {
        List<int> ip = new List<int>();
        for (int x = 41; x <= 50; x++)
        {
           //check ip
           int val = 0;
           int.TryParse(data[x], out val);
           if (val != 0)
           {
              ip.Add(val);
           }
        }
        if (ip.Count > 0)
        {
           int[] ipValue = ip.ToArray();
           string secondParam = "";
           for (int x = 0; x < data.Count(); x++)
           {
               // string length is more than 50
               if (data[x].Length > 50)
               {
                  secondParam = data[x];
               }
           }
  // Edit: I have come across a problem with this so I am updating the answer.
           if (ipValue.Count() == 4)
           {
              value = string.Format("http://5.{0}.{1}.{2}:{3}/{4}/v.mp4", ipValue[3], ipValue[2], ipValue[1], ipValue[0], secondParam);
           }
           else if (ipValue.Count() == 5)
           {
              value = string.Format("http://{0}.{1}.{2}.{3}:{4}/{5}/v.mp4", ipValue[4], ipValue[3], ipValue[2], ipValue[1], ipValue[0], secondParam);
           }
           else
           {
              // this is where the problem occurs 
           }
        }
    }
if(videoLink.Host==“estream.to”)
{
IEnumerable links=doc.DocumentNode.substands(“script”)。其中(l=>l.Attributes.Contains(“type”)&&(l.InnerText.Contains(“mp4”)| | l.InnerText.Contains(“m3u8”)&&l.InnerText.Contains(“p,a,c,k,e,d”);
foreach(链接中的var链接)
{
值=link.InnerText;
if(值包含(“mp4”))
{
值=link.InnerText;
打破
}
}
string[]data=Regex.Match(value,“([a-zA-Z0-9|]{30,}”)。Groups[1]。value.Split(“|”);
如果(data.Count()>20)
{
value=string.Format(“https://{0}.{1}.{2}/hls/{3}/index-v1-a1.m3u8”,数据[10],数据[4],数据[3],数据[17]);
}
}
else if(videoLink.Host==“streamin.to”)
{
IEnumerable links=doc.DocumentNode.substands(“script”)。其中(l=>l.Attributes.Contains(“type”)&&(l.InnerText.Contains(“mp4”)| | l.InnerText.Contains(“m3u8”)&&l.InnerText.Contains(“p,a,c,k,e,d”);
foreach(链接中的var链接)
{
值=link.InnerText;
if(值包含(“mp4”))
{
值=link.InnerText;
打破
}
}
string[]data=Regex.Match(value,“([a-zA-Z0-9|]{30,}”)。Groups[1]。value.Split(“|”);
如果(data.Count()>20)
{
列表ip=新列表();
对于(int x=41;x 0)
{
int[]ipValue=ip.ToArray();
字符串secondParam=“”;
对于(int x=0;x50)
{
secondParam=数据[x];
}
}
//编辑:我遇到了这个问题,所以我正在更新答案。
if(ipValue.Count()==4)
{
值=字符串。格式(“http://5.{0}.{1}.{2}:{3}/{4}/v.mp4',ipValue[3],ipValue[2],ipValue[1],ipValue[0],secondParam);
}
else if(ipValue.Count()==5)
{
value=string.Format(“http://{0}.{1}.{2}.{3}:{4}/{5}/v.mp4”、ipValue[4]、ipValue[3]、ipValue[2]、ipValue[1]、ipValue[0]、secondParam);
}
其他的
{
//这就是问题所在
}
}
}
希望