scientific-method-engine 0.9.0__tar.gz → 1.0.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 (58) hide show
  1. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/PKG-INFO +2 -1
  2. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/pyproject.toml +2 -2
  3. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/src/scientific_method_engine/__init__.py +1 -1
  4. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/src/scientific_method_engine/x86/image.py +17 -8
  5. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/src/scientific_method_engine/x86/trace.py +5 -2
  6. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/tests/test_pe.py +5 -4
  7. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/tests/test_table_continuations.py +49 -0
  8. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/tests/test_x86.py +22 -7
  9. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/.gitignore +0 -0
  10. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/LICENSE +0 -0
  11. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/README.md +0 -0
  12. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/src/scientific_method_engine/__main__.py +0 -0
  13. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/src/scientific_method_engine/cli.py +0 -0
  14. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/src/scientific_method_engine/ghidra/ClearNoReturnFunctions.java +0 -0
  15. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/src/scientific_method_engine/ghidra/CreateFunctions.java +0 -0
  16. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/src/scientific_method_engine/ghidra/ExportBoundedFlow.java +0 -0
  17. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/src/scientific_method_engine/ghidra/ExportCallEdges.java +0 -0
  18. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/src/scientific_method_engine/ghidra/ExportFunctionFingerprints.java +0 -0
  19. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/src/scientific_method_engine/ghidra/ExportFunctionInventory.java +0 -0
  20. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/src/scientific_method_engine/ghidra/MergeFallThroughFragment.java +0 -0
  21. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/src/scientific_method_engine/ghidra/RecoverCitedFunctions.java +0 -0
  22. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/src/scientific_method_engine/ghidra/RepairReturningCallers.java +0 -0
  23. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/src/scientific_method_engine/ghidra/ReportCallArguments.java +0 -0
  24. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/src/scientific_method_engine/ghidra/ReportCallPaths.java +0 -0
  25. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/src/scientific_method_engine/ghidra/ReportCallSitesWithScalars.java +0 -0
  26. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/src/scientific_method_engine/ghidra/ReportCallsToRange.java +0 -0
  27. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/src/scientific_method_engine/ghidra/ReportConstantFirstArgumentCalls.java +0 -0
  28. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/src/scientific_method_engine/ghidra/ReportDataBytes.java +0 -0
  29. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/src/scientific_method_engine/ghidra/ReportDecompileMatches.java +0 -0
  30. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/src/scientific_method_engine/ghidra/ReportDecompileWindow.java +0 -0
  31. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/src/scientific_method_engine/ghidra/ReportFilePatternInMemory.java +0 -0
  32. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/src/scientific_method_engine/ghidra/ReportFirstArgumentCallSummary.java +0 -0
  33. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/src/scientific_method_engine/ghidra/ReportFunctionScalarConstants.java +0 -0
  34. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/src/scientific_method_engine/ghidra/ReportFunctionSummary.java +0 -0
  35. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/src/scientific_method_engine/ghidra/ReportInstructionContext.java +0 -0
  36. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/src/scientific_method_engine/ghidra/ReportInstructionWindow.java +0 -0
  37. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/src/scientific_method_engine/ghidra/ReportMemoryBlockForFileOffset.java +0 -0
  38. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/src/scientific_method_engine/ghidra/ReportMemoryBlocks.java +0 -0
  39. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/src/scientific_method_engine/ghidra/ReportRandomnessCandidates.java +0 -0
  40. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/src/scientific_method_engine/ghidra/ReportReferences.java +0 -0
  41. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/src/scientific_method_engine/ghidra/ReportScalarConstants.java +0 -0
  42. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/src/scientific_method_engine/ghidra/ReportStringReferences.java +0 -0
  43. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/src/scientific_method_engine/ghidra/ReportSymbolReferences.java +0 -0
  44. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/src/scientific_method_engine/x86/__init__.py +0 -0
  45. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/src/scientific_method_engine/x86/dispatch.py +0 -0
  46. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/src/scientific_method_engine/x86/effect_order.py +0 -0
  47. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/src/scientific_method_engine/x86/machine.py +0 -0
  48. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/src/scientific_method_engine/x86/pcode.py +0 -0
  49. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/src/scientific_method_engine/x86/pcode_backend.py +0 -0
  50. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/src/scientific_method_engine/x86/pe.py +0 -0
  51. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/src/scientific_method_engine/x86/reports.py +0 -0
  52. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/src/scientific_method_engine/x86/result_flow.py +0 -0
  53. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/src/scientific_method_engine/x86/values.py +0 -0
  54. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/tests/oracle.py +0 -0
  55. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/tests/test_dispatch.py +0 -0
  56. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/tests/test_effect_order.py +0 -0
  57. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/tests/test_nested_frame_request.py +0 -0
  58. {scientific_method_engine-0.9.0 → scientific_method_engine-1.0.0}/tests/test_oracle.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: scientific-method-engine
3
- Version: 0.9.0
3
+ Version: 1.0.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
@@ -9,6 +9,7 @@ License-File: LICENSE
9
9
  Requires-Python: >=3.12
10
10
  Requires-Dist: capstone==5.0.7
11
11
  Requires-Dist: pypcode==4.0.0
12
+ Requires-Dist: xxhash==4.0.1
12
13
  Provides-Extra: test
13
14
  Requires-Dist: unicorn==2.1.4; extra == 'test'
14
15
  Description-Content-Type: text/markdown
@@ -5,13 +5,13 @@ 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 = "0.9.0"
8
+ version = "1.0.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"
12
12
  license = "MIT"
13
13
  authors = [{ name = "kibertoad" }]
14
- dependencies = ["capstone==5.0.7", "pypcode==4.0.0"]
14
+ dependencies = ["capstone==5.0.7", "pypcode==4.0.0", "xxhash==4.0.1"]
15
15
 
16
16
  [project.optional-dependencies]
17
17
  # Unicorn is the tests' concrete oracle (ADR 0003, decision 4). Its core is GPLv2, so it never
@@ -2,4 +2,4 @@
2
2
 
3
3
  # The reader passes this number with every prepared config it pipes to the engine. A reader and
4
4
  # engine that disagree on it refuse to run instead of exchanging relocation data in another shape.
5
- PREPARED_PROTOCOL = 1
5
+ PREPARED_PROTOCOL = 2
@@ -1,11 +1,13 @@
1
1
  """Bounded explicit code mappings. No guessed linear disassembly domains."""
2
- import hashlib
2
+ import re
3
3
  from pathlib import Path
4
+ import xxhash
4
5
  from capstone import Cs, CS_ARCH_X86, CS_MODE_16, CS_MODE_32
5
6
  from .pe import prepare_pe
6
7
  import capstone
7
8
 
8
9
  MAX_SOURCE = 256 * 1024 * 1024
10
+ XXH3_FORM = re.compile("[0-9a-f]{32}")
9
11
 
10
12
 
11
13
  def integer(value, low, high, label):
@@ -17,21 +19,28 @@ def integer(value, low, high, label):
17
19
  def read_source(config, base):
18
20
  """Read the source a report config names and check its hash.
19
21
 
20
- ``config["source"]`` is a path relative to ``base``; the file must be at most 256 MiB and hash to
21
- ``config["sha256"]``. Returns ``(data, identity)`` where ``identity`` is
22
- ``{"size": ..., "sha256": ...}``. Raises ``ValueError`` otherwise.
22
+ ``config["source"]`` is a path relative to ``base``; the file must be at most 256 MiB and its
23
+ XXH3-128 hash must equal ``config["xxh3"]``, given as 32 lower-case hex digits. A config that
24
+ still names a ``sha256`` is refused, so a hash from before prepared-config protocol 2 is never
25
+ taken as checked. Returns ``(data, identity)`` where ``identity`` is
26
+ ``{"size": ..., "xxh3": ...}``. Raises ``ValueError`` otherwise.
23
27
  """
24
28
  path = config.get("source")
25
29
  if not isinstance(path, str) or not path:
26
30
  raise ValueError("source path required")
31
+ if "sha256" in config:
32
+ raise ValueError("sha256 is no longer read; name the source by its xxh3 (prepared-config protocol 2)")
33
+ expected = config.get("xxh3")
34
+ if not isinstance(expected, str) or not XXH3_FORM.fullmatch(expected):
35
+ raise ValueError("xxh3 must be the source's XXH3-128 hash as 32 lower-case hex digits")
27
36
  path = Path(base) / path
28
37
  if not path.is_file() or path.stat().st_size > MAX_SOURCE:
29
38
  raise ValueError("source must be a regular file of at most 256 MiB")
30
39
  data = path.read_bytes()
31
- digest = hashlib.sha256(data).hexdigest()
32
- if digest != config.get("sha256"):
33
- raise ValueError("Source SHA-256 differs from the supplied baseline")
34
- return data, {"size": len(data), "sha256": digest}
40
+ digest = xxhash.xxh3_128_hexdigest(data)
41
+ if digest != expected:
42
+ raise ValueError("Source xxh3 differs from the supplied baseline")
43
+ return data, {"size": len(data), "xxh3": digest}
35
44
 
