@dacely/toildefender 0.1.2 → 0.1.4

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  <div align="center">
2
2
 
3
- <img src="./images/toildefender4.svg" alt="ToilDefender" width="600" />
3
+ <img src="./images/toildefender6.svg" alt="ToilDefender" width="600" />
4
4
 
5
5
 
6
6
  ### JavaScript code protection for the Toil stack.
@@ -155,7 +155,8 @@ function licenseGate(input) {
155
155
  globalThis.__result = licenseGate("Veilmark");
156
156
  ```
157
157
 
158
- The demo artifact is generated with every major protection enabled:
158
+ The demo artifact is generated with every major protection enabled and
159
+ compression disabled so the runtime stays readable:
159
160
 
160
161
  ```js
161
162
  features: {
@@ -167,7 +168,7 @@ features: {
167
168
  object_packing: true,
168
169
  literals: true,
169
170
  mangle: true,
170
- compress: true
171
+ compress: false
171
172
  },
172
173
  protections: {
173
174
  virtualMachine: {
@@ -194,19 +195,19 @@ protections: {
194
195
 
195
196
  The complete beautified generated output is committed at
196
197
  [docs/all-modes-output.demo.js](./docs/all-modes-output.demo.js). It is a real
197
- 673-line artifact from the current generator and executes to:
198
+ 961-line artifact from the current generator and executes to:
198
199
 
199
200
  Output excerpt:
200
201
 
201
202
  ```js
202
203
  (function () {
203
204
  function a(f, j) {
204
- var b = new Array(96);
205
+ var b = new Array(105);
205
206
  ;
206
207
  var c = arguments;
207
208
  while (true) try {
208
209
  switch (f) {
209
- case 25271:
210
+ case 8455:
210
211
  b[11] = c[11];
211
212
  b[12] = c[10];
212
213
  b[13] = c[9];
@@ -217,58 +218,63 @@ Output excerpt:
217
218
  b[18] = c[4];
218
219
  b[19] = c[3];
219
220
  b[20] = c[2];
220
- b[21] = e(a, 26903, b, c[1]);
221
- b[22] = e(a, 13834, b, c[1]);
222
- b[23] = e(a, 24871, b, c[1]);
223
- b[24] = e(a, 3126, b, c[1]);
224
- b[25] = e(a, 24897, b, c[1]);
225
- b[26] = e(a, 32340, b, c[1]);
221
+ b[21] = e(a, 739, b, c[1]);
222
+ b[22] = e(a, 22884, b, c[1]);
223
+ b[23] = e(a, 24756, b, c[1]);
224
+ b[24] = e(a, 11593, b, c[1]);
225
+ b[25] = e(a, 5522, b, c[1]);
226
+ b[26] = e(a, 21472, b, c[1]);
227
+ b[27] = e(a, 16279, b, c[1]);
228
+ b[28] = e(a, 17195, b, c[1]);
229
+ b[29] = e(a, 27528, b, c[1]);
230
+ b[30] = e(a, 23881, b, c[1]);
231
+ b[31] = e(a, 14569, b, c[1]);
232
+ b[32] = e(a, 21646, b, c[1]);
233
+ b[33] = e(a, 2482, b, c[1]);
234
+ b[34] = e(a, 15554, b, c[1]);
235
+ b[35] = BigInt(b[19]);
236
+ b[36] = [1n];
237
+ b[37] = c[1][10][1];
238
+ b[38] = c[1][10][1];
226
239
  if (b[11]) {
227
- b[20] = c[1][2](b[20], b[19], b[18], b[17], b[16], b[12], b[11]);
240
+ b[37] = c[1][4](b[11], b[19], b[18], b[17], b[16], b[12]);
241
+ b[38] = b[11][c[1][10][24]] >>> c[1][10][1];
228
242
  }
229
- b[27] = [];
230
- b[28] = b[17] >>> c[1][9][1];
231
- b[29] = b[17] >>> c[1][9][1];
232
- b[30] = BigInt(b[19]);
233
- b[31] = c[1][9][1];
234
- while (b[31] < b[18]) {
235
- b[32] = Number(b[20] % b[30]);
236
- b[20] = b[20] / b[30];
237
- b[33] = c[1][9][5] + (b[28] >>> c[1][9][24]) % (b[19] - c[1][9][5]);
238
- b[34] = b[28] % b[19];
239
- b[35] = (b[32] - b[34] + b[19]) % b[19] * b[26](b[33], b[19]) % b[19];
240
- b[27][c[1][9][29]](b[35]);
241
- b[29] = b[25](b[29], b[32], b[31]);
242
- b[28] = b[25](b[28], b[32], b[31]);
243
- b[31] += c[1][9][5];
243
+ b[39] = c[1][10][1];
244
+ b[40] = b[17] >>> c[1][10][1];
245
+ while (b[39] < b[18]) {
246
+ b[41] = b[32](b[39]);
247
+ b[40] = b[33](b[40], b[41], b[39]);
248
+ b[39] += c[1][10][5];
244
249
  }
245
- if (b[29] >>> c[1][9][1] !== b[16] >>> c[1][9][1]) throw new Error(c[1][9][30]);
246
- b[36] = [];
247
- b[37] = [];
248
- b[38] = Array[c[1][9][31]][c[1][9][32]][c[1][9][33]](b[14]);
249
- b[39] = c[1][9][1];
250
- while (c[1][9][38]) {
251
- b[40] = b[24]();
252
- if (b[40] === b[12][c[1][9][1]]) continue;
253
- if (b[40] === b[12][c[1][9][5]]) {
254
- b[36][c[1][9][29]](undefined);
255
- continue;
256
- }
257
- if (b[40] === b[12][c[1][9][28]]) {
258
- b[36][c[1][9][29]](c[1][9][39]);
259
- continue;
260
- }
261
-
262
- /* 600+ more generated lines:
263
- dispatcher cases, encoded literals, VM bytecode decode,
264
- BigInt program blobs, randomized opcode tables, and Hash-Mesh unlock */
265
-
266
- case 11237:
250
+ if (b[40] >>> c[1][10][1] !== b[16] >>> c[1][10][1]) throw new Error(c[1][10][29]);
251
+ b[42] = c[1][10][1];
252
+ b[43] = b[17] >>> c[1][10][1];
253
+ b[44] = b[17] & c[1][10][5];
254
+ b[45] = b[44] ? c[1][10][30] : [];
255
+ b[46] = b[44] ? c[1][10][30] : [];
256
+ b[47] = b[44] ? h([
257
+ /* encoded layout keys */
258
+ ], [
259
+ [],
260
+ Object[c[1][10][36]](c[1][10][30])
261
+ ]) : c[1][10][30];
262
+
263
+ /* 900+ more generated lines:
264
+ dispatcher cases, encoded literals, streaming VM token reads,
265
+ seed-selected stack/local storage, BigInt program blobs,
266
+ randomized opcode tables, and Hash-Mesh unwrap */
267
+
268
+ case 11593:
269
+ if (c[1][49] < c[2][10][1] || c[1][49] >= c[1][18]) throw new Error(c[2][10][45]);
270
+ b[1] = c[1][30](c[1][49]);
271
+ c[1][49] += c[2][10][5];
272
+ return b[1];
273
+ case 5206:
267
274
  b[1] = '';
268
275
  b[1] += d(86, 101);
269
- b[1] += d(105, 108, 109, 97);
270
- b[1] += d(114);
271
- b[1] += d(107);
276
+ b[1] += d(105, 108, 109);
277
+ b[1] += d(97, 114, 107);
272
278
  return b[1];
273
279
  }
274
280
  } catch (a) {
@@ -279,7 +285,7 @@ Output excerpt:
279
285
  }
280
286
  }
281
287
  }
282
- a(4089, {});
288
+ a(17701, {});
283
289
  })();
284
290
  ```
285
291