Commit b140db0c authored by wang's avatar wang

Merge remote-tracking branch 'origin/tk' into tk

# Conflicts:
#	src_out.js
parents aab2e214 c6882bcc
const fs = require('fs');
const types = require("@babel/types");
const parser = require("@babel/parser");
const {log} = require('console');
const traverse = require("@babel/traverse").default;
const generator = require("@babel/generator").default;
//js混淆代码读取
process.argv.length > 2 ? encodeFile = process.argv[2] : encodeFile = "./shape.js";
process.argv.length > 3 ? decodeFile = process.argv[3] : decodeFile = "./out.js";
//将源代码解析为AST
let sourceCode = fs.readFileSync(encodeFile, {encoding: "utf-8"});
let ast = parser.parse(sourceCode, {sourceType: 'script'});
traverse(ast, {
BinaryExpression(path){
let {node} = path;
let parent = path.parentPath.node;
let {left, operator, right} = node;
if (['>>>', '>>', '<', '>', '=', '+','-','*','/','^','&','%','<<','<<<','|','==','===','<=','>='].indexOf(operator) > -1){
if(types.isMemberExpression(left) && types.isMemberExpression(right)){
let {object: leftObject, property: leftproperty} = left;
if (types.isMemberExpression(leftObject) && types.isBinaryExpression(leftproperty)){
if(types.isCallExpression(parent))return
debugger
path.parentPath.insertBefore(types.ExpressionStatement(
types.CallExpression(
// types.MemberExpression(types.Identifier('console'), types.Identifier('log')),
types.Identifier('con5'),
[
types.StringLiteral(generator(node).code),
left,
types.StringLiteral(operator),
right,
types.StringLiteral('='),
node
]
)
))
path.skip()
}
}else if (types.isIdentifier(left) && types.isIdentifier(right)){
if(types.isAssignmentExpression(parent)){
let {left:inleft, right:inright, operator:inoperator} = parent;
path.parentPath.insertBefore(types.ExpressionStatement(
types.CallExpression(
// types.MemberExpression(types.Identifier('console'), types.Identifier('log')),
types.Identifier('con5'),
[
types.StringLiteral(generator(inleft).code),
types.Identifier(left.name),
types.StringLiteral(operator),
types.Identifier(right.name),
types.StringLiteral('='),
node
]
)
))
}
}else{
console.log(generator(parent).code)
}
}
}
})
console.time("处理完毕,耗时");
console.timeEnd("处理完毕,耗时");
let {code} = generator(ast, opts = {jsescOption: {"minimal": true}});
fs.writeFile(decodeFile, code, (err) => {
});
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
......@@ -9,6 +9,8 @@
"author": "",
"license": "ISC",
"dependencies": {
"@babel/core": "^7.23.9",
"@babel/types": "^7.23.9",
"abab": "^2.0.5",
"acorn": "^8.4.1",
"acorn-globals": "^6.0.0",
......
......@@ -30,3 +30,4 @@ for (let i of Object.keys(params)) {
}
eval(funcsStart + funcsList.join('\n') + funcsENd)
;;;
......@@ -121,3 +121,38 @@ delete tt1.prototype
t = Object["call"]["bind"](Object["bind"], Object["call"])(Object["apply"])(Function["prototype"]["call"]["bind"], Function["prototype"]["call"], [Object["prototype"]["hasOwnProperty"]]);
console.log(t(tt1,'prototype'))
CustomEvent = function() {
this.initCustomEvent = function (type, canBubble, cancelable, detail) {
this.type = type
this.detail = detail
return {type, canBubble, cancelable, detail}
}
}
Object.defineProperties(CustomEvent, {
"isTrusted": {
get() {
return true
}
},
type: {value: ''},
detail: {
get() {
return this.d
},
},
initCustomEvent: function (type, canBubble, cancelable, detail) {
this.type = type
this.detail = detail
return {type, canBubble, cancelable, detail}
}
})
let a = new CustomEvent()
console.log(a)
console.log(a.initCustomEvent)
console.log(Object.getOwnPropertyNames(CustomEvent))
\ No newline at end of file
FROM python:3.12.1-bookworm
FROM nn:1.0.0
RUN mkdir -p "/home/opt/lcc-wn"
RUN apt update
RUN apt install curl vim -y
RUN pip3 install requests loguru curl_cffi tls_client pyquery nacos-sdk-python pyyaml pymongo
RUN curl -fsSL https://deb.nodesource.com/setup_19.x | bash -
RUN apt install nodejs -y
#RUN curl -fsSL https://deb.nodesource.com/setup_19.x | bash -
#RUN apt install nodejs -y
WORKDIR /home/opt/lcc-wn/
RUN apt install -y make g++
# RUN apt install -y make g++
COPY src/package.json /home/opt/lcc-wn/package.json
COPY src/package-lock.json /home/opt/lcc-wn/package-lock.json
# RUN npm config set registry https://registry.npmmirror.com
RUN cd /home/opt/lcc-wn/ && npm i
RUN npm i ffi-napi
RUN npm i ffi-napi pm2
COPY src/src.js /home/opt/lcc-wn/src.js
COPY src/src2.js /home/opt/lcc-wn/src2.js
......@@ -19,10 +19,10 @@ COPY src/jsdom /home/opt/lcc-wn/jsdom
COPY src/js_dom_run.js /home/opt/lcc-wn/js_dom_run.js
COPY src/httpUtil.js /home/opt/lcc-wn/httpUtil.js
COPY src/tls-client-linux-ubuntu-amd64-v1.7.2.so /home/opt/lcc-wn/tls-client-linux-ubuntu-amd64-v1.7.2.so
RUN npm i -g pm2
COPY src/main.py /home/opt/lcc-wn/main.py
CMD ["python3", "main.py"]
COPY src/run.sh /home/opt/lcc-wn/run.sh
CMD ["sh", "/home/opt/lcc-wn/run.sh"]
......@@ -6,6 +6,7 @@ if (os.platform() === 'linux') {
path = './tls-client-linux-ubuntu-amd64-v1.7.2.so';
} else {
path = './tls-client-arm64.dylib'
path = './tls-client-darwin-amd64-v1.7.2.dylib'
}
// load the tls-client shared package for your OS you are currently running your nodejs script (i'm running on mac)
......
......@@ -6,6 +6,7 @@ if (os.platform() === 'linux') {
path = './tls-client-linux-ubuntu-amd64-v1.7.2.so';
} else {
path = './tls-client-arm64.dylib'
path = '../tls-client-darwin-amd64-v1.7.2.dylib'
}
// load the tls-client shared package for your OS you are currently running your nodejs script (i'm running on mac)
......
pm2 start main.py --name tr --interpreter python3 --restart-delay=21600
sleep 6h
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment