吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 1841|回复: 7
收起左侧

[Python 转载] Python自学记录--PyExecJs+微信公众平台js算法改写

[复制链接]
BoBuo 发表于 2021-10-3 14:19
[Python] 纯文本查看 复制代码
import execjs

#实例化一个node对象
node = execjs.get()

#js源文件编译
ctx = node.compile(open(r'D:\代码保存\wechat.js',encoding='utf-8').read())

#执行js函数
funcName = 'getPwd("{0}")'.format('123456')
pwd = ctx.eval(funcName)
print(pwd)
[JavaScript] 纯文本查看 复制代码
var n = {}

function p(t, e) {
var n = (65535 & t) + (65535 & e);
return (t >> 16) + (e >> 16) + (n >> 16) << 16 | 65535 & n
}
function a(t, e, n, r, o, i) {
return p((s = p(p(e, t), p(r, i))) << (a = o) | s >>> 32 - a, n);
var s, a
}
function l(t, e, n, r, o, i, s) {
return a(e & n | ~e & r, t, e, o, i, s)
}
function f(t, e, n, r, o, i, s) {
return a(e & r | n & ~r, t, e, o, i, s)
}
function m(t, e, n, r, o, i, s) {
return a(e ^ n ^ r, t, e, o, i, s)
}
function h(t, e, n, r, o, i, s) {
return a(n ^ (e | ~r), t, e, o, i, s)
}
function c(t, e) {
t[e >> 5] |= 128 << e % 32,
t[14 + (e + 64 >>> 9 << 4)] = e;
var n, r, o, i, s, a = 1732584193,
c = -271733879,
u = -1732584194,
d = 271733878;
for (n = 0; n < t.length; n += 16) a = l(r = a, o = c, i = u, s = d, t[n], 7, -680876936),
d = l(d, a, c, u, t[n + 1], 12, -389564586),
u = l(u, d, a, c, t[n + 2], 17, 606105819),
c = l(c, u, d, a, t[n + 3], 22, -1044525330),
a = l(a, c, u, d, t[n + 4], 7, -176418897),
d = l(d, a, c, u, t[n + 5], 12, 1200080426),
u = l(u, d, a, c, t[n + 6], 17, -1473231341),
c = l(c, u, d, a, t[n + 7], 22, -45705983),
a = l(a, c, u, d, t[n + 8], 7, 1770035416),
d = l(d, a, c, u, t[n + 9], 12, -1958414417),
u = l(u, d, a, c, t[n + 10], 17, -42063),
c = l(c, u, d, a, t[n + 11], 22, -1990404162),
a = l(a, c, u, d, t[n + 12], 7, 1804603682),
d = l(d, a, c, u, t[n + 13], 12, -40341101),
u = l(u, d, a, c, t[n + 14], 17, -1502002290),
a = f(a, c = l(c, u, d, a, t[n + 15], 22, 1236535329), u, d, t[n + 1], 5, -165796510),
d = f(d, a, c, u, t[n + 6], 9, -1069501632),
u = f(u, d, a, c, t[n + 11], 14, 643717713),
c = f(c, u, d, a, t[n], 20, -373897302),
a = f(a, c, u, d, t[n + 5], 5, -701558691),
d = f(d, a, c, u, t[n + 10], 9, 38016083),
u = f(u, d, a, c, t[n + 15], 14, -660478335),
c = f(c, u, d, a, t[n + 4], 20, -405537848),
a = f(a, c, u, d, t[n + 9], 5, 568446438),
d = f(d, a, c, u, t[n + 14], 9, -1019803690),
u = f(u, d, a, c, t[n + 3], 14, -187363961),
c = f(c, u, d, a, t[n + 8], 20, 1163531501),
a = f(a, c, u, d, t[n + 13], 5, -1444681467),
d = f(d, a, c, u, t[n + 2], 9, -51403784),
u = f(u, d, a, c, t[n + 7], 14, 1735328473),
a = m(a, c = f(c, u, d, a, t[n + 12], 20, -1926607734), u, d, t[n + 5], 4, -378558),
d = m(d, a, c, u, t[n + 8], 11, -2022574463),
u = m(u, d, a, c, t[n + 11], 16, 1839030562),
c = m(c, u, d, a, t[n + 14], 23, -35309556),
a = m(a, c, u, d, t[n + 1], 4, -1530992060),
d = m(d, a, c, u, t[n + 4], 11, 1272893353),
u = m(u, d, a, c, t[n + 7], 16, -155497632),
c = m(c, u, d, a, t[n + 10], 23, -1094730640),
a = m(a, c, u, d, t[n + 13], 4, 681279174),
d = m(d, a, c, u, t[n], 11, -358537222),
u = m(u, d, a, c, t[n + 3], 16, -722521979),
c = m(c, u, d, a, t[n + 6], 23, 76029189),
a = m(a, c, u, d, t[n + 9], 4, -640364487),
d = m(d, a, c, u, t[n + 12], 11, -421815835),
u = m(u, d, a, c, t[n + 15], 16, 530742520),
a = h(a, c = m(c, u, d, a, t[n + 2], 23, -995338651), u, d, t[n], 6, -198630844),
d = h(d, a, c, u, t[n + 7], 10, 1126891415),
u = h(u, d, a, c, t[n + 14], 15, -1416354905),
c = h(c, u, d, a, t[n + 5], 21, -57434055),
a = h(a, c, u, d, t[n + 12], 6, 1700485571),
d = h(d, a, c, u, t[n + 3], 10, -1894986606),
u = h(u, d, a, c, t[n + 10], 15, -1051523),
c = h(c, u, d, a, t[n + 1], 21, -2054922799),
a = h(a, c, u, d, t[n + 8], 6, 1873313359),
d = h(d, a, c, u, t[n + 15], 10, -30611744),
u = h(u, d, a, c, t[n + 6], 15, -1560198380),
c = h(c, u, d, a, t[n + 13], 21, 1309151649),
a = h(a, c, u, d, t[n + 4], 6, -145523070),
d = h(d, a, c, u, t[n + 11], 10, -1120210379),
u = h(u, d, a, c, t[n + 2], 15, 718787259),
c = h(c, u, d, a, t[n + 9], 21, -343485551),
a = p(a, r),
c = p(c, o),
u = p(u, i),
d = p(d, s);
return [a, c, u, d]
}
function u(t) {
var e, n = "";
for (e = 0; e < 32 * t.length; e += 8) n += String.fromCharCode(t[e >> 5] >>> e % 32 & 255);
return n
}
function d(t) {
var e, n = [];
for (n[(t.length >> 2) - 1] = void 0, e = 0; e < n.length; e += 1) n[e] = 0;
for (e = 0; e < 8 * t.length; e += 8) n[e >> 5] |= (255 & t.charCodeAt(e / 8)) << e % 32;
return n
}
function r(t) {
var e, n, r = "0123456789abcdef",
o = "";
for (n = 0; n < t.length; n += 1) e = t.charCodeAt(n),
o += r.charAt(e >>> 4 & 15) + r.charAt(15 & e);
return o
}
function o(t) {
return unescape(encodeURIComponent(t))
}
function i(t) {
return u(c(d(e = o(t)), 8 * e.length));
var e
}
function s(t, e) {
return function(t, e) {
    var n, r, o = d(t),
    i = [],
    s = [];
    for (i[15] = s[15] = void 0, 16 < o.length && (o = c(o, 8 * t.length)), n = 0; n < 16; n += 1) i[n] = 909522486 ^ o[n],
    s[n] = 1549556828 ^ o[n];
    return r = c(i.concat(d(e)), 512 + 8 * e.length),
    u(c(s.concat(r), 640))
} (o(t), o(e))
}
function getPwd(t, e, n) {
return e ? n ? s(e, t) : r(s(e, t)) : n ? i(t) : r(i(t))
}

