Use VBA for JS anti-aliasing, to restore JS code.

Source: Internet
Author: User

This address: http://www.cnblogs.com/Charltsing/p/JSEval.html

Contact qq:564955427

Similar to the following code is logged into the National Enterprise credit Information System (Anhui) (Web site: http://www.ahcredit.gov.cn/search.jspx), the need to be anti-confusion.

Eval (function (p,a,c,k,e,d) {e=function (c) {return (c<a? ": E (parseint (C/A))) + ((c=c%a) >32?) String.fromCharCode (c+32): C.tostring ()};if (! ". Replace (/^/,string)) {while (c--) d[e (c)]=k[c]| | E (c); K=[function (e) {return d[e]}];e=function () {return ' \\w+ '};c=1};while (c--) if (K[c]) p=p.replace (New RegExp (' \\b ') +e (c) + ' \\b ', ' G '), k[c]); return p} (' c= "J"; 19= "H"; 1a= "K"; 10=c;14 e = "d+/="; I f (Z) {, M, q;14 N, O, p; Q = Z.R; M = 0; T = ""; (M < Q) {n = Z.R (m++) & 6; N (M = = Q) {T + = E.Q (n >> a); T + = E.q ((n & 1) << B); T + = "= ="; m;} o = Z.R (m++); N (M = = Q) {T + = E.Q (n >> a); T + = E.Q (((N & 1) << b) | ((O & 5) >> B)); T + = E.Q ((O & 4) << a); T + = "="; m;} p = Z.R (m++); T + = E.Q (n >> a); T + = E.Q (((N & 1) << b) | ((O & 5) >> B)); T + = E.q (((O & 4) << a) | ((P & 3) >> c)); T + = E.Q (P & 2);} V T;} I G () {15= 18.p| | a.b.t| | a.l.t;14 j= 18.o| | a.b.s| | A.L.S; N (15*j <= 8) {V 13;} 1c = 18.X;14 1d = 18.Y; N (1c + <= 0 | | 1d + J <= 0 | | 1c >= 18.W.17 | | 1d >= 18.W.L) {V 13;} V F;} I g () {19+1a;14 K = 0;14 M    = 0; H (M = 0; M < 11.R; m++) {K + = 11.R (M);} K *= 9; K + = 7; V "I" +K;} I e () {N (G ()) {} D {+ W = "";w = "1b=" +f (10.12 ()) + "; u=/"; A.V = W; u = g (), W = "19=" +f (u.12 ()) + "; u=/"; A.V = W; 18.s=c;}} E (); ', 59,73, ' 0|0x3|0x3f|0xc0|0xf|0xf0|0xff|111111|120000|17|2|4|6| abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz0123456789| hxxttkkllppp5| ktky2rbd9nhpbcihv9zmeqqdarslvfdu| Qwertasdfgxysf| randomstr11457| wzws_confirm_prefix_label6|/| Strrandom11457|body|break|c1|c2|c3|charat|charcodeat|clientheight|clientwidth|confirm|cookie|cookiestring| Document|documentelement|dynamicurl|else|encoderchars|false|finddimensions|for|function|h|hash|height|i|if| Innerheight|innerwidth|len|length|location|out|path|return|screen|screenx|screeny|str|template|tmp|tostring| True|var|w|while|width|window|wzwschallenge|wzwschallengex|wzwstemplate|x|y '. Split (' | '), 0,{}))

In general, JS anti-aliasing is not complicated, the outermost eval replaced document.write, the real code can be seen. But how do you implement this in VBA?

Take a look at the following code:

Dim odoc as Object,html
Set odoc = CreateObject ("Htmlfile")
Html= above the JS
' Construct an HTML, replace the eval inside JS with document.write, do the anti-confusion
html = "document.write (" & Right (HTML, Len (HTML)-5)
Odoc.write ("html = "<script>" & HTML & "</script>"
Odoc.write (HTML)
Odoc.write ("html = ODoc.body.innertext ' anti-aliasing result. The string inside the innertext is after the HTML escape.

The rest of the matter, is the VBA call JS, directly with Msscriptcontrol.scriptcontrol Addcode after, then Eval can. JS code beautification and anti-aliasing can be tested with this site http://jsbeautifier.org/

Just one thing to note: under 64-bit Office, the ScriptControl component needs to be packaged in Mshta.exe to run. Do not repeat the details.

This address: http://www.cnblogs.com/Charltsing/p/JSEval.html

Use VBA for JS anti-aliasing, to restore JS code.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.