36
45
 
37
46
  class Image:
@@ -305,8 +305,11 @@ def trace(image, config, continue_declared_jumps=True):
305
305
  if boundary_budget < 1:
306
306
  global_gaps.append({"site": s.at, "reason": "conditional table boundary instruction limit"})
307
307
  return
308
- seen, walk_gaps, _, undecoded, contested = walk(image, [root_entry], boundary_budget)
309
- boundary_budget -= max(1, len(seen) + len(undecoded) + len(contested))
308
+ seen, walk_gaps, _, _, contested = walk(image, [root_entry], boundary_budget)
309
+ # walk drops rejected overlapping starts and contested instructions from seen,
310
+ # but it decoded them, so they are charged with the established ones.
311
+ overlapping = sum(g["reason"] == OVERLAP_REASON for g in walk_gaps)
312
+ boundary_budget -= max(1, len(seen) + len(contested) + overlapping)
310
313
  # A truncated walk never saw the instructions that could contest a target start.
311
314
  if any(g["reason"] == "instruction limit" for g in walk_gaps):
312
315
  seen = {}
@@ -1,5 +1,4 @@
1
1
  """PE32 acceptance uses constructed headers and instructions only."""
2
- import hashlib
3
2
  import json
4
3
  import os
5
4
  from pathlib import Path
@@ -9,6 +8,8 @@ import sys
9
8
  import tempfile
10
9
  import unittest
11
10
 
11
+ import xxhash
12
+
12
13
  SRC = Path(__file__).resolve().parents[1] / "src"
13
14
  sys.path.insert(0, str(SRC))
14
15
  # The engine CLI runs from this checkout's source whether or not the package is installed.
@@ -152,7 +153,7 @@ class PEReporterTests(unittest.TestCase):
152
153
  with tempfile.TemporaryDirectory() as directory:
153
154
  path = Path(directory)
154
155
  (path / 'source.bin').write_bytes(data)
155
- config.update(source='source.bin', sha256=hashlib.sha256(data).hexdigest(), regions=[1])
156
+ config.update(source='source.bin', xxh3=xxhash.xxh3_128_hexdigest(data), regions=[1])
156
157
  (path / 'config.json').write_text(json.dumps(config))
157
158
  process = subprocess.run([*ENGINE, 'trace', str(path / 'config.json')],
158
159
  capture_output=True, text=True, env=ENGINE_ENV)
@@ -324,13 +325,13 @@ class PEReporterTests(unittest.TestCase):
324
325
  with tempfile.TemporaryDirectory() as directory:
325
326
  path = Path(directory)
326
327
  (path / 'source.bin').write_bytes(data)
327
- config.update(source='source.bin', sha256=hashlib.sha256(data).hexdigest())
328
+ config.update(source='source.bin', xxh3=xxhash.xxh3_128_hexdigest(data))
328
329
  environment = {**ENGINE_ENV, 'EVIDENCE_PYTHON': sys.executable}
329
330
  (path / 'config.json').write_text(json.dumps(config))
330
331
  process = subprocess.run(['node', str(READER), 'trace', str(path / 'config.json')], capture_output=True, text=True, env=environment)
331
332
  self.assertEqual(process.returncode, 0, process.stderr)
332
333
  r = json.loads(process.stdout)
333
- self.assertEqual(r['sourceIdentity']['sha256'], config['sha256'])
334
+ self.assertEqual(r['sourceIdentity']['xxh3'], config['xxh3'])
334
335
  self.assertEqual(r['sourceMapping']['format'], 'PE32/i386')
335
336
  config['regions'][0]['ip'] = CODE_VA + 1
336
337
  (path / 'config.json').write_text(json.dumps(config))
@@ -141,6 +141,55 @@ class TableContinuationTests(unittest.TestCase):
141
141
  self.assertFalse(r["declaredContinuationPaths"])
142
142
  self.assertTrue(any("boundary" in g["reason"] for g in r["gaps"]))
143
143
 