免费评分

参与人数 2吾爱币 +8 热心值 +2 收起 理由
xie0080 + 1 + 1 用心讨论,共获提升!
苏紫方璇 + 7 + 1 欢迎分析讨论交流,吾爱破解论坛有你更精彩!

查看全部评分

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

 楼主| BoBuo 发表于 2021-10-3 14:20
js文件上传不来,源码贴上
快乐的鸡蛋黄 发表于 2021-10-3 20:28
Wxylkxy 发表于 2021-10-3 20:46
涛之雨 发表于 2021-10-3 21:00
emmm可以适当的调用py的库,比如(没有怎么细看),
js的代码里有个MD5摘要,有个base64编码,完全可以用纯py实现
 楼主| BoBuo 发表于 2021-10-3 21:06
涛之雨 发表于 2021-10-3 21:00
emmm可以适当的调用py的库,比如(没有怎么细看),
js的代码里有个MD5摘要,有个base64编码,完全可以用 ...

感谢师兄指点
 楼主| BoBuo 发表于 2021-10-4 01:00
Wxylkxy 发表于 2021-10-3 20:46
这是看的B站张小波的教学把?

对  是他的
geniusrot 发表于 2022-3-18 00:33
我这个菜鸟,一看就发现,这特么就是MD5的源码而已。。。百度一大堆,跟公众平台算法什么关系啊
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-11-25 07:28

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

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