1
Fork 0
mirror of https://github.com/thegeneralist01/twitter-tid-deobf-fork synced 2026-01-09 23:00:26 +01:00
Signed-off-by: ふぁ <yuki@yuki0311.com>
This commit is contained in:
ふぁ 2025-04-27 16:14:45 +09:00
parent b498b6e6e4
commit f0ed3a9f2c
No known key found for this signature in database
GPG key ID: 83A8A5E74872A8AA

View file

@ -434,28 +434,12 @@ const deobfStrings = {
} }
code += generate(binding.path.node).code + "\n"; code += generate(binding.path.node).code + "\n";
path.scope.crawl(); path.scope.crawl();
for (const body of binding.path.node.body.body) { binding = binding.path.scope.getBinding(
if (body.type == "ReturnStatement") { binding.path.node.body.body[0].argument.callee.name
if (body.argument.type == "CallExpression") { );
binding = binding.path.scope.getBinding(body.argument.callee.name);
} else if (body.argument.type == "SequenceExpression") {
binding = undefined;
}
} else if (body.type == "VariableDeclaration") {
path.scope.crawl();
binding.scope.crawl();
binding = binding.path.scope.getBinding(
body.declarations[0].init.callee.name
);
code += generate(binding.path.node).code + "\n";
binding = undefined;
}
}
} }
// ! now we should have all the code we need // ! now we should have all the code we need
try { path.replaceWith(t.valueToNode(vm.runInContext(code, decryptFuncCtx)));
path.replaceWith(t.valueToNode(vm.runInContext(code, decryptFuncCtx)));
} catch (e) {}
}, },
}; };
@ -556,9 +540,6 @@ const objDeobfMemberExpr = {
key = node.property.value; key = node.property.value;
} }
let value = map[key]; let value = map[key];
if (value === undefined) {
return;
}
if (value.type == "StringLiteral") { if (value.type == "StringLiteral") {
path.replaceWith(value); path.replaceWith(value);
return; return;
@ -596,9 +577,6 @@ const objDeobfMemberExpr = {
key = node.callee.property.value; key = node.callee.property.value;
} }
let value = map[key]; let value = map[key];
if (value === undefined) {
return;
}
// ! replace functions // ! replace functions
let retNode = value.body.body[0].argument; let retNode = value.body.body[0].argument;
// ! call expression // ! call expression
@ -641,6 +619,7 @@ const objDeobfMemberExpr = {
function evalValue(left, right, op) { function evalValue(left, right, op) {
switch (op) { switch (op) {
case "===": case "===":
return left == right;
case "!==": case "!==":
return left != right; return left != right;
} }