找回密码
 加入
搜索
查看: 4209|回复: 6

[系统综合] 一个js函数求高手转成au3函数【已解决】

  [复制链接]
发表于 2012-2-22 22:43:13 | 显示全部楼层 |阅读模式
本帖最后由 netsmu 于 2012-2-28 19:47 编辑

我已经把js函数整合到htm中了,把下面代码保存为htm直接打开就可以了。
<html>
<head>
<script type="text/javascript">

function formSubmit(qq,ww) {
        var b = decrypt(qq, ww);
        var d = computechildpath(b);
        return d
    }

function computechildpath(b) {
        var c = b.charAt(0).charCodeAt();
        var d = c % 30;
        var a = d % 8 + 2;
        return b.substring(d, d + a)
    }
function decrypt(f, c) {
    var b = new Array(2),
    a = new Array(4),
    e = "",
    d;
    for (var d = 0; d < 4; d++) {
        a[d] = Str4ToLong(c.slice(d * 4, (d + 1) * 4))
    }
    f = decodeBase64(f);
    f = unescCtrlCh(f);
    for (d = 0; d < f.length; d += 8) {
        b[0] = Str4ToLong(f.slice(d, d + 4));
        b[1] = Str4ToLong(f.slice(d + 4, d + 8));
        decode(b, a);
        e += LongToStr4(b[0]) + LongToStr4(b[1])
    }
    e = e.replace(/\0+$/, "");
    return unescape(e)
}

function decode(b, a) {
    var f = b[0],
    d = b[1];
    var e = 2654435769,
    c = e * 32;
    while (c != 0) {
        d -= (f << 4 ^ f >>> 5) + f ^ c + a[c >>> 11 & 3];
        c -= e;
        f -= (d << 4 ^ d >>> 5) + d ^ c + a[c & 3]
    }
    b[0] = f;
    b[1] = d
}

function Str4ToLong(c) {
    var a = 0;
    for (var b = 0; b < 4; b++) {
        a |= c.charCodeAt(b) << b * 8
    }
    return isNaN(a) ? 0 : a
}
function LongToStr4(a) {
    var b = String.fromCharCode(a & 255, a >> 8 & 255, a >> 16 & 255, a >> 24 & 255);
    return b
}

function unescCtrlCh(a) {
    return a.replace(/!\d\d?\d?!/g,
    function(b) {
        return String.fromCharCode(b.slice(1, -1))
    })
}
var END_OF_INPUT = -1;
var base64Chars = new Array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "+", "/");
var reverseBase64Chars = new Array();
for (var i = 0; i < base64Chars.length; i++) {
    reverseBase64Chars[base64Chars[i]] = i
}
var base64Str;
var base64Count;
function setBase64Str(a) {
    base64Str = a;
    base64Count = 0
}
function readReverseBase64() {
    if (!base64Str) {
        return END_OF_INPUT
    }
    while (true) {
        if (base64Count >= base64Str.length) {
            return END_OF_INPUT
        }
        var a = base64Str.charAt(base64Count);
        base64Count++;
        if (reverseBase64Chars[a]) {
            return reverseBase64Chars[a]
        }
        if (a == "A") {
            return 0
        }
    }
    return END_OF_INPUT
}
function ntos(a) {
    a = a.toString(16);
    if (a.length == 1) {
        a = "0" + a
    }
    a = "%" + a;
    return unescape(a)
}
function decodeBase64(d) {
    setBase64Str(d);
    var a = "";
    var c = new Array(4);
    var b = false;
    while (!b && (c[0] = readReverseBase64()) != END_OF_INPUT && (c[1] = readReverseBase64()) != END_OF_INPUT) {
        c[2] = readReverseBase64();
        c[3] = readReverseBase64();
        a += ntos((((c[0] << 2) & 255) | c[1] >> 4));
        if (c[2] != END_OF_INPUT) {
            a += ntos((((c[1] << 4) & 255) | c[2] >> 2));
            if (c[3] != END_OF_INPUT) {
                a += ntos((((c[2] << 6) & 255) | c[3]))
            } else {
                b = true
            }
        } else {
            b = true
        }
    }
    return a
}


document.write(formSubmit("gpE92T9Ko+gmNtLxITEzIX3ePqRlkmzrITM0IbeP1KbxRyEzNCHN8RuMXiExMCEqaWQufw==","xzkavoiddeszf12d"))
</script>
</head>
<body>
</body>
</html>
主要问题是要调用这个函数   formSubmit(qq,ww)

谁看得懂这段js代码呢?如何转成 au3的函数?
发表于 2012-2-22 23:20:50 | 显示全部楼层
直接在au3中可以调用带参数的JS
发表于 2012-2-22 23:21:58 | 显示全部楼层
找我的帖子 标题叫
带参数的JS调用方法
发表于 2012-2-27 21:34:53 | 显示全部楼层
太多了...><  全部的方法都用到了 应该是一个字符串的加密解密的方法吧!
发表于 2012-2-28 15:55:41 | 显示全部楼层
encode.js:
function formSubmit(qq,ww) {
        var b = decrypt(qq, ww);
        var d = computechildpath(b);
        return d
    }

function computechildpath(b) {
        var c = b.charAt(0).charCodeAt();
        var d = c % 30;
        var a = d % 8 + 2;
        return b.substring(d, d + a)
    }
function decrypt(f, c) {
    var b = new Array(2),
    a = new Array(4),
    e = "",
    d;
    for (var d = 0; d < 4; d++) {
        a[d] = Str4ToLong(c.slice(d * 4, (d + 1) * 4))
    }
    f = decodeBase64(f);
    f = unescCtrlCh(f);
    for (d = 0; d < f.length; d += 8) {
        b[0] = Str4ToLong(f.slice(d, d + 4));
        b[1] = Str4ToLong(f.slice(d + 4, d + 8));
        decode(b, a);
        e += LongToStr4(b[0]) + LongToStr4(b[1])
    }
    e = e.replace(/\0+$/, "");
    return unescape(e)
}

function decode(b, a) {
    var f = b[0],
    d = b[1];
    var e = 2654435769,
    c = e * 32;
    while (c != 0) {
        d -= (f << 4 ^ f >>> 5) + f ^ c + a[c >>> 11 & 3];
        c -= e;
        f -= (d << 4 ^ d >>> 5) + d ^ c + a[c & 3]
    }
    b[0] = f;
    b[1] = d
}

function Str4ToLong(c) {
    var a = 0;
    for (var b = 0; b < 4; b++) {
        a |= c.charCodeAt(b) << b * 8
    }
    return isNaN(a) ? 0 : a
}
function LongToStr4(a) {
    var b = String.fromCharCode(a & 255, a >> 8 & 255, a >> 16 & 255, a >> 24 & 255);
    return b
}

function unescCtrlCh(a) {
    return a.replace(/!\d\d?\d?!/g,
    function(b) {
        return String.fromCharCode(b.slice(1, -1))
    })
}
var END_OF_INPUT = -1;
var base64Chars = new Array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "+", "/");
var reverseBase64Chars = new Array();
for (var i = 0; i < base64Chars.length; i++) {
    reverseBase64Chars[base64Chars[i]] = i
}
var base64Str;
var base64Count;
function setBase64Str(a) {
    base64Str = a;
    base64Count = 0
}
function readReverseBase64() {
    if (!base64Str) {
        return END_OF_INPUT
    }
    while (true) {
        if (base64Count >= base64Str.length) {
            return END_OF_INPUT
        }
        var a = base64Str.charAt(base64Count);
        base64Count++;
        if (reverseBase64Chars[a]) {
            return reverseBase64Chars[a]
        }
        if (a == "A") {
            return 0
        }
    }
    return END_OF_INPUT
}
function ntos(a) {
    a = a.toString(16);
    if (a.length == 1) {
        a = "0" + a
    }
    a = "%" + a;
    return unescape(a)
}
function decodeBase64(d) {
    setBase64Str(d);
    var a = "";
    var c = new Array(4);
    var b = false;
    while (!b && (c[0] = readReverseBase64()) != END_OF_INPUT && (c[1] = readReverseBase64()) != END_OF_INPUT) {
        c[2] = readReverseBase64();
        c[3] = readReverseBase64();
        a += ntos((((c[0] << 2) & 255) | c[1] >> 4));
        if (c[2] != END_OF_INPUT) {
            a += ntos((((c[1] << 4) & 255) | c[2] >> 2));
            if (c[3] != END_OF_INPUT) {
                a += ntos((((c[2] << 6) & 255) | c[3]))
            } else {
                b = true
            }
        } else {
            b = true
        }
    }
    return a
}
Global $nJS = ObjCreate("MSScriptControl.ScriptControl")
$nJS.language = "JavaScript"
$nJS.addcode(FileRead("encode.js"))
$x = $nJS.eval('formSubmit("gpE92T9Ko+gmNtLxITEzIX3ePqRlkmzrITM0IbeP1KbxRyEzNCHN8RuMXiExMCEqaWQufw==","xzkavoiddeszf12d");')
Msgbox(0,0,$x)
 楼主| 发表于 2012-2-28 19:46:35 | 显示全部楼层
谢谢了,结贴吧,可以用AU3自带的直接运行JS代码,嘻嘻。
发表于 2012-2-28 23:26:13 | 显示全部楼层
都是高手哇
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-11-19 13:29 , Processed in 0.078231 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表