@delance/builder 0.2.10 → 0.2.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +207 -123
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -15,7 +15,7 @@ import {getQuickJS, shouldInterruptAfterDeadline} from "quickjs-emscripten";
|
|
|
15
15
|
// /home/mochaa/ghq/git.sr.ht/~self/delance-builder/node_modules/webcrack/src/deobfuscate/index.ts
|
|
16
16
|
import debug3 from "debug";
|
|
17
17
|
|
|
18
|
-
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=
|
|
18
|
+
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=0e061d97d589024b2_s6fkzgrdmtnd5jvdjo64potfwe/node_modules/webcrack/src/ast-utils/ast.ts
|
|
19
19
|
import * as t from "@babel/types";
|
|
20
20
|
function getPropName(node) {
|
|
21
21
|
if (t.isIdentifier(node)) {
|
|
@@ -28,7 +28,7 @@ function getPropName(node) {
|
|
|
28
28
|
return node.value.toString();
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=
|
|
31
|
+
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=0e061d97d589024b2_s6fkzgrdmtnd5jvdjo64potfwe/node_modules/webcrack/src/ast-utils/generator.ts
|
|
32
32
|
import babelGenerate from "@babel/generator";
|
|
33
33
|
function generate(ast, options = defaultOptions) {
|
|
34
34
|
return babelGenerate(ast, options).code;
|
|
@@ -45,7 +45,7 @@ function codePreview(node) {
|
|
|
45
45
|
return code;
|
|
46
46
|
}
|
|
47
47
|
var defaultOptions = { jsescOption: { minimal: true } };
|
|
48
|
-
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=
|
|
48
|
+
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=0e061d97d589024b2_s6fkzgrdmtnd5jvdjo64potfwe/node_modules/webcrack/src/ast-utils/inline.ts
|
|
49
49
|
import traverse4 from "@babel/traverse";
|
|
50
50
|
import * as t13 from "@babel/types";
|
|
51
51
|
|
|
@@ -2175,7 +2175,7 @@ class PredicateMatcher extends Matcher {
|
|
|
2175
2175
|
return this.predicate(value);
|
|
2176
2176
|
}
|
|
2177
2177
|
}
|
|
2178
|
-
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=
|
|
2178
|
+
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=0e061d97d589024b2_s6fkzgrdmtnd5jvdjo64potfwe/node_modules/webcrack/src/ast-utils/matcher.ts
|
|
2179
2179
|
import * as t12 from "@babel/types";
|
|
2180
2180
|
function infiniteLoop(body) {
|
|
2181
2181
|
return or(forStatement(undefined, null, undefined, body), forStatement(undefined, truthyMatcher, undefined, body), whileStatement(truthyMatcher, body));
|
|
@@ -2227,7 +2227,7 @@ var trueMatcher = or(booleanLiteral(true), unaryExpression("!", numericLiteral(0
|
|
|
2227
2227
|
var falseMatcher = or(booleanLiteral(false), unaryExpression("!", arrayExpression([])));
|
|
2228
2228
|
var truthyMatcher = or(trueMatcher, arrayExpression([]));
|
|
2229
2229
|
|
|
2230
|
-
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=
|
|
2230
|
+
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=0e061d97d589024b2_s6fkzgrdmtnd5jvdjo64potfwe/node_modules/webcrack/src/ast-utils/inline.ts
|
|
2231
2231
|
function inlineVariable(binding, value = anyExpression(), unsafeAssignments = false) {
|
|
2232
2232
|
const varDeclarator = binding.path.node;
|
|
2233
2233
|
const varMatcher = variableDeclarator(identifier(binding.identifier.name), value);
|
|
@@ -2359,7 +2359,7 @@ function inlineVariableAliases(binding, targetName = binding.identifier.name) {
|
|
|
2359
2359
|
}
|
|
2360
2360
|
return state;
|
|
2361
2361
|
}
|
|
2362
|
-
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=
|
|
2362
|
+
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=0e061d97d589024b2_s6fkzgrdmtnd5jvdjo64potfwe/node_modules/webcrack/src/ast-utils/rename.ts
|
|
2363
2363
|
import traverse6 from "@babel/traverse";
|
|
2364
2364
|
import * as t14 from "@babel/types";
|
|
2365
2365
|
function renameFast(binding, newName) {
|
|
@@ -2402,7 +2402,7 @@ function renameFast(binding, newName) {
|
|
|
2402
2402
|
binding.scope.bindings[newName] = binding;
|
|
2403
2403
|
binding.identifier.name = newName;
|
|
2404
2404
|
}
|
|
2405
|
-
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=
|
|
2405
|
+
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=0e061d97d589024b2_s6fkzgrdmtnd5jvdjo64potfwe/node_modules/webcrack/src/ast-utils/transform.ts
|
|
2406
2406
|
import traverse8, {visitors} from "@babel/traverse";
|
|
2407
2407
|
import debug from "debug";
|
|
2408
2408
|
async function applyTransformAsync(ast, transform, options2) {
|
|
@@ -2456,39 +2456,31 @@ function mergeTransforms(options2) {
|
|
|
2456
2456
|
};
|
|
2457
2457
|
}
|
|
2458
2458
|
var logger = debug("webcrack:transforms");
|
|
2459
|
-
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=
|
|
2460
|
-
import * as t15 from "@babel/types";
|
|
2459
|
+
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=0e061d97d589024b2_s6fkzgrdmtnd5jvdjo64potfwe/node_modules/webcrack/src/unminify/transforms/merge-strings.ts
|
|
2461
2460
|
var merge_strings_default = {
|
|
2462
2461
|
name: "merge-strings",
|
|
2463
2462
|
tags: ["safe"],
|
|
2464
2463
|
visitor() {
|
|
2465
|
-
const left = capture(stringLiteral(
|
|
2466
|
-
const right = capture(stringLiteral(
|
|
2467
|
-
const matcher3 = binaryExpression("+", left, right);
|
|
2468
|
-
const nestedMatcher = binaryExpression("+", binaryExpression("+", anything(), left), right);
|
|
2464
|
+
const left = capture(stringLiteral());
|
|
2465
|
+
const right = capture(stringLiteral());
|
|
2466
|
+
const matcher3 = binaryExpression("+", or(left, binaryExpression("+", anything(), left)), right);
|
|
2469
2467
|
return {
|
|
2470
2468
|
BinaryExpression: {
|
|
2471
2469
|
exit(path) {
|
|
2472
|
-
if (matcher3.match(path.node))
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
exit(path) {
|
|
2480
|
-
if (nestedMatcher.match(path.parent)) {
|
|
2481
|
-
left.current.value += right.current.value;
|
|
2482
|
-
path.remove();
|
|
2483
|
-
this.changes++;
|
|
2484
|
-
}
|
|
2470
|
+
if (!matcher3.match(path.node))
|
|
2471
|
+
return;
|
|
2472
|
+
left.current.value += right.current.value;
|
|
2473
|
+
right.current.value = "";
|
|
2474
|
+
path.replaceWith(path.node.left);
|
|
2475
|
+
path.skip();
|
|
2476
|
+
this.changes++;
|
|
2485
2477
|
}
|
|
2486
2478
|
}
|
|
2487
2479
|
};
|
|
2488
2480
|
}
|
|
2489
2481
|
};
|
|
2490
2482
|
|
|
2491
|
-
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=
|
|
2483
|
+
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=0e061d97d589024b2_s6fkzgrdmtnd5jvdjo64potfwe/node_modules/webcrack/src/deobfuscate/array-rotator.ts
|
|
2492
2484
|
function findArrayRotator(stringArray) {
|
|
2493
2485
|
const arrayIdentifier = capture(identifier());
|
|
2494
2486
|
const pushShift = callExpression(constMemberExpression(arrayIdentifier, "push"), [
|
|
@@ -2508,8 +2500,8 @@ function findArrayRotator(stringArray) {
|
|
|
2508
2500
|
}
|
|
2509
2501
|
}
|
|
2510
2502
|
|
|
2511
|
-
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=
|
|
2512
|
-
import * as
|
|
2503
|
+
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=0e061d97d589024b2_s6fkzgrdmtnd5jvdjo64potfwe/node_modules/webcrack/src/deobfuscate/control-flow-object.ts
|
|
2504
|
+
import * as t15 from "@babel/types";
|
|
2513
2505
|
var control_flow_object_default = {
|
|
2514
2506
|
name: "control-flow-object",
|
|
2515
2507
|
tags: ["safe"],
|
|
@@ -2521,7 +2513,7 @@ var control_flow_object_default = {
|
|
|
2521
2513
|
const propertyValue = or(stringLiteral(), createFunctionMatcher(2, (left, right) => [
|
|
2522
2514
|
returnStatement(or(binaryExpression(undefined, left, right), logicalExpression(undefined, left, right), binaryExpression(undefined, right, left), logicalExpression(undefined, right, left)))
|
|
2523
2515
|
]), predicate((node) => {
|
|
2524
|
-
return
|
|
2516
|
+
return t15.isFunctionExpression(node) && createFunctionMatcher(node.params.length, (...params) => [
|
|
2525
2517
|
returnStatement(callExpression(params[0], params.slice(1)))
|
|
2526
2518
|
]).match(node);
|
|
2527
2519
|
}), (() => {
|
|
@@ -2574,7 +2566,7 @@ var control_flow_object_default = {
|
|
|
2574
2566
|
ref.addComment("leading", "webcrack:control_flow_missing_prop");
|
|
2575
2567
|
return;
|
|
2576
2568
|
}
|
|
2577
|
-
if (
|
|
2569
|
+
if (t15.isStringLiteral(value)) {
|
|
2578
2570
|
memberPath.replaceWith(value);
|
|
2579
2571
|
} else {
|
|
2580
2572
|
inlineFunction(value, memberPath.parentPath);
|
|
@@ -2601,7 +2593,7 @@ var control_flow_object_default = {
|
|
|
2601
2593
|
applyTransform(statement, merge_strings_default);
|
|
2602
2594
|
}
|
|
2603
2595
|
if (assignment.match(statement)) {
|
|
2604
|
-
properties.push(
|
|
2596
|
+
properties.push(t15.objectProperty(t15.identifier(assignedKey.current), assignedValue.current));
|
|
2605
2597
|
} else {
|
|
2606
2598
|
break;
|
|
2607
2599
|
}
|
|
@@ -2632,8 +2624,8 @@ var control_flow_object_default = {
|
|
|
2632
2624
|
}
|
|
2633
2625
|
};
|
|
2634
2626
|
|
|
2635
|
-
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=
|
|
2636
|
-
import * as
|
|
2627
|
+
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=0e061d97d589024b2_s6fkzgrdmtnd5jvdjo64potfwe/node_modules/webcrack/src/deobfuscate/control-flow-switch.ts
|
|
2628
|
+
import * as t16 from "@babel/types";
|
|
2637
2629
|
var control_flow_switch_default = {
|
|
2638
2630
|
name: "control-flow-switch",
|
|
2639
2631
|
tags: ["safe"],
|
|
@@ -2655,7 +2647,7 @@ var control_flow_switch_default = {
|
|
|
2655
2647
|
return;
|
|
2656
2648
|
const caseStatements = new Map(cases.current.map((c) => [
|
|
2657
2649
|
c.test.value,
|
|
2658
|
-
|
|
2650
|
+
t16.isContinueStatement(c.consequent.at(-1)) ? c.consequent.slice(0, -1) : c.consequent
|
|
2659
2651
|
]));
|
|
2660
2652
|
const sequence = sequenceString.current.split("|");
|
|
2661
2653
|
const newStatements = sequence.flatMap((s) => caseStatements.get(s));
|
|
@@ -2667,10 +2659,10 @@ var control_flow_switch_default = {
|
|
|
2667
2659
|
}
|
|
2668
2660
|
};
|
|
2669
2661
|
|
|
2670
|
-
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=
|
|
2671
|
-
import * as
|
|
2662
|
+
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=0e061d97d589024b2_s6fkzgrdmtnd5jvdjo64potfwe/node_modules/webcrack/src/deobfuscate/dead-code.ts
|
|
2663
|
+
import * as t17 from "@babel/types";
|
|
2672
2664
|
var replace = function(path, replacement) {
|
|
2673
|
-
if (
|
|
2665
|
+
if (t17.isBlockStatement(replacement.node)) {
|
|
2674
2666
|
const childBindings = replacement.scope.bindings;
|
|
2675
2667
|
for (const name in childBindings) {
|
|
2676
2668
|
const binding = childBindings[name];
|
|
@@ -2712,7 +2704,7 @@ var dead_code_default = {
|
|
|
2712
2704
|
}
|
|
2713
2705
|
};
|
|
2714
2706
|
|
|
2715
|
-
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=
|
|
2707
|
+
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=0e061d97d589024b2_s6fkzgrdmtnd5jvdjo64potfwe/node_modules/webcrack/src/deobfuscate/decoder.ts
|
|
2716
2708
|
import {expression} from "@babel/template";
|
|
2717
2709
|
function findDecoders(stringArray) {
|
|
2718
2710
|
const decoders = [];
|
|
@@ -2781,8 +2773,8 @@ class Decoder {
|
|
|
2781
2773
|
}
|
|
2782
2774
|
}
|
|
2783
2775
|
|
|
2784
|
-
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=
|
|
2785
|
-
import * as
|
|
2776
|
+
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=0e061d97d589024b2_s6fkzgrdmtnd5jvdjo64potfwe/node_modules/webcrack/src/deobfuscate/inline-decoded-strings.ts
|
|
2777
|
+
import * as t18 from "@babel/types";
|
|
2786
2778
|
var inline_decoded_strings_default = {
|
|
2787
2779
|
name: "inline-decoded-strings",
|
|
2788
2780
|
tags: ["unsafe"],
|
|
@@ -2795,7 +2787,7 @@ var inline_decoded_strings_default = {
|
|
|
2795
2787
|
for (let i = 0;i < calls.length; i++) {
|
|
2796
2788
|
const call = calls[i];
|
|
2797
2789
|
const value = decodedValues[i];
|
|
2798
|
-
call.replaceWith(
|
|
2790
|
+
call.replaceWith(t18.valueToNode(value));
|
|
2799
2791
|
if (typeof value !== "string")
|
|
2800
2792
|
call.addComment("leading", "webcrack:decode_error");
|
|
2801
2793
|
}
|
|
@@ -2803,7 +2795,7 @@ var inline_decoded_strings_default = {
|
|
|
2803
2795
|
}
|
|
2804
2796
|
};
|
|
2805
2797
|
|
|
2806
|
-
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=
|
|
2798
|
+
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=0e061d97d589024b2_s6fkzgrdmtnd5jvdjo64potfwe/node_modules/webcrack/src/deobfuscate/inline-decoder-wrappers.ts
|
|
2807
2799
|
var inline_decoder_wrappers_default = {
|
|
2808
2800
|
name: "inline-decoder-wrappers",
|
|
2809
2801
|
tags: ["unsafe"],
|
|
@@ -2820,19 +2812,29 @@ var inline_decoder_wrappers_default = {
|
|
|
2820
2812
|
}
|
|
2821
2813
|
};
|
|
2822
2814
|
|
|
2823
|
-
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=
|
|
2815
|
+
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=0e061d97d589024b2_s6fkzgrdmtnd5jvdjo64potfwe/node_modules/webcrack/src/deobfuscate/inline-object-props.ts
|
|
2824
2816
|
var inline_object_props_default = {
|
|
2825
2817
|
name: "inline-object-props",
|
|
2826
2818
|
tags: ["safe"],
|
|
2827
2819
|
scope: true,
|
|
2828
2820
|
visitor() {
|
|
2829
2821
|
const varId = capture(identifier());
|
|
2830
|
-
const propertyName = predicate((name) => /^[\w]+$/i.test(name));
|
|
2822
|
+
const propertyName = capture(predicate((name) => /^[\w]+$/i.test(name)));
|
|
2831
2823
|
const propertyKey = constKey(propertyName);
|
|
2832
2824
|
const objectProperties = capture(arrayOf(objectProperty(propertyKey, or(stringLiteral(), numericLiteral()))));
|
|
2833
2825
|
const memberAccess = constMemberExpression(fromCapture(varId), propertyName);
|
|
2834
2826
|
const varMatcher = variableDeclarator(varId, objectExpression(objectProperties));
|
|
2827
|
+
const literalMemberAccess = constMemberExpression(objectExpression(objectProperties), propertyName);
|
|
2835
2828
|
return {
|
|
2829
|
+
MemberExpression(path) {
|
|
2830
|
+
if (!literalMemberAccess.match(path.node))
|
|
2831
|
+
return;
|
|
2832
|
+
const property = objectProperties.current.find((p) => getPropName(p.key) === propertyName.current);
|
|
2833
|
+
if (!property)
|
|
2834
|
+
return;
|
|
2835
|
+
path.replaceWith(property.value);
|
|
2836
|
+
this.changes++;
|
|
2837
|
+
},
|
|
2836
2838
|
VariableDeclarator(path) {
|
|
2837
2839
|
if (!varMatcher.match(path.node))
|
|
2838
2840
|
return;
|
|
@@ -2842,12 +2844,13 @@ var inline_object_props_default = {
|
|
|
2842
2844
|
if (!binding || !isReadonlyObject(binding, memberAccess))
|
|
2843
2845
|
return;
|
|
2844
2846
|
inlineObjectProperties(binding, objectProperty(propertyKey, or(stringLiteral(), numericLiteral())));
|
|
2847
|
+
this.changes++;
|
|
2845
2848
|
}
|
|
2846
2849
|
};
|
|
2847
2850
|
}
|
|
2848
2851
|
};
|
|
2849
2852
|
|
|
2850
|
-
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=
|
|
2853
|
+
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=0e061d97d589024b2_s6fkzgrdmtnd5jvdjo64potfwe/node_modules/webcrack/src/deobfuscate/string-array.ts
|
|
2851
2854
|
import traverse10 from "@babel/traverse";
|
|
2852
2855
|
function findStringArray(ast2) {
|
|
2853
2856
|
let result;
|
|
@@ -2897,7 +2900,7 @@ function findStringArray(ast2) {
|
|
|
2897
2900
|
return result;
|
|
2898
2901
|
}
|
|
2899
2902
|
|
|
2900
|
-
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=
|
|
2903
|
+
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=0e061d97d589024b2_s6fkzgrdmtnd5jvdjo64potfwe/node_modules/webcrack/src/deobfuscate/vm.ts
|
|
2901
2904
|
import debug2 from "debug";
|
|
2902
2905
|
class VMDecoder {
|
|
2903
2906
|
decoders;
|
|
@@ -2967,7 +2970,7 @@ var deobfuscate_default = {
|
|
|
2967
2970
|
};
|
|
2968
2971
|
|
|
2969
2972
|
// /home/mochaa/ghq/git.sr.ht/~self/delance-builder/node_modules/webcrack/src/deobfuscate/var-functions.ts
|
|
2970
|
-
import * as
|
|
2973
|
+
import * as t19 from "@babel/types";
|
|
2971
2974
|
var var_functions_default = {
|
|
2972
2975
|
name: "var-functions",
|
|
2973
2976
|
tags: ["unsafe"],
|
|
@@ -2981,7 +2984,7 @@ var var_functions_default = {
|
|
|
2981
2984
|
VariableDeclaration: {
|
|
2982
2985
|
exit(path) {
|
|
2983
2986
|
if (matcher3.match(path.node) && path.key !== "init") {
|
|
2984
|
-
path.replaceWith(
|
|
2987
|
+
path.replaceWith(t19.functionDeclaration(name.current, fn.current.params, fn.current.body, fn.current.generator, fn.current.async));
|
|
2985
2988
|
}
|
|
2986
2989
|
}
|
|
2987
2990
|
}
|
|
@@ -2990,7 +2993,7 @@ var var_functions_default = {
|
|
|
2990
2993
|
};
|
|
2991
2994
|
|
|
2992
2995
|
// /home/mochaa/ghq/git.sr.ht/~self/delance-builder/node_modules/webcrack/src/deobfuscate/merge-object-assignments.ts
|
|
2993
|
-
import * as
|
|
2996
|
+
import * as t20 from "@babel/types";
|
|
2994
2997
|
var hasCircularReference = function(node, binding) {
|
|
2995
2998
|
return binding.referencePaths.some((path) => path.find((p) => p.node === node)) || containerOf(callExpression()).match(node);
|
|
2996
2999
|
};
|
|
@@ -3024,7 +3027,7 @@ var merge_object_assignments_default = {
|
|
|
3024
3027
|
if (!assignmentMatcher.match(sibling.node) || hasCircularReference(value.current, binding))
|
|
3025
3028
|
return;
|
|
3026
3029
|
const isComputed = computed.current && key.current.type !== "NumericLiteral" && key.current.type !== "StringLiteral";
|
|
3027
|
-
object.current.properties.push(
|
|
3030
|
+
object.current.properties.push(t20.objectProperty(key.current, value.current, isComputed));
|
|
3028
3031
|
sibling.remove();
|
|
3029
3032
|
binding.dereference();
|
|
3030
3033
|
binding.referencePaths.shift();
|
|
@@ -3041,6 +3044,78 @@ var merge_object_assignments_default = {
|
|
|
3041
3044
|
};
|
|
3042
3045
|
var inlineableObject = predicate((node) => or(safeLiteral, arrayExpression(arrayOf(inlineableObject)), objectExpression(arrayOf(constObjectProperty(inlineableObject)))).match(node));
|
|
3043
3046
|
|
|
3047
|
+
// /home/mochaa/ghq/git.sr.ht/~self/delance-builder/node_modules/webcrack/src/deobfuscate/self-defending.ts
|
|
3048
|
+
var removeSelfDefendingRefs = function(path) {
|
|
3049
|
+
const varName = capture(anyString());
|
|
3050
|
+
const varMatcher = variableDeclarator(identifier(varName), callExpression(identifier(path.node.name)));
|
|
3051
|
+
const callMatcher = expressionStatement(callExpression(identifier(fromCapture(varName)), []));
|
|
3052
|
+
const varDecl = findParent(path, varMatcher);
|
|
3053
|
+
if (varDecl) {
|
|
3054
|
+
const binding = varDecl.scope.getBinding(varName.current);
|
|
3055
|
+
binding?.referencePaths.forEach((ref) => {
|
|
3056
|
+
if (callMatcher.match(ref.parentPath?.parent))
|
|
3057
|
+
ref.parentPath?.parentPath?.remove();
|
|
3058
|
+
});
|
|
3059
|
+
varDecl.remove();
|
|
3060
|
+
}
|
|
3061
|
+
};
|
|
3062
|
+
var self_defending_default = {
|
|
3063
|
+
name: "self-defending",
|
|
3064
|
+
tags: ["safe"],
|
|
3065
|
+
scope: true,
|
|
3066
|
+
visitor() {
|
|
3067
|
+
const callController = capture(anyString());
|
|
3068
|
+
const firstCall = capture(identifier());
|
|
3069
|
+
const rfn = capture(identifier());
|
|
3070
|
+
const context = capture(identifier());
|
|
3071
|
+
const res = capture(identifier());
|
|
3072
|
+
const fn = capture(identifier());
|
|
3073
|
+
const matcher3 = variableDeclarator(identifier(callController), matchIife([
|
|
3074
|
+
variableDeclaration(undefined, [
|
|
3075
|
+
variableDeclarator(firstCall, trueMatcher)
|
|
3076
|
+
]),
|
|
3077
|
+
returnStatement(functionExpression(null, [context, fn], blockStatement([
|
|
3078
|
+
variableDeclaration(undefined, [
|
|
3079
|
+
variableDeclarator(rfn, conditionalExpression(fromCapture(firstCall), functionExpression(null, [], blockStatement([
|
|
3080
|
+
ifStatement(fromCapture(fn), blockStatement([
|
|
3081
|
+
variableDeclaration(undefined, [
|
|
3082
|
+
variableDeclarator(res, callExpression(constMemberExpression(fromCapture(fn), "apply"), [
|
|
3083
|
+
fromCapture(context),
|
|
3084
|
+
identifier("arguments")
|
|
3085
|
+
]))
|
|
3086
|
+
]),
|
|
3087
|
+
expressionStatement(assignmentExpression("=", fromCapture(fn), nullLiteral())),
|
|
3088
|
+
returnStatement(fromCapture(res))
|
|
3089
|
+
]))
|
|
3090
|
+
])), functionExpression(null, [], blockStatement([]))))
|
|
3091
|
+
]),
|
|
3092
|
+
expressionStatement(assignmentExpression("=", fromCapture(firstCall), falseMatcher)),
|
|
3093
|
+
returnStatement(fromCapture(rfn))
|
|
3094
|
+
])))
|
|
3095
|
+
]));
|
|
3096
|
+
return {
|
|
3097
|
+
VariableDeclarator(path) {
|
|
3098
|
+
if (!matcher3.match(path.node))
|
|
3099
|
+
return;
|
|
3100
|
+
const binding = path.scope.getBinding(callController.current);
|
|
3101
|
+
if (!binding)
|
|
3102
|
+
return;
|
|
3103
|
+
binding.referencePaths.filter((ref) => ref.parent.type === "CallExpression").forEach((ref) => {
|
|
3104
|
+
if (ref.parentPath?.parent.type === "CallExpression") {
|
|
3105
|
+
ref.parentPath.parentPath?.remove();
|
|
3106
|
+
} else {
|
|
3107
|
+
removeSelfDefendingRefs(ref);
|
|
3108
|
+
}
|
|
3109
|
+
findParent(ref, emptyIife)?.remove();
|
|
3110
|
+
this.changes++;
|
|
3111
|
+
});
|
|
3112
|
+
path.remove();
|
|
3113
|
+
this.changes++;
|
|
3114
|
+
}
|
|
3115
|
+
};
|
|
3116
|
+
}
|
|
3117
|
+
};
|
|
3118
|
+
|
|
3044
3119
|
// /home/mochaa/ghq/git.sr.ht/~self/delance-builder/node_modules/webcrack/src/unminify/transforms/index.ts
|
|
3045
3120
|
var exports_transforms = {};
|
|
3046
3121
|
__export(exports_transforms, {
|
|
@@ -3146,37 +3221,37 @@ __export(exports_transforms, {
|
|
|
3146
3221
|
}
|
|
3147
3222
|
});
|
|
3148
3223
|
|
|
3149
|
-
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=
|
|
3150
|
-
import * as
|
|
3224
|
+
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=0e061d97d589024b2_s6fkzgrdmtnd5jvdjo64potfwe/node_modules/webcrack/src/unminify/transforms/block-statements.ts
|
|
3225
|
+
import * as t21 from "@babel/types";
|
|
3151
3226
|
var block_statements_default = {
|
|
3152
3227
|
name: "block-statements",
|
|
3153
3228
|
tags: ["safe"],
|
|
3154
3229
|
visitor: () => ({
|
|
3155
3230
|
IfStatement: {
|
|
3156
3231
|
exit(path) {
|
|
3157
|
-
if (!
|
|
3158
|
-
path.node.consequent =
|
|
3232
|
+
if (!t21.isBlockStatement(path.node.consequent) && !t21.isEmptyStatement(path.node.consequent)) {
|
|
3233
|
+
path.node.consequent = t21.blockStatement([path.node.consequent]);
|
|
3159
3234
|
this.changes++;
|
|
3160
3235
|
}
|
|
3161
|
-
if (path.node.alternate && !
|
|
3162
|
-
path.node.alternate =
|
|
3236
|
+
if (path.node.alternate && !t21.isBlockStatement(path.node.alternate)) {
|
|
3237
|
+
path.node.alternate = t21.blockStatement([path.node.alternate]);
|
|
3163
3238
|
this.changes++;
|
|
3164
3239
|
}
|
|
3165
3240
|
}
|
|
3166
3241
|
},
|
|
3167
3242
|
Loop: {
|
|
3168
3243
|
exit(path) {
|
|
3169
|
-
if (!
|
|
3170
|
-
path.node.body =
|
|
3244
|
+
if (!t21.isBlockStatement(path.node.body) && !t21.isEmptyStatement(path.node.body)) {
|
|
3245
|
+
path.node.body = t21.blockStatement([path.node.body]);
|
|
3171
3246
|
this.changes++;
|
|
3172
3247
|
}
|
|
3173
3248
|
}
|
|
3174
3249
|
},
|
|
3175
3250
|
ArrowFunctionExpression: {
|
|
3176
3251
|
exit(path) {
|
|
3177
|
-
if (
|
|
3178
|
-
path.node.body =
|
|
3179
|
-
|
|
3252
|
+
if (t21.isSequenceExpression(path.node.body)) {
|
|
3253
|
+
path.node.body = t21.blockStatement([
|
|
3254
|
+
t21.returnStatement(path.node.body)
|
|
3180
3255
|
]);
|
|
3181
3256
|
this.changes++;
|
|
3182
3257
|
}
|
|
@@ -3184,9 +3259,9 @@ var block_statements_default = {
|
|
|
3184
3259
|
}
|
|
3185
3260
|
})
|
|
3186
3261
|
};
|
|
3187
|
-
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=
|
|
3262
|
+
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=0e061d97d589024b2_s6fkzgrdmtnd5jvdjo64potfwe/node_modules/webcrack/src/unminify/transforms/computed-properties.ts
|
|
3188
3263
|
import {isIdentifierName} from "@babel/helper-validator-identifier";
|
|
3189
|
-
import * as
|
|
3264
|
+
import * as t22 from "@babel/types";
|
|
3190
3265
|
var computed_properties_default = {
|
|
3191
3266
|
name: "computed-properties",
|
|
3192
3267
|
tags: ["safe"],
|
|
@@ -3200,7 +3275,7 @@ var computed_properties_default = {
|
|
|
3200
3275
|
if (!propertyMatcher.match(path.node))
|
|
3201
3276
|
return;
|
|
3202
3277
|
path.node.computed = false;
|
|
3203
|
-
path.node.property =
|
|
3278
|
+
path.node.property = t22.identifier(stringMatcher.current.value);
|
|
3204
3279
|
this.changes++;
|
|
3205
3280
|
}
|
|
3206
3281
|
},
|
|
@@ -3211,15 +3286,15 @@ var computed_properties_default = {
|
|
|
3211
3286
|
if (path.type === "ClassMethod" && stringMatcher.current.value === "constructor" || path.type === "ObjectProperty" && stringMatcher.current.value === "__proto__")
|
|
3212
3287
|
return;
|
|
3213
3288
|
path.node.computed = false;
|
|
3214
|
-
path.node.key =
|
|
3289
|
+
path.node.key = t22.identifier(stringMatcher.current.value);
|
|
3215
3290
|
this.changes++;
|
|
3216
3291
|
}
|
|
3217
3292
|
}
|
|
3218
3293
|
};
|
|
3219
3294
|
}
|
|
3220
3295
|
};
|
|
3221
|
-
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=
|
|
3222
|
-
import * as
|
|
3296
|
+
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=0e061d97d589024b2_s6fkzgrdmtnd5jvdjo64potfwe/node_modules/webcrack/src/unminify/transforms/for-to-while.ts
|
|
3297
|
+
import * as t23 from "@babel/types";
|
|
3223
3298
|
var for_to_while_default = {
|
|
3224
3299
|
name: "for-to-while",
|
|
3225
3300
|
tags: ["safe"],
|
|
@@ -3230,15 +3305,15 @@ var for_to_while_default = {
|
|
|
3230
3305
|
const { test, body, init, update } = path.node;
|
|
3231
3306
|
if (init || update)
|
|
3232
3307
|
return;
|
|
3233
|
-
path.replaceWith(
|
|
3308
|
+
path.replaceWith(t23.whileStatement(test ?? t23.booleanLiteral(true), body));
|
|
3234
3309
|
this.changes++;
|
|
3235
3310
|
}
|
|
3236
3311
|
}
|
|
3237
3312
|
};
|
|
3238
3313
|
}
|
|
3239
3314
|
};
|
|
3240
|
-
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=
|
|
3241
|
-
import * as
|
|
3315
|
+
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=0e061d97d589024b2_s6fkzgrdmtnd5jvdjo64potfwe/node_modules/webcrack/src/unminify/transforms/infinity.ts
|
|
3316
|
+
import * as t24 from "@babel/types";
|
|
3242
3317
|
var infinity_default = {
|
|
3243
3318
|
name: "infinity",
|
|
3244
3319
|
tags: ["safe"],
|
|
@@ -3252,10 +3327,10 @@ var infinity_default = {
|
|
|
3252
3327
|
if (path.scope.hasBinding("Infinity", { noGlobals: true }))
|
|
3253
3328
|
return;
|
|
3254
3329
|
if (infinityMatcher.match(path.node)) {
|
|
3255
|
-
path.replaceWith(
|
|
3330
|
+
path.replaceWith(t24.identifier("Infinity"));
|
|
3256
3331
|
this.changes++;
|
|
3257
3332
|
} else if (negativeInfinityMatcher.match(path.node)) {
|
|
3258
|
-
path.replaceWith(
|
|
3333
|
+
path.replaceWith(t24.unaryExpression("-", t24.identifier("Infinity")));
|
|
3259
3334
|
this.changes++;
|
|
3260
3335
|
}
|
|
3261
3336
|
}
|
|
@@ -3263,8 +3338,8 @@ var infinity_default = {
|
|
|
3263
3338
|
};
|
|
3264
3339
|
}
|
|
3265
3340
|
};
|
|
3266
|
-
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=
|
|
3267
|
-
import * as
|
|
3341
|
+
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=0e061d97d589024b2_s6fkzgrdmtnd5jvdjo64potfwe/node_modules/webcrack/src/unminify/transforms/invert-boolean-logic.ts
|
|
3342
|
+
import * as t25 from "@babel/types";
|
|
3268
3343
|
var INVERTED_BINARY_OPERATORS = {
|
|
3269
3344
|
"==": "!=",
|
|
3270
3345
|
"===": "!==",
|
|
@@ -3299,9 +3374,9 @@ var invert_boolean_logic_default = {
|
|
|
3299
3374
|
let current = argument;
|
|
3300
3375
|
while (logicalExpression2.match(current)) {
|
|
3301
3376
|
current.operator = INVERTED_LOGICAL_OPERATORS[current.operator];
|
|
3302
|
-
current.right =
|
|
3377
|
+
current.right = t25.unaryExpression("!", current.right);
|
|
3303
3378
|
if (!logicalExpression2.match(current.left)) {
|
|
3304
|
-
current.left =
|
|
3379
|
+
current.left = t25.unaryExpression("!", current.left);
|
|
3305
3380
|
}
|
|
3306
3381
|
current = current.left;
|
|
3307
3382
|
}
|
|
@@ -3313,7 +3388,7 @@ var invert_boolean_logic_default = {
|
|
|
3313
3388
|
};
|
|
3314
3389
|
}
|
|
3315
3390
|
};
|
|
3316
|
-
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=
|
|
3391
|
+
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=0e061d97d589024b2_s6fkzgrdmtnd5jvdjo64potfwe/node_modules/webcrack/src/unminify/transforms/json-parse.ts
|
|
3317
3392
|
import {parseExpression} from "@babel/parser";
|
|
3318
3393
|
var json_parse_default = {
|
|
3319
3394
|
name: "json-parse",
|
|
@@ -3341,27 +3416,28 @@ var json_parse_default = {
|
|
|
3341
3416
|
};
|
|
3342
3417
|
}
|
|
3343
3418
|
};
|
|
3344
|
-
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=
|
|
3419
|
+
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=0e061d97d589024b2_s6fkzgrdmtnd5jvdjo64potfwe/node_modules/webcrack/src/unminify/transforms/logical-to-if.ts
|
|
3345
3420
|
import {statement} from "@babel/template";
|
|
3421
|
+
import * as t26 from "@babel/types";
|
|
3346
3422
|
var logical_to_if_default = {
|
|
3347
3423
|
name: "logical-to-if",
|
|
3348
3424
|
tags: ["safe"],
|
|
3349
3425
|
visitor: () => {
|
|
3350
|
-
const andMatcher = expressionStatement(logicalExpression("&&"));
|
|
3351
|
-
const orMatcher = expressionStatement(logicalExpression("||"));
|
|
3352
3426
|
const buildIf = statement`if (TEST) { BODY; }`;
|
|
3353
3427
|
const buildIfNot = statement`if (!TEST) { BODY; }`;
|
|
3354
3428
|
return {
|
|
3355
3429
|
ExpressionStatement: {
|
|
3356
3430
|
exit(path) {
|
|
3357
3431
|
const expression2 = path.node.expression;
|
|
3358
|
-
if (
|
|
3432
|
+
if (!t26.isLogicalExpression(expression2))
|
|
3433
|
+
return;
|
|
3434
|
+
if (expression2.operator === "&&") {
|
|
3359
3435
|
path.replaceWith(buildIf({
|
|
3360
3436
|
TEST: expression2.left,
|
|
3361
3437
|
BODY: expression2.right
|
|
3362
3438
|
}));
|
|
3363
3439
|
this.changes++;
|
|
3364
|
-
} else if (
|
|
3440
|
+
} else if (expression2.operator === "||") {
|
|
3365
3441
|
path.replaceWith(buildIfNot({
|
|
3366
3442
|
TEST: expression2.left,
|
|
3367
3443
|
BODY: expression2.right
|
|
@@ -3373,7 +3449,7 @@ var logical_to_if_default = {
|
|
|
3373
3449
|
};
|
|
3374
3450
|
}
|
|
3375
3451
|
};
|
|
3376
|
-
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=
|
|
3452
|
+
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=0e061d97d589024b2_s6fkzgrdmtnd5jvdjo64potfwe/node_modules/webcrack/src/unminify/transforms/merge-else-if.ts
|
|
3377
3453
|
var merge_else_if_default = {
|
|
3378
3454
|
name: "merge-else-if",
|
|
3379
3455
|
tags: ["safe"],
|
|
@@ -3392,7 +3468,7 @@ var merge_else_if_default = {
|
|
|
3392
3468
|
};
|
|
3393
3469
|
}
|
|
3394
3470
|
};
|
|
3395
|
-
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=
|
|
3471
|
+
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=0e061d97d589024b2_s6fkzgrdmtnd5jvdjo64potfwe/node_modules/webcrack/src/unminify/transforms/number-expressions.ts
|
|
3396
3472
|
import * as t27 from "@babel/types";
|
|
3397
3473
|
var number_expressions_default = {
|
|
3398
3474
|
name: "number-expressions",
|
|
@@ -3400,23 +3476,21 @@ var number_expressions_default = {
|
|
|
3400
3476
|
visitor: () => ({
|
|
3401
3477
|
"BinaryExpression|UnaryExpression": {
|
|
3402
3478
|
exit(path) {
|
|
3403
|
-
if (matcher3.match(path.node))
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
}
|
|
3409
|
-
path.replaceWith(t27.valueToNode(evaluated.value));
|
|
3410
|
-
path.skip();
|
|
3411
|
-
this.changes++;
|
|
3412
|
-
}
|
|
3479
|
+
if (!matcher3.match(path.node))
|
|
3480
|
+
return;
|
|
3481
|
+
const evaluated = path.evaluate();
|
|
3482
|
+
if (t27.isBinaryExpression(path.node, { operator: "/" }) && !Number.isInteger(evaluated.value)) {
|
|
3483
|
+
return;
|
|
3413
3484
|
}
|
|
3485
|
+
path.replaceWith(t27.valueToNode(evaluated.value));
|
|
3486
|
+
path.skip();
|
|
3487
|
+
this.changes++;
|
|
3414
3488
|
}
|
|
3415
3489
|
}
|
|
3416
3490
|
})
|
|
3417
3491
|
};
|
|
3418
|
-
var matcher3 = or(binaryExpression(or("+", "-", "
|
|
3419
|
-
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=
|
|
3492
|
+
var matcher3 = or(unaryExpression("-", or(stringLiteral(), numericLiteral())), binaryExpression(or("+", "-", "/", "%", "*", "**", "&", "|", ">>", ">>>", "<<", "^"), or(stringLiteral(), numericLiteral(), unaryExpression("-", numericLiteral())), or(stringLiteral(), numericLiteral(), unaryExpression("-", numericLiteral()))));
|
|
3493
|
+
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=0e061d97d589024b2_s6fkzgrdmtnd5jvdjo64potfwe/node_modules/webcrack/src/unminify/transforms/raw-literals.ts
|
|
3420
3494
|
var raw_literals_default = {
|
|
3421
3495
|
name: "raw-literals",
|
|
3422
3496
|
tags: ["safe"],
|
|
@@ -3435,7 +3509,7 @@ var raw_literals_default = {
|
|
|
3435
3509
|
}
|
|
3436
3510
|
})
|
|
3437
3511
|
};
|
|
3438
|
-
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=
|
|
3512
|
+
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=0e061d97d589024b2_s6fkzgrdmtnd5jvdjo64potfwe/node_modules/webcrack/src/unminify/transforms/sequence.ts
|
|
3439
3513
|
import * as t28 from "@babel/types";
|
|
3440
3514
|
var sequence_default = {
|
|
3441
3515
|
name: "sequence",
|
|
@@ -3557,7 +3631,7 @@ var sequence_default = {
|
|
|
3557
3631
|
};
|
|
3558
3632
|
}
|
|
3559
3633
|
};
|
|
3560
|
-
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=
|
|
3634
|
+
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=0e061d97d589024b2_s6fkzgrdmtnd5jvdjo64potfwe/node_modules/webcrack/src/unminify/transforms/split-for-loop-vars.ts
|
|
3561
3635
|
import * as t29 from "@babel/types";
|
|
3562
3636
|
var matcher4 = forStatement(variableDeclaration("var", arrayOf(variableDeclarator(identifier()))));
|
|
3563
3637
|
var split_for_loop_vars_default = {
|
|
@@ -3590,7 +3664,7 @@ var split_for_loop_vars_default = {
|
|
|
3590
3664
|
}
|
|
3591
3665
|
})
|
|
3592
3666
|
};
|
|
3593
|
-
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=
|
|
3667
|
+
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=0e061d97d589024b2_s6fkzgrdmtnd5jvdjo64potfwe/node_modules/webcrack/src/unminify/transforms/split-variable-declarations.ts
|
|
3594
3668
|
import * as t30 from "@babel/types";
|
|
3595
3669
|
var split_variable_declarations_default = {
|
|
3596
3670
|
name: "split-variable-declarations",
|
|
@@ -3618,7 +3692,7 @@ var split_variable_declarations_default = {
|
|
|
3618
3692
|
}
|
|
3619
3693
|
})
|
|
3620
3694
|
};
|
|
3621
|
-
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=
|
|
3695
|
+
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=0e061d97d589024b2_s6fkzgrdmtnd5jvdjo64potfwe/node_modules/webcrack/src/unminify/transforms/ternary-to-if.ts
|
|
3622
3696
|
import {statement as statement2} from "@babel/template";
|
|
3623
3697
|
var ternary_to_if_default = {
|
|
3624
3698
|
name: "ternary-to-if",
|
|
@@ -3658,7 +3732,7 @@ var ternary_to_if_default = {
|
|
|
3658
3732
|
};
|
|
3659
3733
|
}
|
|
3660
3734
|
};
|
|
3661
|
-
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=
|
|
3735
|
+
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=0e061d97d589024b2_s6fkzgrdmtnd5jvdjo64potfwe/node_modules/webcrack/src/unminify/transforms/typeof-undefined.ts
|
|
3662
3736
|
import * as t31 from "@babel/types";
|
|
3663
3737
|
var OPERATOR_MAP = {
|
|
3664
3738
|
">": "===",
|
|
@@ -3683,7 +3757,7 @@ var typeof_undefined_default = {
|
|
|
3683
3757
|
};
|
|
3684
3758
|
}
|
|
3685
3759
|
};
|
|
3686
|
-
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=
|
|
3760
|
+
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=0e061d97d589024b2_s6fkzgrdmtnd5jvdjo64potfwe/node_modules/webcrack/src/unminify/transforms/unary-expressions.ts
|
|
3687
3761
|
import * as t32 from "@babel/types";
|
|
3688
3762
|
var unary_expressions_default = {
|
|
3689
3763
|
name: "unary-expressions",
|
|
@@ -3713,7 +3787,7 @@ var unary_expressions_default = {
|
|
|
3713
3787
|
};
|
|
3714
3788
|
}
|
|
3715
3789
|
};
|
|
3716
|
-
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=
|
|
3790
|
+
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=0e061d97d589024b2_s6fkzgrdmtnd5jvdjo64potfwe/node_modules/webcrack/src/unminify/transforms/unminify-booleans.ts
|
|
3717
3791
|
import * as t33 from "@babel/types";
|
|
3718
3792
|
var unminify_booleans_default = {
|
|
3719
3793
|
name: "unminify-booleans",
|
|
@@ -3732,7 +3806,7 @@ var unminify_booleans_default = {
|
|
|
3732
3806
|
};
|
|
3733
3807
|
var trueMatcher2 = or(unaryExpression("!", numericLiteral(0)), unaryExpression("!", unaryExpression("!", numericLiteral(1))), unaryExpression("!", unaryExpression("!", arrayExpression([]))));
|
|
3734
3808
|
var falseMatcher2 = or(unaryExpression("!", numericLiteral(1)), unaryExpression("!", arrayExpression([])));
|
|
3735
|
-
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=
|
|
3809
|
+
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=0e061d97d589024b2_s6fkzgrdmtnd5jvdjo64potfwe/node_modules/webcrack/src/unminify/transforms/void-to-undefined.ts
|
|
3736
3810
|
import * as t34 from "@babel/types";
|
|
3737
3811
|
var void_to_undefined_default = {
|
|
3738
3812
|
name: "void-to-undefined",
|
|
@@ -3752,7 +3826,7 @@ var void_to_undefined_default = {
|
|
|
3752
3826
|
};
|
|
3753
3827
|
}
|
|
3754
3828
|
};
|
|
3755
|
-
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=
|
|
3829
|
+
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=0e061d97d589024b2_s6fkzgrdmtnd5jvdjo64potfwe/node_modules/webcrack/src/unminify/transforms/yoda.ts
|
|
3756
3830
|
import * as t35 from "@babel/types";
|
|
3757
3831
|
var FLIPPED_OPERATORS = {
|
|
3758
3832
|
"==": "==",
|
|
@@ -3804,6 +3878,7 @@ async function transform2(ast2) {
|
|
|
3804
3878
|
}));
|
|
3805
3879
|
applyTransform(ast2, unminify_default);
|
|
3806
3880
|
applyTransform(ast2, merge_object_assignments_default);
|
|
3881
|
+
applyTransform(ast2, self_defending_default);
|
|
3807
3882
|
return ast2;
|
|
3808
3883
|
}
|
|
3809
3884
|
|
|
@@ -4229,7 +4304,7 @@ function transform4(ast2) {
|
|
|
4229
4304
|
return ast2;
|
|
4230
4305
|
}
|
|
4231
4306
|
|
|
4232
|
-
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=
|
|
4307
|
+
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=0e061d97d589024b2_s6fkzgrdmtnd5jvdjo64potfwe/node_modules/webcrack/src/transpile/transforms/index.ts
|
|
4233
4308
|
var exports_transforms2 = {};
|
|
4234
4309
|
__export(exports_transforms2, {
|
|
4235
4310
|
templateLiterals: () => {
|
|
@@ -4264,7 +4339,7 @@ __export(exports_transforms2, {
|
|
|
4264
4339
|
}
|
|
4265
4340
|
});
|
|
4266
4341
|
|
|
4267
|
-
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=
|
|
4342
|
+
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=0e061d97d589024b2_s6fkzgrdmtnd5jvdjo64potfwe/node_modules/webcrack/src/transpile/transforms/default-parameters.ts
|
|
4268
4343
|
import * as t39 from "@babel/types";
|
|
4269
4344
|
var default_parameters_default = {
|
|
4270
4345
|
name: "default-parameters",
|
|
@@ -4274,14 +4349,23 @@ var default_parameters_default = {
|
|
|
4274
4349
|
const defaultExpression = capture(anyExpression());
|
|
4275
4350
|
const index = capture(numericLiteral());
|
|
4276
4351
|
const varName = capture(identifier());
|
|
4352
|
+
const varId = capture(or(identifier(), arrayPattern(), objectPattern()));
|
|
4353
|
+
const argumentCheckAnd = logicalExpression("&&", binaryExpression(">", constMemberExpression("arguments", "length"), index), binaryExpression("!==", memberExpression(identifier("arguments"), fromCapture(index), true), identifier("undefined")));
|
|
4354
|
+
const argumentCheckOr = logicalExpression("||", binaryExpression("<=", constMemberExpression("arguments", "length"), index), binaryExpression("===", memberExpression(identifier("arguments"), fromCapture(index), true), identifier("undefined")));
|
|
4277
4355
|
const defaultParam = variableDeclaration(undefined, [
|
|
4278
|
-
variableDeclarator(
|
|
4356
|
+
variableDeclarator(varId, conditionalExpression(argumentCheckAnd, memberExpression(identifier("arguments"), fromCapture(index), true), defaultExpression))
|
|
4357
|
+
]);
|
|
4358
|
+
const defaultFalseParam = variableDeclaration(undefined, [
|
|
4359
|
+
variableDeclarator(varId, logicalExpression("&&", argumentCheckAnd, memberExpression(identifier("arguments"), fromCapture(index), true)))
|
|
4360
|
+
]);
|
|
4361
|
+
const defaultTrueParam = variableDeclaration(undefined, [
|
|
4362
|
+
variableDeclarator(varId, logicalExpression("||", argumentCheckOr, memberExpression(identifier("arguments"), fromCapture(index), true)))
|
|
4279
4363
|
]);
|
|
4280
4364
|
const defaultParamLoose = ifStatement(binaryExpression("===", varName, identifier("undefined")), blockStatement([
|
|
4281
4365
|
expressionStatement(assignmentExpression("=", fromCapture(varName), defaultExpression))
|
|
4282
4366
|
]));
|
|
4283
4367
|
const normalParam = variableDeclaration(undefined, [
|
|
4284
|
-
variableDeclarator(
|
|
4368
|
+
variableDeclarator(varId, conditionalExpression(binaryExpression(">", constMemberExpression("arguments", "length"), index), memberExpression(identifier("arguments"), fromCapture(index), true), identifier("undefined")))
|
|
4285
4369
|
]);
|
|
4286
4370
|
return {
|
|
4287
4371
|
VariableDeclaration: {
|
|
@@ -4289,15 +4373,15 @@ var default_parameters_default = {
|
|
|
4289
4373
|
const fn = path.parentPath.parent;
|
|
4290
4374
|
if (!t39.isFunction(fn) || path.key !== 0)
|
|
4291
4375
|
return;
|
|
4292
|
-
|
|
4293
|
-
|
|
4294
|
-
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
fn.params[index.current.value] = varName.current;
|
|
4298
|
-
path.remove();
|
|
4299
|
-
this.changes++;
|
|
4376
|
+
const newParam = defaultParam.match(path.node) ? t39.assignmentPattern(varId.current, defaultExpression.current) : defaultFalseParam.match(path.node) ? t39.assignmentPattern(varId.current, t39.booleanLiteral(false)) : defaultTrueParam.match(path.node) ? t39.assignmentPattern(varId.current, t39.booleanLiteral(true)) : normalParam.match(path.node) ? varId.current : null;
|
|
4377
|
+
if (!newParam)
|
|
4378
|
+
return;
|
|
4379
|
+
for (let i = fn.params.length;i < index.current.value; i++) {
|
|
4380
|
+
fn.params[i] = t39.identifier(path.scope.generateUid("param"));
|
|
4300
4381
|
}
|
|
4382
|
+
fn.params[index.current.value] = newParam;
|
|
4383
|
+
path.remove();
|
|
4384
|
+
this.changes++;
|
|
4301
4385
|
}
|
|
4302
4386
|
},
|
|
4303
4387
|
IfStatement: {
|
|
@@ -4321,7 +4405,7 @@ var default_parameters_default = {
|
|
|
4321
4405
|
};
|
|
4322
4406
|
}
|
|
4323
4407
|
};
|
|
4324
|
-
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=
|
|
4408
|
+
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=0e061d97d589024b2_s6fkzgrdmtnd5jvdjo64potfwe/node_modules/webcrack/src/transpile/transforms/logical-assignments.ts
|
|
4325
4409
|
import * as t40 from "@babel/types";
|
|
4326
4410
|
var logical_assignments_default = {
|
|
4327
4411
|
name: "logical-assignments",
|
|
@@ -4376,7 +4460,7 @@ var logical_assignments_default = {
|
|
|
4376
4460
|
};
|
|
4377
4461
|
}
|
|
4378
4462
|
};
|
|
4379
|
-
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=
|
|
4463
|
+
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=0e061d97d589024b2_s6fkzgrdmtnd5jvdjo64potfwe/node_modules/webcrack/src/transpile/transforms/nullish-coalescing.ts
|
|
4380
4464
|
import * as t41 from "@babel/types";
|
|
4381
4465
|
var nullish_coalescing_default = {
|
|
4382
4466
|
name: "nullish-coalescing",
|
|
@@ -4419,7 +4503,7 @@ var nullish_coalescing_default = {
|
|
|
4419
4503
|
};
|
|
4420
4504
|
}
|
|
4421
4505
|
};
|
|
4422
|
-
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=
|
|
4506
|
+
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=0e061d97d589024b2_s6fkzgrdmtnd5jvdjo64potfwe/node_modules/webcrack/src/transpile/transforms/nullish-coalescing-assignment.ts
|
|
4423
4507
|
import * as t42 from "@babel/types";
|
|
4424
4508
|
var nullish_coalescing_assignment_default = {
|
|
4425
4509
|
name: "nullish-coalescing-assignment",
|
|
@@ -4453,7 +4537,7 @@ var nullish_coalescing_assignment_default = {
|
|
|
4453
4537
|
};
|
|
4454
4538
|
}
|
|
4455
4539
|
};
|
|
4456
|
-
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=
|
|
4540
|
+
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=0e061d97d589024b2_s6fkzgrdmtnd5jvdjo64potfwe/node_modules/webcrack/src/transpile/transforms/optional-chaining.ts
|
|
4457
4541
|
import * as t43 from "@babel/types";
|
|
4458
4542
|
var optional_chaining_default = {
|
|
4459
4543
|
name: "optional-chaining",
|
|
@@ -4487,7 +4571,7 @@ var optional_chaining_default = {
|
|
|
4487
4571
|
};
|
|
4488
4572
|
}
|
|
4489
4573
|
};
|
|
4490
|
-
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=
|
|
4574
|
+
// node_modules/.pnpm/@gitpkg.vercel.app+api+pkg.tgz+url=j4k0xb+webcrack+packages@webcrack&commit=0e061d97d589024b2_s6fkzgrdmtnd5jvdjo64potfwe/node_modules/webcrack/src/transpile/transforms/template-literals.ts
|
|
4491
4575
|
import * as t44 from "@babel/types";
|
|
4492
4576
|
var escape2 = function(str) {
|
|
4493
4577
|
return str.replaceAll("\\", "\\\\").replaceAll("`", "\\`").replaceAll("$", "\\$").replaceAll("\0", "\\0").replaceAll("\b", "\\b").replaceAll("\f", "\\f").replaceAll("\r", "\\r").replaceAll("\t", "\\t").replaceAll("\v", "\\v");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@delance/builder",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.11",
|
|
4
4
|
"description": "A spear to the Python language server built with black magic",
|
|
5
5
|
"license": "0BSD",
|
|
6
6
|
"author": "mochaaP <npm@mochaa.ws>",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"bun": "^1.0.35",
|
|
84
84
|
"rimraf": "^5.0.5",
|
|
85
85
|
"typescript": "^5.4.3",
|
|
86
|
-
"webcrack": "https://gitpkg.vercel.app/api/pkg.tgz?url=j4k0xb/webcrack/packages/webcrack&commit=
|
|
86
|
+
"webcrack": "https://gitpkg.vercel.app/api/pkg.tgz?url=j4k0xb/webcrack/packages/webcrack&commit=0e061d97d589024b270e92dc8681a068426b4076&scripts.postinstall=rimraf tsconfig.json",
|
|
87
87
|
"xo": "^0.58.0"
|
|
88
88
|
},
|
|
89
89
|
"peerDependencies": {
|