scientific-method-engine 7.3.0__tar.gz → 7.4.0__tar.gz

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.
Files changed (69) hide show
  1. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/PKG-INFO +1 -1
  2. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/pyproject.toml +1 -1
  3. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/src/scientific_method_engine/cli.py +3 -2
  4. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/src/scientific_method_engine/x86/reports.py +4 -3
  5. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/tests/test_x86.py +14 -0
  6. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/.gitignore +0 -0
  7. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/LICENSE +0 -0
  8. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/README.md +0 -0
  9. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/src/scientific_method_engine/__init__.py +0 -0
  10. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/src/scientific_method_engine/__main__.py +0 -0
  11. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/src/scientific_method_engine/ghidra/ClearNoReturnFunctions.java +0 -0
  12. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/src/scientific_method_engine/ghidra/CreateFunctions.java +0 -0
  13. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/src/scientific_method_engine/ghidra/ExportBoundedFlow.java +0 -0
  14. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/src/scientific_method_engine/ghidra/ExportCallEdges.java +0 -0
  15. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/src/scientific_method_engine/ghidra/ExportFunctionFingerprints.java +0 -0
  16. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/src/scientific_method_engine/ghidra/ExportFunctionInventory.java +0 -0
  17. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/src/scientific_method_engine/ghidra/MergeFallThroughFragment.java +0 -0
  18. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/src/scientific_method_engine/ghidra/RecoverCitedFunctions.java +0 -0
  19. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/src/scientific_method_engine/ghidra/RepairReturningCallers.java +0 -0
  20. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/src/scientific_method_engine/ghidra/ReportCallArguments.java +0 -0
  21. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/src/scientific_method_engine/ghidra/ReportCallPaths.java +0 -0
  22. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/src/scientific_method_engine/ghidra/ReportCallSitesWithScalars.java +0 -0
  23. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/src/scientific_method_engine/ghidra/ReportCallsToRange.java +0 -0
  24. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/src/scientific_method_engine/ghidra/ReportConstantFirstArgumentCalls.java +0 -0
  25. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/src/scientific_method_engine/ghidra/ReportDataBytes.java +0 -0
  26. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/src/scientific_method_engine/ghidra/ReportDecompileMatches.java +0 -0
  27. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/src/scientific_method_engine/ghidra/ReportDecompileWindow.java +0 -0
  28. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/src/scientific_method_engine/ghidra/ReportFilePatternInMemory.java +0 -0
  29. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/src/scientific_method_engine/ghidra/ReportFirstArgumentCallSummary.java +0 -0
  30. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/src/scientific_method_engine/ghidra/ReportFunctionScalarConstants.java +0 -0
  31. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/src/scientific_method_engine/ghidra/ReportFunctionSummary.java +0 -0
  32. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/src/scientific_method_engine/ghidra/ReportInstructionContext.java +0 -0
  33. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/src/scientific_method_engine/ghidra/ReportInstructionWindow.java +0 -0
  34. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/src/scientific_method_engine/ghidra/ReportMemoryBlockForFileOffset.java +0 -0
  35. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/src/scientific_method_engine/ghidra/ReportMemoryBlocks.java +0 -0
  36. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/src/scientific_method_engine/ghidra/ReportRandomnessCandidates.java +0 -0
  37. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/src/scientific_method_engine/ghidra/ReportReferences.java +0 -0
  38. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/src/scientific_method_engine/ghidra/ReportScalarConstants.java +0 -0
  39. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/src/scientific_method_engine/ghidra/ReportStringReferences.java +0 -0
  40. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/src/scientific_method_engine/ghidra/ReportSymbolReferences.java +0 -0
  41. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/src/scientific_method_engine/ghidra/scientificmethod/FirstArgumentLookBack.java +0 -0
  42. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/src/scientific_method_engine/x86/__init__.py +0 -0
  43. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/src/scientific_method_engine/x86/argument_frames.py +0 -0
  44. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/src/scientific_method_engine/x86/dispatch.py +0 -0
  45. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/src/scientific_method_engine/x86/effect_order.py +0 -0
  46. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/src/scientific_method_engine/x86/image.py +0 -0
  47. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/src/scientific_method_engine/x86/loops.py +0 -0
  48. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/src/scientific_method_engine/x86/machine.py +0 -0
  49. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/src/scientific_method_engine/x86/memory_scopes.py +0 -0
  50. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/src/scientific_method_engine/x86/pcode.py +0 -0
  51. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/src/scientific_method_engine/x86/pcode_backend.py +0 -0
  52. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/src/scientific_method_engine/x86/pe.py +0 -0
  53. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/src/scientific_method_engine/x86/relational.py +0 -0
  54. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/src/scientific_method_engine/x86/result_flow.py +0 -0
  55. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/src/scientific_method_engine/x86/trace.py +0 -0
  56. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/src/scientific_method_engine/x86/values.py +0 -0
  57. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/tests/oracle.py +0 -0
  58. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/tests/test_continuation_budget.py +0 -0
  59. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/tests/test_dispatch.py +0 -0
  60. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/tests/test_effect_order.py +0 -0
  61. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/tests/test_entry_frame.py +0 -0
  62. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/tests/test_loops.py +0 -0
  63. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/tests/test_memory_scopes.py +0 -0
  64. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/tests/test_nested_frame_request.py +0 -0
  65. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/tests/test_oracle.py +0 -0
  66. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/tests/test_pe.py +0 -0
  67. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/tests/test_relational_controls.py +0 -0
  68. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/tests/test_successor_rule.py +0 -0
  69. {scientific_method_engine-7.3.0 → scientific_method_engine-7.4.0}/tests/test_table_continuations.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: scientific-method-engine
