I have an obfuscated (p,a,c,k,e,d)
function from JavaScript.
string value = @"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("3b").3a({39:\"5://1b.1a.19.8:18/38/v.37\",36:\"5://1b.1a.19.8:18/i/35/34/33.32\",31:\"\",30:\"2z\",2y:\"2x\",2w:2v,2u:\"7\",2t:\"2s\",2r:[],2q:{2p:\'#2o\',2n:22,2m:\"2l\",2k:0}});b f;b k=0;b 6=0;3().2j(2(x){a(6>0)k+=x.17-6;6=x.17;a(0!=0&&k>=0){6=-1;3().2i();3().2h(2g);$(\'#2f\').j();$(\'h.g\').j()}});3().2e(2(x){6=-1});3().2d(2(x){16(x)});3().2c(2(){$(\'h.g\').j()});2 16(x){$(\'h.g\').2b();a(f)2a;f=1;$.29(\'5://12.9/15-28/27.15?26=25&24=23&21=20-1z-1y-1x-1w\',2(14){$(\'#1v\').1u(14)})};3().1t(\'1s\',2(){b 13=3().1r();13.1q(\'1p\',2(){11.10(\'z-y\')[0].w[1].1o=\"5://12.9\";11.10(\'z-y\')[0].w[1].1n=\"<u>1m - 1l 1k 1j & 1i</u>\"});a($.c(\'4\')==\"d\"){t.s(\"5://r.q.p/o/7.n\",\"m 9 1h\",e,\"l\")}1g{t.s(\"5://r.q.p/o/d.n\",\"m 9 1f\",e,\"l\")}});2 e(){$.c(\'4\')==\'7\'?4=\'d\':4=\'7\';$.c(\'4\',4);1e.1d.1c()};',36,120,'||function|jwplayer|primaryCookie|http|p02887336|html5||to|if|var|cookie|flash|switchMode|vvplay|video_ad|div||show|tt2887336|button2|Switch|png|images|tv|flashx|static|addButton|this|center||childNodes||featured|jw|getElementsByClassName|document|streamin|container|data|cgi|doPlay|position|8777|213|211|95|reload|location|window|Flash|else|HTML5|Storage|Sharing|Video|Free|Streamin|innerHTML|href|contextmenu|addEventListener|getContainer|ready|on|html|fviews|fb98c55a544241de2464a88086a6b0c9|1486917733|186|182|2887336|hash||2ca0tpqawtre|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|2638|duration|skin|jpg|lhl2j9yhfp1s|00085|01|image|mp4|rwi7bsgc5huzcg3h5fpsfen3362uwfp4cyzyo2mavczsvbbx4tnesmwhdteq|file|setup|vplayer'.split('|')))"
I am trying to use jint
to interpret and get the value of the above function
but when I execute the statement in jint engine
it throws an exception for jwplayer is not defined
.
I know why the exception is thrown but I only want to get the value of p
above. But jint
runs the whole function and then ends up with an empty function which doesn't exist and when it tries to run it, an exception is thrown.
I only want it to return the value in a string and it should not run it any further. I have already tried to search it for an answer but so far found nothing.
I am using the code as following:
Jint.Engine jEngine = new Jint.Engine();
var linkString = jEngine.Execute(value).GetCompletionValue().ToString();
var arrayFile = linkString.Split(' ', '\n');
Is something I am missing here? If someone can shed some light on it. That will be much appreciated. Thanks
I think the problem was eval
at the start of the packed function. It was running the code after getting the value. So I removed the eval
part and now it works as expected.