144
+ def test_boundary_budget_counts_only_decoded_instructions(self):
145
+ # Two functions each end in a declared table jump and branch once outside every region.
146
+ # Their boundary walks decode four instructions apiece and leave most region bytes uncovered.
147
+ data = bytearray([0x90] * 56)
148
+ data[0:6] = bytes.fromhex("72 06 e8 0b 00 c3")
149
+ data[8:12] = bytes.fromhex("e8 15 00 c3")
150
+ data[16:20] = bytes.fromhex("74 7f ff e3")
151
+ data[22:24] = bytes.fromhex("c3 c3")
152
+ data[32:36] = bytes.fromhex("74 7f ff e3")
153
+ data[38:40] = bytes.fromhex("c3 c3")
154
+ data[48:56] = bytes.fromhex("16 00 17 00 26 00 27 00")
155
+ jumps = [{"site": site, "exhaustive": True, "evidence": "constructed BX consumer",
156
+ "table": {"start": table, "count": 2, "stride": 2, "evidence": "constructed words"}}
157
+ for site, table in ((18, 48), (34, 52))]
158
+ config = {"entry": 0, "indirectJumps": jumps,
159
+ "regions": [{"name": "code", "start": 0, "end": 48, "segment": 4096, "ip": 0,
160
+ "entries": [0], "evidence": "constructed mappings"}]}
161
+ r = run_report(bytes(data), {**config, "instructionLimit": 8}, "trace")
162
+ self.assertEqual(len(r["declaredContinuationPaths"]), 4)
163
+ self.assertFalse(any("boundary" in g["reason"] for g in r["gaps"]))
164
+ r = run_report(bytes(data), {**config, "instructionLimit": 7}, "trace")
165
+ self.assertEqual(len(r["declaredContinuationPaths"]), 2)
166
+ self.assertTrue(any("boundary" in g["reason"] for g in r["gaps"]))
167
+
168
+ def test_boundary_budget_charges_rejected_overlapping_instructions(self):
169
+ # The function at 32 is walked first. Its side branch calls into its own call
170
+ # (40 e8 ff ff -> 42 inc bx) and returns to 43, so 40, 42 and 43 overlap and 44
171
+ # is reached only through them. The walk decodes eight instructions and establishes four.
172
+ data = bytearray([0x90] * 56)
173
+ data[0:6] = bytes.fromhex("72 06 e8 0b 00 c3")
174
+ data[8:12] = bytes.fromhex("e8 15 00 c3")
175
+ data[16:20] = bytes.fromhex("74 7f ff e3")
176
+ data[22:24] = bytes.fromhex("c3 c3")
177
+ data[32:36] = bytes.fromhex("74 06 ff e3")
178
+ data[38:40] = bytes.fromhex("c3 c3")
179
+ data[40:45] = bytes.fromhex("e8 ff ff c3 c3")
180
+ data[48:56] = bytes.fromhex("16 00 17 00 26 00 27 00")
181
+ jumps = [{"site": site, "exhaustive": True, "evidence": "constructed BX consumer",
182
+ "table": {"start": table, "count": 2, "stride": 2, "evidence": "constructed words"}}
183
+ for site, table in ((18, 48), (34, 52))]
184
+ config = {"entry": 0, "indirectJumps": jumps,
185
+ "regions": [{"name": "code", "start": 0, "end": 48, "segment": 4096, "ip": 0,
186
+ "entries": [0], "evidence": "constructed mappings"}]}
187
+ r = run_report(bytes(data), {**config, "instructionLimit": 12}, "trace")
188
+ self.assertEqual(len(r["declaredContinuationPaths"]), 4)
189
+ r = run_report(bytes(data), {**config, "instructionLimit": 11}, "trace")
190
+ self.assertEqual(len(r["declaredContinuationPaths"]), 2)
191
+ self.assertTrue(any("boundary" in g["reason"] for g in r["gaps"]))
192
+
144
193
  def test_field_address_uses_the_table_region_mapping(self):
145
194
  data, config = fixture()
146
195
  data = bytearray(data)
@@ -8,6 +8,8 @@ import sys
8
8
  import tempfile
9
9
  import unittest
10
10
 
11
+ import xxhash
12
+
11
13
  SRC = Path(__file__).resolve().parents[1] / "src"
12
14
  sys.path.insert(0, str(SRC))
13
15
  # The engine CLI runs from this checkout's source whether or not the package is installed.
@@ -1525,20 +1527,33 @@ class ReporterTests(unittest.TestCase):
1525
1527
  with tempfile.TemporaryDirectory() as folder:
1526
1528
  root = Path(folder); data = bytes.fromhex("b8 01 00 c3")
1527
1529
  (root/"fixture.bin").write_bytes(data)
1528
- cfg = configuration(data, source="fixture.bin", sha256=hashlib.sha256(data).hexdigest())
1530
+ cfg = configuration(data, source="fixture.bin", xxh3=xxhash.xxh3_128_hexdigest(data))
1529
1531
  path = root/"config.json"; path.write_text(json.dumps(cfg))
