objdiff-wasm 3.0.0-beta.9 → 3.0.0

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.
@@ -25,6 +25,20 @@
25
25
  }
26
26
  ]
27
27
  },
28
+ {
29
+ "id": "analyzeDataFlow",
30
+ "type": "boolean",
31
+ "default": false,
32
+ "name": "(Experimental) Perform data flow analysis",
33
+ "description": "Use data flow analysis to display known information about register contents where possible"
34
+ },
35
+ {
36
+ "id": "showDataFlow",
37
+ "type": "boolean",
38
+ "default": true,
39
+ "name": "Show data flow",
40
+ "description": "Show data flow analysis results in place of register name where present"
41
+ },
28
42
  {
29
43
  "id": "spaceBetweenArgs",
30
44
  "type": "boolean",
@@ -264,7 +278,8 @@
264
278
  "id": "ppc",
265
279
  "name": "PowerPC",
266
280
  "properties": [
267
- "ppc.calculatePoolRelocations"
281
+ "ppc.calculatePoolRelocations",
282
+ "analyzeDataFlow"
268
283
  ]
269
284
  },
270
285
  {
@@ -146,7 +146,7 @@ export interface DiffTextSpacing {
146
146
  export interface DiffTextEol {
147
147
  tag: 'eol',
148
148
  }
149
- export type DiffTextColor = DiffTextColorNormal | DiffTextColorDim | DiffTextColorBright | DiffTextColorReplace | DiffTextColorDelete | DiffTextColorInsert | DiffTextColorRotating;
149
+ export type DiffTextColor = DiffTextColorNormal | DiffTextColorDim | DiffTextColorBright | DiffTextColorReplace | DiffTextColorDataFlow | DiffTextColorDelete | DiffTextColorInsert | DiffTextColorRotating;
150
150
  export interface DiffTextColorNormal {
151
151
  tag: 'normal',
152
152
  }
@@ -159,6 +159,9 @@ export interface DiffTextColorBright {
159
159
  export interface DiffTextColorReplace {
160
160
  tag: 'replace',
161
161
  }
162
+ export interface DiffTextColorDataFlow {
163
+ tag: 'data-flow',
164
+ }
162
165
  export interface DiffTextColorDelete {
163
166
  tag: 'delete',
164
167
  }
Binary file
package/dist/objdiff.js CHANGED
@@ -125,7 +125,7 @@ const handleTable0 = [
125
125
  ];
126
126
  const finalizationRegistry0 = finalizationRegistryCreate((handle)=>{
127
127
  const { rep } = rscTableRemove(handleTable0, handle);
128
- exports0['3'](rep);
128
+ exports0['1'](rep);
129
129
  });
130
130
  handleTables[0] = handleTable0;
131
131
  const trampoline0 = rscTableCreateOwn.bind(null, handleTable0);
@@ -145,7 +145,7 @@ const handleTable2 = [
145
145
  ];
146
146
  const finalizationRegistry2 = finalizationRegistryCreate((handle)=>{
147
147
  const { rep } = rscTableRemove(handleTable2, handle);
148
- exports0['1'](rep);
148
+ exports0['3'](rep);
149
149
  });
150
150
  handleTables[2] = handleTable2;
151
151
  const trampoline2 = rscTableCreateOwn.bind(null, handleTable2);
@@ -198,15 +198,15 @@ class DiffConfig {
198
198
  writable: true,
199
199
  value: handle1
200
200
  });
201
- finalizationRegistry2.register(rsc0, handle1, rsc0);
201
+ finalizationRegistry1.register(rsc0, handle1, rsc0);
202
202
  Object.defineProperty(rsc0, symbolDispose, {
203
203
  writable: true,
204
204
  value: function() {
205
- finalizationRegistry2.unregister(rsc0);
206
- rscTableRemove(handleTable2, handle1);
205
+ finalizationRegistry1.unregister(rsc0);
206
+ rscTableRemove(handleTable1, handle1);
207
207
  rsc0[symbolDispose] = emptyFunc;
208
208
  rsc0[symbolRscHandle] = void 0;
209
- exports0['1'](handleTable2[(handle1 << 1) + 1] & ~T_FLAG);
209
+ exports0['2'](handleTable1[(handle1 << 1) + 1] & ~T_FLAG);
210
210
  }
211
211
  });
212
212
  return rsc0;
@@ -215,8 +215,8 @@ class DiffConfig {
215
215
  let diffMethodDiffConfigSetProperty;
216
216
  DiffConfig.prototype.setProperty = function(arg1, arg2) {
217
217
  var handle1 = this[symbolRscHandle];
218
- if (!handle1 || (handleTable2[(handle1 << 1) + 1] & T_FLAG) === 0) throw new TypeError('Resource error: Not a valid "DiffConfig" resource.');
219
- var handle0 = handleTable2[(handle1 << 1) + 1] & ~T_FLAG;
218
+ if (!handle1 || (handleTable1[(handle1 << 1) + 1] & T_FLAG) === 0) throw new TypeError('Resource error: Not a valid "DiffConfig" resource.');
219
+ var handle0 = handleTable1[(handle1 << 1) + 1] & ~T_FLAG;
220
220
  var ptr2 = utf8Encode(arg1, realloc0, memory0);
221
221
  var len2 = utf8EncodedLen;
222
222
  var ptr3 = utf8Encode(arg2, realloc0, memory0);
@@ -250,8 +250,8 @@ DiffConfig.prototype.setProperty = function(arg1, arg2) {
250
250
  let diffMethodDiffConfigGetProperty;
251
251
  DiffConfig.prototype.getProperty = function(arg1) {
252
252
  var handle1 = this[symbolRscHandle];
253
- if (!handle1 || (handleTable2[(handle1 << 1) + 1] & T_FLAG) === 0) throw new TypeError('Resource error: Not a valid "DiffConfig" resource.');
254
- var handle0 = handleTable2[(handle1 << 1) + 1] & ~T_FLAG;
253
+ if (!handle1 || (handleTable1[(handle1 << 1) + 1] & T_FLAG) === 0) throw new TypeError('Resource error: Not a valid "DiffConfig" resource.');
254
+ var handle0 = handleTable1[(handle1 << 1) + 1] & ~T_FLAG;
255
255
  var ptr2 = utf8Encode(arg1, realloc0, memory0);
256
256
  var len2 = utf8EncodedLen;
257
257
  const ret = diffMethodDiffConfigGetProperty(handle0, ptr2, len2);
@@ -296,8 +296,8 @@ Object$1.parse = function(arg0, arg1) {
296
296
  var src0 = new Uint8Array(val0.buffer || val0, val0.byteOffset, +len0);
297
297
  new Uint8Array(memory0.buffer, ptr0, +len0).set(src0);
298
298
  var handle2 = arg1[symbolRscHandle];
299
- if (!handle2 || (handleTable2[(handle2 << 1) + 1] & T_FLAG) === 0) throw new TypeError('Resource error: Not a valid "DiffConfig" resource.');
300
- var handle1 = handleTable2[(handle2 << 1) + 1] & ~T_FLAG;
299
+ if (!handle2 || (handleTable1[(handle2 << 1) + 1] & T_FLAG) === 0) throw new TypeError('Resource error: Not a valid "DiffConfig" resource.');
300
+ var handle1 = handleTable1[(handle2 << 1) + 1] & ~T_FLAG;
301
301
  const ret = diffStaticObjectParse(ptr0, len0, handle1);
302
302
  let variant6;
303
303
  switch(dataView(memory0).getUint8(ret + 0, true)){
@@ -308,15 +308,15 @@ Object$1.parse = function(arg0, arg1) {
308
308
  writable: true,
309
309
  value: handle4
310
310
  });
311
- finalizationRegistry1.register(rsc3, handle4, rsc3);
311
+ finalizationRegistry2.register(rsc3, handle4, rsc3);
312
312
  Object.defineProperty(rsc3, symbolDispose, {
313
313
  writable: true,
314
314
  value: function() {
315
- finalizationRegistry1.unregister(rsc3);
316
- rscTableRemove(handleTable1, handle4);
315
+ finalizationRegistry2.unregister(rsc3);
316
+ rscTableRemove(handleTable2, handle4);
317
317
  rsc3[symbolDispose] = emptyFunc;
318
318
  rsc3[symbolRscHandle] = void 0;
319
- exports0['2'](handleTable1[(handle4 << 1) + 1] & ~T_FLAG);
319
+ exports0['3'](handleTable2[(handle4 << 1) + 1] & ~T_FLAG);
320
320
  }
321
321
  });
322
322
  variant6 = {
@@ -344,8 +344,8 @@ Object$1.parse = function(arg0, arg1) {
344
344
  let diffMethodObjectHash;
345
345
  Object$1.prototype.hash = function() {
346
346
  var handle1 = this[symbolRscHandle];
347
- if (!handle1 || (handleTable1[(handle1 << 1) + 1] & T_FLAG) === 0) throw new TypeError('Resource error: Not a valid "Object" resource.');
348
- var handle0 = handleTable1[(handle1 << 1) + 1] & ~T_FLAG;
347
+ if (!handle1 || (handleTable2[(handle1 << 1) + 1] & T_FLAG) === 0) throw new TypeError('Resource error: Not a valid "Object" resource.');
348
+ var handle0 = handleTable2[(handle1 << 1) + 1] & ~T_FLAG;
349
349
  const ret = diffMethodObjectHash(handle0);
350
350
  return BigInt.asUintN(64, ret);
351
351
  };
@@ -637,8 +637,8 @@ function runDiff(arg0, arg1, arg2, arg3) {
637
637
  } else {
638
638
  const e = variant2;
639
639
  var handle1 = e[symbolRscHandle];
640
- if (!handle1 || (handleTable1[(handle1 << 1) + 1] & T_FLAG) === 0) throw new TypeError('Resource error: Not a valid "Object" resource.');
641
- var handle0 = handleTable1[(handle1 << 1) + 1] & ~T_FLAG;
640
+ if (!handle1 || (handleTable2[(handle1 << 1) + 1] & T_FLAG) === 0) throw new TypeError('Resource error: Not a valid "Object" resource.');
641
+ var handle0 = handleTable2[(handle1 << 1) + 1] & ~T_FLAG;
642
642
  variant2_0 = 1;
643
643
  variant2_1 = handle0;
644
644
  }
@@ -651,14 +651,14 @@ function runDiff(arg0, arg1, arg2, arg3) {
651
651
  } else {
652
652
  const e = variant5;
653
653
  var handle4 = e[symbolRscHandle];
654
- if (!handle4 || (handleTable1[(handle4 << 1) + 1] & T_FLAG) === 0) throw new TypeError('Resource error: Not a valid "Object" resource.');
655
- var handle3 = handleTable1[(handle4 << 1) + 1] & ~T_FLAG;
654
+ if (!handle4 || (handleTable2[(handle4 << 1) + 1] & T_FLAG) === 0) throw new TypeError('Resource error: Not a valid "Object" resource.');
655
+ var handle3 = handleTable2[(handle4 << 1) + 1] & ~T_FLAG;
656
656
  variant5_0 = 1;
657
657
  variant5_1 = handle3;
658
658
  }
659
659
  var handle7 = arg2[symbolRscHandle];
660
- if (!handle7 || (handleTable2[(handle7 << 1) + 1] & T_FLAG) === 0) throw new TypeError('Resource error: Not a valid "DiffConfig" resource.');
661
- var handle6 = handleTable2[(handle7 << 1) + 1] & ~T_FLAG;
660
+ if (!handle7 || (handleTable1[(handle7 << 1) + 1] & T_FLAG) === 0) throw new TypeError('Resource error: Not a valid "DiffConfig" resource.');
661
+ var handle6 = handleTable1[(handle7 << 1) + 1] & ~T_FLAG;
662
662
  var { mappings: v8_0, selectingLeft: v8_1, selectingRight: v8_2 } = arg3;
663
663
  var vec12 = v8_0;
664
664
  var len12 = vec12.length;
@@ -733,7 +733,7 @@ function runDiff(arg0, arg1, arg2, arg3) {
733
733
  rscTableRemove(handleTable0, handle18);
734
734
  rsc17[symbolDispose] = emptyFunc;
735
735
  rsc17[symbolRscHandle] = void 0;
736
- exports0['3'](handleTable0[(handle18 << 1) + 1] & ~T_FLAG);
736
+ exports0['1'](handleTable0[(handle18 << 1) + 1] & ~T_FLAG);
737
737
  }
738
738
  });
739
739
  variant19 = rsc17;
@@ -761,7 +761,7 @@ function runDiff(arg0, arg1, arg2, arg3) {
761
761
  rscTableRemove(handleTable0, handle21);
762
762
  rsc20[symbolDispose] = emptyFunc;
763
763
  rsc20[symbolRscHandle] = void 0;
764
- exports0['3'](handleTable0[(handle21 << 1) + 1] & ~T_FLAG);
764
+ exports0['1'](handleTable0[(handle21 << 1) + 1] & ~T_FLAG);
765
765
  }
766
766
  });
767
767
  variant22 = rsc20;
@@ -1029,8 +1029,8 @@ function displayInstructionRow(arg0, arg1, arg2, arg3) {
1029
1029
  if (!handle1 || (handleTable0[(handle1 << 1) + 1] & T_FLAG) === 0) throw new TypeError('Resource error: Not a valid "ObjectDiff" resource.');
1030
1030
  var handle0 = handleTable0[(handle1 << 1) + 1] & ~T_FLAG;
1031
1031
  var handle3 = arg3[symbolRscHandle];
1032
- if (!handle3 || (handleTable2[(handle3 << 1) + 1] & T_FLAG) === 0) throw new TypeError('Resource error: Not a valid "DiffConfig" resource.');
1033
- var handle2 = handleTable2[(handle3 << 1) + 1] & ~T_FLAG;
1032
+ if (!handle3 || (handleTable1[(handle3 << 1) + 1] & T_FLAG) === 0) throw new TypeError('Resource error: Not a valid "DiffConfig" resource.');
1033
+ var handle2 = handleTable1[(handle3 << 1) + 1] & ~T_FLAG;
1034
1034
  const ret = displayDisplayInstructionRow(handle0, toUint32(arg1), toUint32(arg2), handle2);
1035
1035
  var len12 = dataView(memory0).getInt32(ret + 4, true);
1036
1036
  var base12 = dataView(memory0).getInt32(ret + 0, true);
@@ -1171,15 +1171,20 @@ function displayInstructionRow(arg0, arg1, arg2, arg3) {
1171
1171
  break;
1172
1172
  case 4:
1173
1173
  variant11 = {
1174
- tag: 'delete'
1174
+ tag: 'data-flow'
1175
1175
  };
1176
1176
  break;
1177
1177
  case 5:
1178
1178
  variant11 = {
1179
- tag: 'insert'
1179
+ tag: 'delete'
1180
1180
  };
1181
1181
  break;
1182
1182
  case 6:
1183
+ variant11 = {
1184
+ tag: 'insert'
1185
+ };
1186
+ break;
1187
+ case 7:
1183
1188
  variant11 = {
1184
1189
  tag: 'rotating',
1185
1190
  val: clampGuest(dataView(memory0).getUint8(base + 33, true), 0, 255)
@@ -1376,8 +1381,8 @@ function instructionContext(arg0, arg1, arg2, arg3) {
1376
1381
  if (!handle1 || (handleTable0[(handle1 << 1) + 1] & T_FLAG) === 0) throw new TypeError('Resource error: Not a valid "ObjectDiff" resource.');
1377
1382
  var handle0 = handleTable0[(handle1 << 1) + 1] & ~T_FLAG;
1378
1383
  var handle3 = arg3[symbolRscHandle];
1379
- if (!handle3 || (handleTable2[(handle3 << 1) + 1] & T_FLAG) === 0) throw new TypeError('Resource error: Not a valid "DiffConfig" resource.');
1380
- var handle2 = handleTable2[(handle3 << 1) + 1] & ~T_FLAG;
1384
+ if (!handle3 || (handleTable1[(handle3 << 1) + 1] & T_FLAG) === 0) throw new TypeError('Resource error: Not a valid "DiffConfig" resource.');
1385
+ var handle2 = handleTable1[(handle3 << 1) + 1] & ~T_FLAG;
1381
1386
  const ret = displayInstructionContext(handle0, toUint32(arg1), toUint32(arg2), handle2);
1382
1387
  var len10 = dataView(memory0).getInt32(ret + 4, true);
1383
1388
  var base10 = dataView(memory0).getInt32(ret + 0, true);
@@ -1460,8 +1465,8 @@ function instructionHover(arg0, arg1, arg2, arg3) {
1460
1465
  if (!handle1 || (handleTable0[(handle1 << 1) + 1] & T_FLAG) === 0) throw new TypeError('Resource error: Not a valid "ObjectDiff" resource.');
1461
1466
  var handle0 = handleTable0[(handle1 << 1) + 1] & ~T_FLAG;
1462
1467
  var handle3 = arg3[symbolRscHandle];
1463
- if (!handle3 || (handleTable2[(handle3 << 1) + 1] & T_FLAG) === 0) throw new TypeError('Resource error: Not a valid "DiffConfig" resource.');
1464
- var handle2 = handleTable2[(handle3 << 1) + 1] & ~T_FLAG;
1468
+ if (!handle3 || (handleTable1[(handle3 << 1) + 1] & T_FLAG) === 0) throw new TypeError('Resource error: Not a valid "DiffConfig" resource.');
1469
+ var handle2 = handleTable1[(handle3 << 1) + 1] & ~T_FLAG;
1465
1470
  const ret = displayInstructionHover(handle0, toUint32(arg1), toUint32(arg2), handle2);
1466
1471
  var len8 = dataView(memory0).getInt32(ret + 4, true);
1467
1472
  var base8 = dataView(memory0).getInt32(ret + 0, true);
@@ -1525,13 +1530,13 @@ function instructionHover(arg0, arg1, arg2, arg3) {
1525
1530
  const $init = (()=>{
1526
1531
  let gen = function*() {
1527
1532
  const module0 = fetchCompile(new URL('./objdiff.core.wasm', import.meta.url));
1528
- const module1 = base64Compile('AGFzbQEAAAABDQJgAX8AYAV/f39/fwADBQQBAAAABAUBcAEEBAccBQEwAAABMQABATIAAgEzAAMIJGltcG9ydHMBAAoxBBEAIAAgASACIAMgBEEAEQEACwkAIABBAREAAAsJACAAQQIRAAALCQAgAEEDEQAACwAvCXByb2R1Y2VycwEMcHJvY2Vzc2VkLWJ5AQ13aXQtY29tcG9uZW50BzAuMjI5LjA');
1529
- const module2 = base64Compile('AGFzbQEAAAABDQJgAX8AYAV/f39/fwACJAUAATAAAQABMQAAAAEyAAAAATMAAAAIJGltcG9ydHMBcAEEBAkKAQBBAAsEAAECAwAvCXByb2R1Y2VycwEMcHJvY2Vzc2VkLWJ5AQ13aXQtY29tcG9uZW50BzAuMjI5LjA');
1533
+ const module1 = base64Compile('AGFzbQEAAAABDQJgAX8AYAV/f39/fwADBQQBAAAABAUBcAEEBAccBQEwAAABMQABATIAAgEzAAMIJGltcG9ydHMBAAoxBBEAIAAgASACIAMgBEEAEQEACwkAIABBAREAAAsJACAAQQIRAAALCQAgAEEDEQAACwAvCXByb2R1Y2VycwEMcHJvY2Vzc2VkLWJ5AQ13aXQtY29tcG9uZW50BzAuMjM0LjA');
1534
+ const module2 = base64Compile('AGFzbQEAAAABDQJgAX8AYAV/f39/fwACJAUAATAAAQABMQAAAAEyAAAAATMAAAAIJGltcG9ydHMBcAEEBAkKAQBBAAsEAAECAwAvCXByb2R1Y2VycwEMcHJvY2Vzc2VkLWJ5AQ13aXQtY29tcG9uZW50BzAuMjM0LjA');
1530
1535
  ({ exports: exports0 } = yield instantiateCore((yield module1)));
1531
1536
  ({ exports: exports1 } = yield instantiateCore((yield module0), {
1532
1537
  '[export]objdiff:core/diff': {
1533
- '[resource-new]diff-config': trampoline2,
1534
- '[resource-new]object': trampoline1,
1538
+ '[resource-new]diff-config': trampoline1,
1539
+ '[resource-new]object': trampoline2,
1535
1540
  '[resource-new]object-diff': trampoline0
1536
1541
  },
1537
1542
  'wasi:logging/logging@0.1.0-draft': {
@@ -1543,9 +1548,9 @@ const $init = (()=>{
1543
1548
  '': {
1544
1549
  $imports: exports0.$imports,
1545
1550
  0: trampoline3,
1546
- 1: exports1['objdiff:core/diff#[dtor]diff-config'],
1547
- 2: exports1['objdiff:core/diff#[dtor]object'],
1548
- 3: exports1['objdiff:core/diff#[dtor]object-diff']
1551
+ 1: exports1['objdiff:core/diff#[dtor]object-diff'],
1552
+ 2: exports1['objdiff:core/diff#[dtor]diff-config'],
1553
+ 3: exports1['objdiff:core/diff#[dtor]object']
1549
1554
  }
1550
1555
  }));
1551
1556
  postReturn0 = exports1.cabi_post_version;
@@ -1556,7 +1561,7 @@ const $init = (()=>{
1556
1561
  postReturn4 = exports1['cabi_post_objdiff:core/display#display-sections'];
1557
1562
  postReturn5 = exports1['cabi_post_objdiff:core/display#display-symbol'];
1558
1563
  postReturn6 = exports1['cabi_post_objdiff:core/display#display-instruction-row'];
1559
- postReturn7 = exports1['cabi_post_objdiff:core/display#symbol-context'];
1564
+ postReturn7 = exports1['cabi_post_objdiff:core/display#instruction-context'];
1560
1565
  postReturn8 = exports1['cabi_post_objdiff:core/display#instruction-hover'];
1561
1566
  exports1Init = exports1.init;
1562
1567
  exports1Version = exports1.version;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "objdiff-wasm",
3
- "version": "3.0.0-beta.9",
3
+ "version": "3.0.0",
4
4
  "description": "A local diffing tool for decompilation projects.",
5
5
  "author": {
6
6
  "name": "Luke Street",