3
- Version: 7.3.0
3
+ Version: 7.4.0
4
4
  Summary: Bounded instruction-derived x86 evidence reports for segmented MZ/FBOV and PE32/i386 code.
5
5
  Project-URL: Source, https://github.com/kibertoad/refurbished-dinosaurs-toolkit/tree/main/packages/scientific-method-engine
6
6
  Author: kibertoad
@@ -5,7 +5,7 @@ build-backend = "hatchling.build"
5
5
  [project]
6
6
  name = "scientific-method-engine"
7
7
  # The release workflow writes the published version from the package's release tag.
8
- version = "7.3.0"
8
+ version = "7.4.0"
9
9
  description = "Bounded instruction-derived x86 evidence reports for segmented MZ/FBOV and PE32/i386 code."
10
10
  readme = "README.md"
11
11
  requires-python = ">=3.12"
@@ -17,8 +17,9 @@ USAGE = ("Usage: scientific-method-engine <operand|operand-candidates|target|bou
17
17
  "effects|returns|memory|incoming|call-order|guards|allocation|dispatch> <config.json|->\n"
18
18
  "effects includes ordered path writes/calls and local restoration witnesses; transactionality remains unestablished.\n"
19
19
  "callees compares its edges with an ExportCallEdges.java export given as ghidraCallEdges;\n"
20
- "agreed is false where Ghidra ends the function at a call, conditional jump or interrupt the engine reads past (ghidraEndsFunction),\n"
21
- "continues past a jmp, ljmp, return or hlt the engine stops at (ghidraContinues),\n"
20
+ "each row it compares fall-through at carries the engine's side as engineReadsOn;\n"
21
+ "agreed is false where Ghidra ends the function at an instruction the engine reads past (ghidraEndsFunction),\n"
22
+ "continues past one the engine stops at (ghidraContinues),\n"
22
23
  "or continues at another address than the next instruction (ghidraFallsThroughElsewhere).\n"
23
24
  "trace, arguments, effects, returns, guards, memory and allocation check relationalControls:\n"
24
25
  "a violated control fails the report; an undecided one is reported and never counts as held.\n"
@@ -1302,7 +1302,7 @@ def _ghidra_cross_check(image, export, nodes, outgoing, omitted):
1302
1302
  reads_on = flow.get(g["site"], {}).get("readsOn")
1303
1303
  if reads_on is None:
1304
1304
  return row
1305
- row |= _ghidra_falls_through(g)
1305
+ row |= _ghidra_falls_through(g) | {"engineReadsOn": reads_on}
1306
1306
  if row["ghidraFallsThroughTo"] is not None:
1307
1307
  # Ghidra neither ends the function here nor reads on to the next instruction, whatever the engine does.
1308
1308
  elsewhere.append(row)
@@ -1367,8 +1367,9 @@ def _ghidra_cross_check(image, export, nodes, outgoing, omitted):
1367
1367
  "to the next instruction there (ghidraFallsThrough), read from the export's fallsThrough or, in an export "
1368
1368
  "without it, from the flow name (ghidraFallsThroughBasis), and where a fall-through override sends Ghidra to "
1369
1369
  "another address (ghidraFallsThroughTo), read from the export's fallsThroughTo, or null with "
1370
- "ghidraFallsThroughToBasis notExported for an export without it. The engine reads on past every call, conditional jump "
1371
- "and interrupt and stops at a jmp, ljmp, return or hlt. A row where Ghidra ends the function at an instruction "
1370
+ "ghidraFallsThroughToBasis notExported for an export without it. The engine's side is engineReadsOn, whether its "
1371
+ "body reading queued the next instruction as the fall-through at the site; a transfer outside the frame "
1372
+ "model carries no fall-through comparison. A row where Ghidra ends the function at an instruction "
1372
1373
  "the engine reads past (ghidraEndsFunction), continues past one the engine stops at (ghidraContinues) "
1373
1374
  "or continues at another address (ghidraFallsThroughElsewhere) counts against agreed. A ghidraOnly edge "
1374
1375
  "is Ghidra's claim: the engine did not check it and never adds it to its graph. Agreement means both "
@@ -1217,6 +1217,8 @@ class GhidraCrossCheckTests(unittest.TestCase):
1217
1217
  check = run_report(data, cfg | {"ghidraCallEdges": export}, "callees")["ghidraCrossCheck"]
1218
1218
  [row] = [r for r in check["edges"] if r["site"] == site and r["result"] != "engineOnly"]
1219
1219
  self.assertEqual(row.get("ghidraFallsThrough"), None if reads_on is None else falls_through)
1220
+ # The row carries the engine's side as body() recorded it, and none where body() decided nothing.
1221
+ self.assertEqual((row.get("engineReadsOn"), "engineReadsOn" in row), (reads_on, reads_on is not None))
1220
1222
  # A redirect disagrees wherever the engine decided, and counts as neither of the other two.
1221
1223
  redirected = reads_on is not None and elsewhere is not None
1222
1224
  self.assertEqual((check["counts"]["ghidraEndsFunction"], check["counts"]["ghidraContinues"],
@@ -1226,6 +1228,18 @@ class GhidraCrossCheckTests(unittest.TestCase):
1226
1228
  self.assertEqual(kinds, set(RETURNS.values()) | {"halt", "tail transfer", "unresolved jump"})
1227
1229
  self.assertEqual(decisions, {True, False, None})
1228
1230
 
1231
+ def test_the_cross_check_interpretation_points_at_the_body_record(self):
1232
+ # The interpretation names the record body() keeps and every extent count, without a copy of the stopping rule
1233
+ # that would have to track body(). body() also queues the next instruction as the target of a jmp $+2 and records
1234
+ # readsOn false there, so the text names the fall-through.
1235
+ data = bytes.fromhex("90 c3")
1236
+ export = ghidra_export(data, {0: [(0, None, "COMPUTED_CALL", True, None)]})
1237
+ text = run_report(data, configuration(data) | {"ghidraCallEdges": export}, "callees")["ghidraCrossCheck"]["interpretation"]
1238
+ self.assertIn("engineReadsOn, whether its body reading queued the next instruction as the fall-through at the site", text)
1239
+ for count in ("ghidraEndsFunction", "ghidraContinues", "ghidraFallsThroughElsewhere"):
1240
+ self.assertIn(count, text)
1241
+ self.assertNotRegex(text, r"(?i)\b(l?jmp|hlt)\b|port access|conditional jump and interrupt")
1242
+
1229
1243
  def test_a_ghidra_target_at_an_interrupt_or_a_targetless_call_elsewhere_stays_ghidra_only(self):
1230
1244
  # int 21h; int 10h; nop; call 8; ret. Ghidra resolves the first interrupt to a file offset and the second to an
1231
1245
  # address without file bytes, and claims a call at the nop.