1530
1532
  args = [*ENGINE, "trace", str(path)]
1531
1533
  result = subprocess.run(args, capture_output=True, text=True, env=ENGINE_ENV)
1532
1534
  self.assertEqual(result.returncode, 0, result.stderr)
1533
1535
  header = json.loads(result.stdout)
1534
- self.assertEqual(header["sourceIdentity"]["size"], 4)
1536
+ self.assertEqual(header["sourceIdentity"], {"size": 4, "xxh3": cfg["xxh3"]})
1535
1537
  self.assertEqual((header["decoder"], header["instructionSemantics"]),
1536
1538
  ("capstone " + capstone.__version__, f"pypcode {pypcode.__version__} (Ghidra SLEIGH x86)"))
1537
- cfg["sha256"] = "0" * 64; path.write_text(json.dumps(cfg))
1539
+ cfg["xxh3"] = "0" * 32; path.write_text(json.dumps(cfg))
1538
1540
  result = subprocess.run(args, capture_output=True, text=True, env=ENGINE_ENV)
1539
1541
  self.assertEqual(result.returncode, 1)
1540
1542
  self.assertIn("baseline", result.stderr)
1541
- cfg["sha256"] = hashlib.sha256(data).hexdigest(); cfg["overlayExports"] = []
1543
+ # A SHA-256, an upper-case or a missing hash is not the standard's form.
1544
+ for value in ("0" * 64, xxhash.xxh3_128_hexdigest(data).upper(), None):
1545
+ with self.subTest(xxh3=value):
1546
+ path.write_text(json.dumps({**cfg, "xxh3": value}))
1547
+ result = subprocess.run(args, capture_output=True, text=True, env=ENGINE_ENV)
1548
+ self.assertEqual(result.returncode, 1)
1549
+ self.assertIn("32 lower-case hex digits", result.stderr)
1550
+ # A protocol 1 hash is refused beside a correct xxh3, so it is never taken as checked.
1551
+ path.write_text(json.dumps({**cfg, "xxh3": xxhash.xxh3_128_hexdigest(data),
1552
+ "sha256": hashlib.sha256(data).hexdigest()}))
1553
+ result = subprocess.run(args, capture_output=True, text=True, env=ENGINE_ENV)
1554
+ self.assertEqual(result.returncode, 1)
1555
+ self.assertIn("sha256 is no longer read", result.stderr)
1556
+ cfg["xxh3"] = xxhash.xxh3_128_hexdigest(data); cfg["overlayExports"] = []
1542
1557
  path.write_text(json.dumps(cfg))
1543
1558
  result = subprocess.run(args, capture_output=True, text=True, env=ENGINE_ENV)
1544
1559
  self.assertEqual(result.returncode, 1)
@@ -1548,15 +1563,15 @@ class ReporterTests(unittest.TestCase):
1548
1563
  with tempfile.TemporaryDirectory() as folder:
1549
1564
  root = Path(folder); data = bytes.fromhex("b8 01 00 c3")
1550
1565
  (root/"fixture.bin").write_bytes(data)
1551
- cfg = configuration(data, source=str(root/"fixture.bin"), sha256=hashlib.sha256(data).hexdigest())
1566
+ cfg = configuration(data, source=str(root/"fixture.bin"), xxh3=xxhash.xxh3_128_hexdigest(data))
1552
1567
  stdin = [*ENGINE, "trace", "-"]
1553
- for protocol, accepted in ((None, False), (0, False), (1, True)):
1568
+ for protocol, accepted in ((None, False), (1, False), (2, True)):
1554
1569
  prepared = dict(cfg) if protocol is None else {**cfg, "preparedProtocol": protocol}
1555
1570
  result = subprocess.run(stdin, input=json.dumps(prepared), capture_output=True, text=True, env=ENGINE_ENV)
1556
1571
  self.assertEqual(result.returncode, 0 if accepted else 1, result.stderr)
1557
1572
  if not accepted:
1558
1573
  self.assertIn("protocol", result.stderr)
1559
- path = root/"config.json"; path.write_text(json.dumps({**cfg, "preparedProtocol": 1}))
1574
+ path = root/"config.json"; path.write_text(json.dumps({**cfg, "preparedProtocol": 2}))
1560
1575
  result = subprocess.run([*ENGINE, "trace", str(path)], capture_output=True, text=True, env=ENGINE_ENV)
1561
1576
  self.assertEqual(result.returncode, 1)
1562
1577
  self.assertIn("set by the reader", result.stderr)