scientific-method-engine 16.0.0__tar.gz → 17.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.
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/PKG-INFO +11 -1
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/README.md +10 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/pyproject.toml +1 -1
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/src/scientific_method_engine/cli.py +4 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/src/scientific_method_engine/x86/machine.py +96 -10
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/src/scientific_method_engine/x86/memory_scopes.py +11 -5
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/src/scientific_method_engine/x86/reports.py +91 -14
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/src/scientific_method_engine/x86/trace.py +4 -2
- scientific_method_engine-17.0.0/tests/test_volatile_memory.py +194 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/tests/test_x86.py +105 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/.gitignore +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/LICENSE +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/src/scientific_method_engine/__init__.py +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/src/scientific_method_engine/__main__.py +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/src/scientific_method_engine/ghidra/ClearNoReturnFunctions.java +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/src/scientific_method_engine/ghidra/CreateFunctions.java +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/src/scientific_method_engine/ghidra/ExportBoundedFlow.java +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/src/scientific_method_engine/ghidra/ExportCallEdges.java +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/src/scientific_method_engine/ghidra/ExportFunctionFingerprints.java +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/src/scientific_method_engine/ghidra/ExportFunctionInventory.java +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/src/scientific_method_engine/ghidra/MergeFallThroughFragment.java +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/src/scientific_method_engine/ghidra/RecoverCitedFunctions.java +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/src/scientific_method_engine/ghidra/RepairReturningCallers.java +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/src/scientific_method_engine/ghidra/ReportCallArguments.java +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/src/scientific_method_engine/ghidra/ReportCallPaths.java +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/src/scientific_method_engine/ghidra/ReportCallSitesWithScalars.java +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/src/scientific_method_engine/ghidra/ReportCallsToRange.java +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/src/scientific_method_engine/ghidra/ReportConstantFirstArgumentCalls.java +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/src/scientific_method_engine/ghidra/ReportDataBytes.java +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/src/scientific_method_engine/ghidra/ReportDecompileMatches.java +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/src/scientific_method_engine/ghidra/ReportDecompileWindow.java +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/src/scientific_method_engine/ghidra/ReportFilePatternInMemory.java +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/src/scientific_method_engine/ghidra/ReportFirstArgumentCallSummary.java +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/src/scientific_method_engine/ghidra/ReportFunctionScalarConstants.java +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/src/scientific_method_engine/ghidra/ReportFunctionSummary.java +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/src/scientific_method_engine/ghidra/ReportInstructionContext.java +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/src/scientific_method_engine/ghidra/ReportInstructionWindow.java +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/src/scientific_method_engine/ghidra/ReportMemoryBlockForFileOffset.java +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/src/scientific_method_engine/ghidra/ReportMemoryBlocks.java +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/src/scientific_method_engine/ghidra/ReportRandomnessCandidates.java +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/src/scientific_method_engine/ghidra/ReportRangeBoundaries.java +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/src/scientific_method_engine/ghidra/ReportReferences.java +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/src/scientific_method_engine/ghidra/ReportScalarConstants.java +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/src/scientific_method_engine/ghidra/ReportStringReferences.java +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/src/scientific_method_engine/ghidra/ReportSymbolReferences.java +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/src/scientific_method_engine/ghidra/scientificmethod/FirstArgumentLookBack.java +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/src/scientific_method_engine/ghidra/scientificmethod/InstructionStart.java +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/src/scientific_method_engine/ghidra/scientificmethod/OperandConstants.java +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/src/scientific_method_engine/ghidra/scientificmethod/Xxh3.java +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/src/scientific_method_engine/x86/__init__.py +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/src/scientific_method_engine/x86/argument_frames.py +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/src/scientific_method_engine/x86/dispatch.py +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/src/scientific_method_engine/x86/effect_order.py +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/src/scientific_method_engine/x86/image.py +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/src/scientific_method_engine/x86/inventory.py +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/src/scientific_method_engine/x86/loops.py +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/src/scientific_method_engine/x86/pcode.py +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/src/scientific_method_engine/x86/pcode_backend.py +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/src/scientific_method_engine/x86/pe.py +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/src/scientific_method_engine/x86/reach.py +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/src/scientific_method_engine/x86/relational.py +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/src/scientific_method_engine/x86/result_flow.py +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/src/scientific_method_engine/x86/values.py +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/tests/oracle.py +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/tests/test_continuation_budget.py +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/tests/test_dispatch.py +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/tests/test_effect_order.py +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/tests/test_enter_frames.py +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/tests/test_entry_frame.py +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/tests/test_indirect_far_transfers.py +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/tests/test_interrupt_models.py +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/tests/test_inventory_check.py +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/tests/test_join_terms.py +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/tests/test_loops.py +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/tests/test_memory_scopes.py +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/tests/test_nested_frame_request.py +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/tests/test_oracle.py +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/tests/test_pe.py +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/tests/test_reach.py +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/tests/test_relational_controls.py +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/tests/test_return_checks.py +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/tests/test_successor_rule.py +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/tests/test_table_continuations.py +0 -0
- {scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/tests/test_term_limit.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: scientific-method-engine
|
|
3
|
-
Version:
|
|
3
|
+
Version: 17.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
|
|
@@ -183,6 +183,16 @@ reported as `undecided` and never counts as held. Access reports also give each
|
|
|
183
183
|
same of memory the program never reads back, at a checkpoint. See the
|
|
184
184
|
[controls contract](https://github.com/kibertoad/refurbished-dinosaurs-toolkit/blob/main/docs/bounded-evidence-reporters.md#relational-controls).
|
|
185
185
|
|
|
186
|
+
Two reads of a byte the model holds no value for read one term until a write that may store it or a
|
|
187
|
+
modeled call, which assumes nothing else changes memory. A query whose program polls memory that
|
|
188
|
+
hardware, DMA or an interrupt handler updates lists those addresses in `volatileMemory`: up to 64
|
|
189
|
+
rows of `segment` (a real-mode paragraph, or 0 in the PE32 flat model), `offset`, `bytes` and
|
|
190
|
+
`evidence`. Each read of a byte inside a declared range reads its own term, ignoring any value the
|
|
191
|
+
path stored, and its `byteProducers` row gives cause `declared volatile` with the read's order and
|
|
192
|
+
the declared row's index in `volatileMemory`. A read whose address is not concrete but may name a
|
|
193
|
+
declared byte keeps its term and carries `mayBeVolatile: true`. See the
|
|
194
|
+
[memory model](https://github.com/kibertoad/refurbished-dinosaurs-toolkit/blob/main/docs/bounded-evidence-reporters.md#bounded-instruction-reports).
|
|
195
|
+
|
|
186
196
|
A trace-family query whose entry lies inside a function body names the function's entry in
|
|
187
197
|
`entryFrame: { "from": <site> }`. The engine traces from there to the query's entry and, when SP
|
|
188
198
|
sits at one offset from the function's entry SP at every arrival, starts the query in that frame,
|
|
@@ -167,6 +167,16 @@ reported as `undecided` and never counts as held. Access reports also give each
|
|
|
167
167
|
same of memory the program never reads back, at a checkpoint. See the
|
|
168
168
|
[controls contract](https://github.com/kibertoad/refurbished-dinosaurs-toolkit/blob/main/docs/bounded-evidence-reporters.md#relational-controls).
|
|
169
169
|
|
|
170
|
+
Two reads of a byte the model holds no value for read one term until a write that may store it or a
|
|
171
|
+
modeled call, which assumes nothing else changes memory. A query whose program polls memory that
|
|
172
|
+
hardware, DMA or an interrupt handler updates lists those addresses in `volatileMemory`: up to 64
|
|
173
|
+
rows of `segment` (a real-mode paragraph, or 0 in the PE32 flat model), `offset`, `bytes` and
|
|
174
|
+
`evidence`. Each read of a byte inside a declared range reads its own term, ignoring any value the
|
|
175
|
+
path stored, and its `byteProducers` row gives cause `declared volatile` with the read's order and
|
|
176
|
+
the declared row's index in `volatileMemory`. A read whose address is not concrete but may name a
|
|
177
|
+
declared byte keeps its term and carries `mayBeVolatile: true`. See the
|
|
178
|
+
[memory model](https://github.com/kibertoad/refurbished-dinosaurs-toolkit/blob/main/docs/bounded-evidence-reporters.md#bounded-instruction-reports).
|
|
179
|
+
|
|
170
180
|
A trace-family query whose entry lies inside a function body names the function's entry in
|
|
171
181
|
`entryFrame: { "from": <site> }`. The engine traces from there to the query's entry and, when SP
|
|
172
182
|
sits at one offset from the function's entry SP at every arrival, starts the query in that frame,
|
|
@@ -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 = "
|
|
8
|
+
version = "17.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"
|
|
@@ -28,6 +28,8 @@ USAGE = ("Usage: scientific-method-engine <operand|operand-candidates|target|bou
|
|
|
28
28
|
"that inventory names and lists each target no row starts at: inside another row's body or outside every row,\n"
|
|
29
29
|
"with one calling site, near or far, and whether an entry-path call, a contested one or only raw bytes call it;\n"
|
|
30
30
|
"a target inside an instruction the entry-path walk established from another start names it as insideInstruction.\n"
|
|
31
|
+
"uses matches accesses whose footprint intersects query offset..offset+width; its rawCandidates give each unreached\n"
|
|
32
|
+
"operand's encoded displacement, width, access, segment register and intersection, and never count as uses.\n"
|
|
31
33
|
"trace, arguments, effects, returns, guards, memory and allocation check relationalControls:\n"
|
|
32
34
|
"a violated control fails the report; an undecided one is reported and never counts as held.\n"
|
|
33
35
|
"A lastWriter control with an address inspects that memory at its checkpoint anchors without a read.\n"
|
|
@@ -35,6 +37,8 @@ USAGE = ("Usage: scientific-method-engine <operand|operand-candidates|target|bou
|
|
|
35
37
|
"Declared table continuations are separate conditional paths that spend continuationBudget\n"
|
|
36
38
|
"(paths, totalSteps, maxSteps, visitLimit, stringIterations); ordinary computed transfers remain stopped.\n"
|
|
37
39
|
"Port accesses and interrupts are hardware-boundary events; portInputs supplies port reads as assumptions.\n"
|
|
40
|
+
"volatileMemory lists memory hardware or an interrupt may change (segment, offset, bytes, evidence);\n"
|
|
41
|
+
"each read of a declared byte reads its own term, cause declared volatile.\n"
|
|
38
42
|
"A callModels entry at an INT n site (real mode) returns past the interrupt under its cases (leavesFlags: true\n"
|
|
39
43
|
"keeps the interrupt's FLAGS word on the stack); other interrupts stop.\n"
|
|
40
44
|
"callModels[].preservesMemory keeps explicit, bounded pre-call byte scopes across a modeled call; other memory stays unknown.\n"
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"""Path state for the evidence layer. Instruction semantics come from pypcode (pcode_backend.py)."""
|
|
2
|
+
from bisect import bisect_right
|
|
2
3
|
from copy import deepcopy
|
|
3
4
|
from capstone.x86 import X86_OP_REG, X86_OP_IMM, X86_OP_MEM
|
|
4
5
|
from .values import Value, const, unknown, op, extract, join, resize, sources, address_parts, producers
|
|
@@ -28,6 +29,42 @@ MEMORY_CLEARED = ("memory-cleared",)
|
|
|
28
29
|
# The ``unwritten`` cause of a byte that no write on the path stored.
|
|
29
30
|
NO_WRITE = "no write on this path"
|
|
30
31
|
|
|
32
|
+
# The ``unwritten`` cause of a read byte that lies inside a range the query's ``volatileMemory`` declares.
|
|
33
|
+
VOLATILE = "declared volatile"
|
|
34
|
+
VOLATILE_FIELDS = {"segment", "offset", "bytes", "evidence"}
|
|
35
|
+
MAX_VOLATILE_RANGES = 64
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def volatile_ranges(config, bits, flat):
|
|
39
|
+
"""Check the query's ``volatileMemory`` and return its ranges as linear ``(start, end, row)`` triples, sorted.
|
|
40
|
+
|
|
41
|
+
Each row names a concrete ``segment`` (a real-mode paragraph; 0 in the PE32 flat model, whose
|
|
42
|
+
data segment bases are 0), an ``offset``, a byte count and nonempty ``evidence``. Raises
|
|
43
|
+
``ValueError`` on a malformed row, more than 64 rows, a range past the end of its segment, or
|
|
44
|
+
two ranges that share a linear byte.
|
|
45
|
+
"""
|
|
46
|
+
rows = config.get("volatileMemory", [])
|
|
47
|
+
if not isinstance(rows, list) or len(rows) > MAX_VOLATILE_RANGES:
|
|
48
|
+
raise ValueError(f"volatileMemory must be a list of at most {MAX_VOLATILE_RANGES} ranges")
|
|
49
|
+
ranges = []
|
|
50
|
+
for index, row in enumerate(rows):
|
|
51
|
+
if not isinstance(row, dict) or set(row) != VOLATILE_FIELDS:
|
|
52
|
+
raise ValueError("volatileMemory ranges name segment, offset, bytes and evidence")
|
|
53
|
+
segment, offset, size = row["segment"], row["offset"], row["bytes"]
|
|
54
|
+
if type(segment) is not int or not 0 <= segment <= 0xFFFF or flat and segment != 0:
|
|
55
|
+
raise ValueError("volatileMemory segment must be a 16-bit paragraph, or 0 in the PE32 flat model")
|
|
56
|
+
if type(offset) is not int or type(size) is not int or offset < 0 or size < 1 or offset + size > 1 << bits:
|
|
57
|
+
raise ValueError("volatileMemory offset and bytes must give a nonempty range inside the segment")
|
|
58
|
+
if not isinstance(row["evidence"], str) or not row["evidence"].strip():
|
|
59
|
+
raise ValueError("volatileMemory range requires nonempty evidence")
|
|
60
|
+
start = segment * (1 if flat else 16) + offset
|
|
61
|
+
ranges.append((start, start + size, index))
|
|
62
|
+
ranges.sort()
|
|
63
|
+
for before, after in zip(ranges, ranges[1:]):
|
|
64
|
+
if after[0] < before[1]:
|
|
65
|
+
raise ValueError("volatileMemory ranges overlap")
|
|
66
|
+
return tuple(ranges)
|
|
67
|
+
|
|
31
68
|
|
|
32
69
|
class WriteLog:
|
|
33
70
|
"""Append-only list of (key, previous value) pairs, one per register or memory byte a write changes.
|
|
@@ -166,6 +203,9 @@ class State:
|
|
|
166
203
|
self.conditional = []
|
|
167
204
|
# Values the query supplies for port reads, by site; trace validates them.
|
|
168
205
|
self.port_inputs = Shared({row["site"]: row for row in config.get("portInputs", [])})
|
|
206
|
+
# The query's volatileMemory ranges, which every copy of the path shares.
|
|
207
|
+
ranges = volatile_ranges(config, self.bits, self.flat)
|
|
208
|
+
self.volatile = Shared(ranges=ranges, starts=[r[0] for r in ranges])
|
|
169
209
|
flags = config.get("flags", {})
|
|
170
210
|
if not isinstance(flags, dict) or set(flags) - {"direction"}:
|
|
171
211
|
raise ValueError("Only an explicit starting direction flag is supported")
|
|
@@ -274,16 +314,46 @@ class State:
|
|
|
274
314
|
built): the newest write that may alias it, the write that dropped its value, the modeled
|
|
275
315
|
call that cleared memory, or none. Reads of the byte name the same term until such an event
|
|
276
316
|
happens, so a reload across writes that cannot store the byte reads the earlier term, and the
|
|
277
|
-
term changes exactly when the reported cause does.
|
|
317
|
+
term changes exactly when the reported cause does. A declared volatile byte's row names the
|
|
318
|
+
read itself, so each read of it has its own term.
|
|
278
319
|
"""
|
|
279
|
-
|
|
320
|
+
volatile = unwritten is not None and unwritten["cause"] == VOLATILE
|
|
321
|
+
if key in self.unread_memory and not volatile:
|
|
280
322
|
return self.unread_memory[key]
|
|
281
323
|
order = (unwritten or self.unwritten(key))["order"]
|
|
282
324
|
return f"memory:{'entry' if order is None else order}:{key}"
|
|
283
325
|
|
|
284
326
|
def byte(self, key, unwritten=None):
|
|
285
|
-
"""The modeled value of one memory byte, or an unknown term produced by the current site.
|
|
286
|
-
|
|
327
|
+
"""The modeled value of one memory byte, or an unknown term produced by the current site.
|
|
328
|
+
|
|
329
|
+
A read passes the byte's ``unwritten`` row, which a byte has exactly when the read sees no
|
|
330
|
+
modeled value, so a declared volatile byte reads the term that row names even when the path
|
|
331
|
+
stored a value there.
|
|
332
|
+
"""
|
|
333
|
+
if unwritten is None and key in self.memory:
|
|
334
|
+
return self.memory[key]
|
|
335
|
+
return unknown(self.unread_term(key, unwritten), 8, self.at)
|
|
336
|
+
|
|
337
|
+
def volatility(self, key):
|
|
338
|
+
"""How a byte relates to the query's volatileMemory ranges.
|
|
339
|
+
|
|
340
|
+
Returns ``("inside", row)`` with the index of the declared row whose range holds the byte when
|
|
341
|
+
the byte has a concrete linear address, ``("possible", None)`` when its address is not
|
|
342
|
+
concrete and the linear bytes it may name overlap a declared range, and ``None`` otherwise.
|
|
343
|
+
"""
|
|
344
|
+
ranges = self.volatile["ranges"]
|
|
345
|
+
if not ranges:
|
|
346
|
+
return None
|
|
347
|
+
domain = key_domain(key, self.bits, self.flat)
|
|
348
|
+
if domain is None:
|
|
349
|
+
return "possible", None
|
|
350
|
+
at = bisect_right(self.volatile["starts"], domain[0]) - 1
|
|
351
|
+
if key[0] == ("linear",):
|
|
352
|
+
return ("inside", ranges[at][2]) if at >= 0 and domain[0] < ranges[at][1] else None
|
|
353
|
+
# The range starting at or before the domain overlaps it when it ends past the domain's start;
|
|
354
|
+
# the next range overlaps it when it starts before the domain's end.
|
|
355
|
+
overlaps = at >= 0 and domain[0] < ranges[at][1] or at + 1 < len(ranges) and ranges[at + 1][0] < domain[1]
|
|
356
|
+
return ("possible", None) if overlaps else None
|
|
287
357
|
|
|
288
358
|
def latest_aliasing_write(self, group, domain):
|
|
289
359
|
"""The order of the newest write outside `group` that may have stored a byte of `domain`, or None."""
|
|
@@ -317,11 +387,27 @@ class State:
|
|
|
317
387
|
return {"cause": "dropped by a modeled call", "order": self.memory_cleared}
|
|
318
388
|
return {"cause": NO_WRITE, "order": None}
|
|
319
389
|
|
|
320
|
-
def byte_writer(self, index, key):
|
|
321
|
-
"""The byteProducers row of one accessed byte: its producers and the write that stored it.
|
|
390
|
+
def byte_writer(self, index, key, stored=False):
|
|
391
|
+
"""The byteProducers row of one accessed byte: its producers and the write that stored it.
|
|
392
|
+
|
|
393
|
+
A row for a byte a read sees (``stored`` false) follows the query's volatileMemory: a byte
|
|
394
|
+
inside a declared range has no producers or writer and an ``unwritten`` row with cause
|
|
395
|
+
``declared volatile`` and the order of the event this row belongs to, which names its term,
|
|
396
|
+
plus ``volatileMemory``, the index of the declared row. A byte whose address may name a
|
|
397
|
+
declared range carries ``mayBeVolatile: true`` and keeps its ordinary row. ``stored`` rows
|
|
398
|
+
report what a write has just stored.
|
|
399
|
+
"""
|
|
400
|
+
volatility = None if stored else self.volatility(key)
|
|
401
|
+
if volatility is not None and volatility[0] == "inside":
|
|
402
|
+
return {"index": index, "producers": [], "writeOrder": None,
|
|
403
|
+
"unwritten": {"cause": VOLATILE, "order": len(self.events)}, "volatileMemory": volatility[1]}
|
|
322
404
|
if key in self.memory:
|
|
323
|
-
|
|
324
|
-
|
|
405
|
+
row = {"index": index, "producers": producers(self.memory[key]), "writeOrder": self.memory_writers.get(key)}
|
|
406
|
+
else:
|
|
407
|
+
row = {"index": index, "producers": [], "writeOrder": None, "unwritten": self.unwritten(key)}
|
|
408
|
+
if volatility is not None:
|
|
409
|
+
row["mayBeVolatile"] = True
|
|
410
|
+
return row
|
|
325
411
|
|
|
326
412
|
def argument_slots(self, return_bytes, window):
|
|
327
413
|
"""The stack bytes above a call's return frame as a read of them would see them now.
|
|
@@ -442,11 +528,11 @@ class State:
|
|
|
442
528
|
self.memory_groups.setdefault((seg, base), set()).update(keys)
|
|
443
529
|
value = write
|
|
444
530
|
missing = []
|
|
445
|
-
rows = [self.byte_writer(i, key) for i, key in enumerate(keys)]
|
|
531
|
+
rows = [self.byte_writer(i, key, stored=True) for i, key in enumerate(keys)]
|
|
446
532
|
else:
|
|
447
|
-
missing = [i for i, key in enumerate(keys) if key not in self.memory]
|
|
448
533
|
# Each row's "unwritten" cause names the term of a byte with no value, so it is built once.
|
|
449
534
|
rows = [self.byte_writer(i, key) for i, key in enumerate(keys)]
|
|
535
|
+
missing = [row["index"] for row in rows if "unwritten" in row]
|
|
450
536
|
value = join([self.byte(key, row.get("unwritten")) for key, row in zip(keys, rows)])
|
|
451
537
|
relevant = []
|
|
452
538
|
for g in self.guards:
|
|
@@ -60,8 +60,10 @@ def capture_scopes(state, model, frame_bytes=0):
|
|
|
60
60
|
"""Resolve each scope against the pre-call state and snapshot its bytes.
|
|
61
61
|
|
|
62
62
|
Returns ``(values, unread, descriptions)``: the cached bytes, the unknown term names of bytes
|
|
63
|
-
the model had no value for, and one report entry per scope. The
|
|
64
|
-
|
|
63
|
+
the model had no value for, and one report entry per scope. The entry counts the scope's bytes
|
|
64
|
+
in ``cachedBytes``, ``uncachedBytes`` and ``volatileBytes``: a byte inside a range the query's
|
|
65
|
+
``volatileMemory`` declares counts only as volatile, since a read of it ignores any kept value.
|
|
66
|
+
The segment must be concrete. The base may be concrete, or a symbolic value such as SP or BP at an offset from an unknown entry SP
|
|
65
67
|
(ADR 0013): the scope's bytes are then keyed by that value, as reads and writes through it are.
|
|
66
68
|
Raises ``StopPath`` when the segment is not concrete, a concrete interval leaves the address
|
|
67
69
|
space, two scopes on one base value share a byte, or two scopes on different base values may
|
|
@@ -110,10 +112,13 @@ def capture_scopes(state, model, frame_bytes=0):
|
|
|
110
112
|
raise StopPath("preservesMemory scope covers the return frame the processor writes below SP")
|
|
111
113
|
resolved.append(((seg, group_base), set(keys), domain))
|
|
112
114
|
linear = seg == ("linear",)
|
|
113
|
-
cached = 0
|
|
115
|
+
cached = volatile = 0
|
|
114
116
|
for key in keys:
|
|
117
|
+
# A read of a declared volatile byte ignores the kept value, so it counts apart.
|
|
118
|
+
inside = (state.volatility(key) or ("",))[0] == "inside"
|
|
119
|
+
volatile += inside
|
|
115
120
|
if key in state.memory:
|
|
116
|
-
cached +=
|
|
121
|
+
cached += not inside
|
|
117
122
|
values[key] = state.memory[key]
|
|
118
123
|
else:
|
|
119
124
|
unread[key] = state.unread_term(key)
|
|
@@ -123,7 +128,8 @@ def capture_scopes(state, model, frame_bytes=0):
|
|
|
123
128
|
"offset": offset.number,
|
|
124
129
|
"interval": {"segment": seg, "base": group_base, "start": start, "end": start + size},
|
|
125
130
|
"linearStart": start if linear else None, "linearEnd": start + size if linear else None, "bytes": size,
|
|
126
|
-
"cachedBytes": cached, "uncachedBytes": size - cached, "
|
|
131
|
+
"cachedBytes": cached, "uncachedBytes": size - cached - volatile, "volatileBytes": volatile,
|
|
132
|
+
"evidence": scope["evidence"],
|
|
127
133
|
"meaning": "explicit pre-call memory-preservation hypothesis; memory outside every scope is unknown"})
|
|
128
134
|
return values, unread, descriptions
|
|
129
135
|
|
|
@@ -22,8 +22,8 @@ def entries(image):
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
def memory_width(ins, operand):
|
|
25
|
-
# Capstone reports the LDS/LES source as a word, but the load reads the full selector:offset pointer.
|
|
26
|
-
return 2 + ins.operands[0].size if ins.mnemonic in ("lds", "les") else operand.size
|
|
25
|
+
# Capstone reports the LDS/LES/LSS/LFS/LGS source as a word, but the load reads the full selector:offset pointer.
|
|
26
|
+
return 2 + ins.operands[0].size if ins.mnemonic in ("lds", "les", "lss", "lfs", "lgs") else operand.size
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
# Capstone reports several x87 stores (fst, fstp m32/m64, fist, fistp m16/m32, fnstcw) as reads and frstor
|
|
@@ -336,6 +336,73 @@ def _caller_continuations(image, stop, reason, stack, limit, cache, modeled=froz
|
|
|
336
336
|
return rows, []
|
|
337
337
|
|
|
338
338
|
|
|
339
|
+
# Memory operands whose Capstone size is not the bytes the instruction touches: x87 environment and
|
|
340
|
+
# state images, and FXSAVE/XSAVE areas. Their footprint is reported as unknown, never as Capstone's size.
|
|
341
|
+
UNKNOWN_FOOTPRINT = frozenset(("fnstenv", "fstenv", "fldenv", "fnsave", "fsave", "frstor", "fxsave", "fxrstor",
|
|
342
|
+
"fxsave64", "fxrstor64", "xsave", "xrstor", "xsaveopt", "xsavec", "xsaves", "xrstors"))
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
def footprint_width(ins, operand):
|
|
346
|
+
"""The bytes the memory operand ``operand`` of ``ins`` touches, or None when no established source gives
|
|
347
|
+
them: the mnemonics of ``UNKNOWN_FOOTPRINT``, and an operand Capstone gives no size."""
|
|
348
|
+
return None if base_mnemonic(ins) in UNKNOWN_FOOTPRINT or not operand.size else memory_width(ins, operand)
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
def _footprint(ins, operand, start, offset, width):
|
|
352
|
+
"""How the memory operand ``operand`` of ``ins``, starting at offset ``start``, meets the query field
|
|
353
|
+
``[offset, offset + width)``: ``(width, wraps, intersection)``, or None when it cannot meet it.
|
|
354
|
+
|
|
355
|
+
A footprint that runs past the top of the instruction's address space (64 KiB for a 16-bit address
|
|
356
|
+
size, 4 GiB for a 32-bit one) wraps to zero. An operand of unknown width extends upward from its start
|
|
357
|
+
by an unknown amount, so it may meet the field when it starts below the field's end, and has no width,
|
|
358
|
+
wrap or intersection; it is not followed past the top of the address space."""
|
|
359
|
+
space = 1 << 8 * ins.addr_size
|
|
360
|
+
size = footprint_width(ins, operand)
|
|
361
|
+
if size is None:
|
|
362
|
+
return None if start >= offset + width else (None, None, None)
|
|
363
|
+
pieces = [(start, min(start + size, space))] + ([(0, start + size - space)] if start + size > space else [])
|
|
364
|
+
hits = [(max(offset, a), min(offset + width, z)) for a, z in pieces if max(offset, a) < min(offset + width, z)]
|
|
365
|
+
return (size, start + size > space, {"start": hits[0][0], "end": hits[0][1]}) if hits else None
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
def _overlapping(intervals, starts, at, size):
|
|
369
|
+
"""The instructions of ``intervals`` (sorted ``(start, end)`` pairs, with ``starts`` their starts) that
|
|
370
|
+
intersect ``[at, at + size)``, other than one starting at ``at``."""
|
|
371
|
+
# At most 15 bytes precede a partly overlapping x86 instruction.
|
|
372
|
+
lo, hi = bisect_right(starts, at - 15), bisect_right(starts, at + size - 1)
|
|
373
|
+
return [{"site": a, "end": z} for a, z in intervals[lo:hi] if a != at and a < at + size and z > at]
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
def _raw_footprints(ins, offset, width, mode):
|
|
377
|
+
"""The explicit memory operands of ``ins`` whose encoded footprint may intersect the query field
|
|
378
|
+
``[offset, offset + width)`` with an access the query ``mode`` asks for, with each one's encoded start,
|
|
379
|
+
width, direction and intersection.
|
|
380
|
+
|
|
381
|
+
The encoded start is the displacement, wrapped to the instruction's address size; ``addressRegisters``
|
|
382
|
+
names the base and index registers that move the real address away from it. ``_footprint`` decides
|
|
383
|
+
whether it meets the field. An operand with no access (LEA) is kept under every mode, since what the
|
|
384
|
+
formed address is used for is unknown."""
|
|
385
|
+
rows = []
|
|
386
|
+
for index, operand in enumerate(ins.operands):
|
|
387
|
+
if operand.type != X86_OP_MEM:
|
|
388
|
+
continue
|
|
389
|
+
# LEA forms an address and touches no memory.
|
|
390
|
+
access = [] if ins.mnemonic == "lea" else memory_access(ins, operand)
|
|
391
|
+
if access and mode != "both" and mode not in access:
|
|
392
|
+
continue
|
|
393
|
+
mem = operand.mem
|
|
394
|
+
start = mem.disp & ((1 << 8 * ins.addr_size) - 1)
|
|
395
|
+
footprint = _footprint(ins, operand, start, offset, width)
|
|
396
|
+
if footprint is None:
|
|
397
|
+
continue
|
|
398
|
+
size, wraps, intersection = footprint
|
|
399
|
+
rows.append({"operandIndex": index, "displacement": start,
|
|
400
|
+
"addressRegisters": [ins.reg_name(r) for r in (mem.base, mem.index) if r],
|
|
401
|
+
"width": size, "wraps": wraps, "intersection": intersection, "access": access,
|
|
402
|
+
"effectiveSegmentRegister": segment_register(ins, mem)})
|
|
403
|
+
return rows
|
|
404
|
+
|
|
405
|
+
|
|
339
406
|
def uses(image, config):
|
|
340
407
|
query = config.get("query", {})
|
|
341
408
|
offset = integer(query.get("offset"), 0, image.mask, "query offset")
|
|
@@ -498,16 +565,20 @@ def uses(image, config):
|
|
|
498
565
|
segment_value, offset_value, segment_name = state.address(ins, operand)
|
|
499
566
|
except StopPath as error:
|
|
500
567
|
gaps.append({"site": at, "reason": str(error)}); continue
|
|
501
|
-
size =
|
|
568
|
+
size = footprint_width(ins, operand)
|
|
502
569
|
off = offset_value.number
|
|
503
|
-
|
|
504
|
-
if off is not None and
|
|
570
|
+
footprint = None if off is None else _footprint(ins, operand, off, offset, width)
|
|
571
|
+
if off is not None and footprint is None:
|
|
505
572
|
continue
|
|
573
|
+
# A concrete footprint overlaps the field when it starts inside it, or below it with a known
|
|
574
|
+
# width. One of unknown width, or one that reaches the field only by wrapping past the top of
|
|
575
|
+
# the offset space, is a possible alias.
|
|
576
|
+
overlaps = off is not None and (offset <= off < offset + width or off < offset and footprint[0] is not None)
|
|
506
577
|
for kind in kinds:
|
|
507
578
|
# A concrete segment query cannot bind an unpropagated DS/SS.
|
|
508
579
|
conditional.append({"site": at, "kind": kind, "width": size,
|
|
509
580
|
"segment": segment_value.report(), "offset": offset_value.report(),
|
|
510
|
-
"value": unknown(f"CFG-operand:{at}", size * 8).report(),
|
|
581
|
+
"value": unknown(f"CFG-operand:{at}", None if size is None else size * 8).report(),
|
|
511
582
|
"effectiveSegmentRegister": segment_name,
|
|
512
583
|
"address": "overlaps query" if overlaps and segment is None else "possible alias",
|
|
513
584
|
"classification": ("unverified overlapping instruction path" if at in unverified else
|
|
@@ -522,18 +593,26 @@ def uses(image, config):
|
|
|
522
593
|
raw = []
|
|
523
594
|
scanned_bytes = 0
|
|
524
595
|
byte_limit = scan_limit(image, config.get("scanLimit", 65536))
|
|
596
|
+
# Only entry-path instructions reject a raw candidate's boundary. The walk leaves contested
|
|
597
|
+
# instructions and rejected starts out of seen, since they prove nothing.
|
|
598
|
+
verified = sorted((at, at + ins.size) for at, ins in seen.items())
|
|
599
|
+
verified_starts = [a for a, _ in verified]
|
|
525
600
|
for r in image.regions:
|
|
526
601
|
for at in range(r["start"], r["end"]):
|
|
527
602
|
if scanned_bytes >= byte_limit:
|
|
528
603
|
gaps.append({"region": r["name"], "unsearchedStart": at, "end": r["end"], "reason": "raw scan limit"})
|
|
529
604
|
break
|
|
530
605
|
scanned_bytes += 1
|
|
531
|
-
ins = image.decode(at)
|
|
532
606
|
# An instruction the walk past a stop decoded (one past a PE32 port access) is already inventoried above.
|
|
533
|
-
|
|
534
|
-
|
|
607
|
+
ins = image.decode(at) if at not in seen and at not in after_stop else None
|
|
608
|
+
footprints = _raw_footprints(ins, offset, width, mode) if ins else []
|
|
609
|
+
if footprints:
|
|
535
610
|
if len(raw) < result_limit:
|
|
536
|
-
|
|
611
|
+
inside = _overlapping(verified, verified_starts, at, ins.size)
|
|
612
|
+
raw.append({"site": at, "size": ins.size, "classification": "unverified operand candidate",
|
|
613
|
+
"boundary": "rejectedOverlap" if inside else "unresolvedBoundary",
|
|
614
|
+
"overlapsVerified": inside, "mnemonic": ins.mnemonic, "prefixes": prefixes(ins),
|
|
615
|
+
"operands": footprints})
|
|
537
616
|
else:
|
|
538
617
|
gaps.append({"reason": "raw candidate limit"}); break
|
|
539
618
|
truncated = len(matches) + len(unresolved) + len(conditional) > result_limit
|
|
@@ -600,9 +679,7 @@ def operand_candidates(image, config):
|
|
|
600
679
|
literal = operand.mem.disp if operand.type == X86_OP_MEM else operand.imm
|
|
601
680
|
if literal & image.mask != value:
|
|
602
681
|
continue
|
|
603
|
-
|
|
604
|
-
lo, hi = bisect_right(starts, at - 15), bisect_right(starts, at + ins.size - 1)
|
|
605
|
-
overlaps = [{"site": a, "end": z} for a, z in intervals[lo:hi] if a != at and a < at + ins.size and z > at]
|
|
682
|
+
overlaps = _overlapping(intervals, starts, at, ins.size)
|
|
606
683
|
memory = operand.type == X86_OP_MEM and ins.mnemonic != "lea" and bool(operand.access & (CS_AC_READ | CS_AC_WRITE))
|
|
607
684
|
classification = ("unresolvedBoundary" if at in ambiguous else
|
|
608
685
|
"verifiedMemoryUses" if at in seen and memory else
|
|
@@ -615,7 +692,7 @@ def operand_candidates(image, config):
|
|
|
615
692
|
continue
|
|
616
693
|
rows.append({"site": at, "end": at + ins.size, "operandIndex": index,
|
|
617
694
|
"operandKind": "memory" if operand.type == X86_OP_MEM else "immediate",
|
|
618
|
-
"width":
|
|
695
|
+
"width": memory_width(ins, operand) if operand.type == X86_OP_MEM else operand.size,
|
|
619
696
|
"prefixes": prefixes(ins), "mnemonic": ins.mnemonic,
|
|
620
697
|
"access": [name for flag, name in ((CS_AC_READ, "read"), (CS_AC_WRITE, "write")) if operand.access & flag],
|
|
621
698
|
"effectiveSegmentRegister": segment_register(ins, operand.mem) if operand.type == X86_OP_MEM else None,
|
|
@@ -31,14 +31,16 @@ def far_pointer_word(state, read, low):
|
|
|
31
31
|
|
|
32
32
|
``row`` reports the word's value and the producers and writers of its two bytes. ``word`` is the
|
|
33
33
|
modeled value of those bytes with all their sources, including the markers of declared return
|
|
34
|
-
results that ``producers`` leaves out, or None when a byte has no modeled value
|
|
34
|
+
results that ``producers`` leaves out, or None when a byte has no modeled value or lies in
|
|
35
|
+
declared volatile memory, whose read has no producer.
|
|
35
36
|
"""
|
|
36
37
|
rows = read["byteProducers"][low // 8:low // 8 + 2]
|
|
37
38
|
interval = read["interval"]
|
|
38
39
|
seg, base, start = interval["segment"], interval["base"], interval["start"]
|
|
39
40
|
keys = [(seg, base, start + i if seg == ("linear",) else (start + i) % (1 << state.bits))
|
|
40
41
|
for i in (low // 8, low // 8 + 1)]
|
|
41
|
-
word = join([state.memory[key] for key in keys])
|
|
42
|
+
word = (join([state.memory[key] for key in keys])
|
|
43
|
+
if all(key in state.memory and "unwritten" not in row for key, row in zip(keys, rows)) else None)
|
|
42
44
|
return ({"value": None if word is None else word.number,
|
|
43
45
|
"producers": sorted({p for row in rows for p in row["producers"]}), "bytes": rows}, word)
|
|
44
46
|
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
"""Declared volatile memory: reads of bytes hardware or an interrupt may change. Synthetic bytes only."""
|
|
2
|
+
import unittest
|
|
3
|
+
|
|
4
|
+
from test_x86 import Code, report, events
|
|
5
|
+
from test_relational_controls import control, verdict
|
|
6
|
+
from test_pe import report as pe_report, events as pe_events
|
|
7
|
+
import test_indirect_far_transfers as far
|
|
8
|
+
|
|
9
|
+
FRAME = {"ds": 0x2000, "ss": 0x3000, "sp": 0xff00}
|
|
10
|
+
# The word at DS:0100 in FRAME.
|
|
11
|
+
WORD = {"segment": 0x2000, "offset": 0x100, "bytes": 2, "evidence": "synthetic polled status word"}
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def volatile(**fields):
|
|
15
|
+
return [{**WORD, **fields}]
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class ReloadTests(unittest.TestCase):
|
|
19
|
+
def reload(self, store="", registers=FRAME, ranges=(), kind="sameValue"):
|
|
20
|
+
# Load the word at DS:0100, test it, run `store` on the nonzero branch, then reload the word.
|
|
21
|
+
self.c = (Code().emit("a1 00 01 85 c0").label("test").branch("74", "out").label("store").emit(store)
|
|
22
|
+
.label("use").emit("8b 1e 00 01").label("out").emit("c3"))
|
|
23
|
+
if kind == "sameValue":
|
|
24
|
+
rule = control("reload", "order", before={"site": self.c.labels["test"], "event": "branch"},
|
|
25
|
+
branch={"taken": False}, sameValue={"before": "left", "at": "value"},
|
|
26
|
+
at={"site": self.c.labels["use"], "event": "read"})
|
|
27
|
+
else:
|
|
28
|
+
rule = control("reload", "lastWriter", writers=[self.c.labels["store"]],
|
|
29
|
+
at={"site": self.c.labels["use"], "event": "read"})
|
|
30
|
+
self.result = report(self.c, relationalControls=[rule], registers=registers, volatileMemory=list(ranges))
|
|
31
|
+
return verdict(self.result, "reload")
|
|
32
|
+
|
|
33
|
+
def reads(self):
|
|
34
|
+
"""The load and the reload on the path that reaches the reload."""
|
|
35
|
+
path = next(p for p in self.result["paths"]
|
|
36
|
+
if any(e["kind"] == "read" and e["site"] == self.c.labels["use"] for e in p["events"]))
|
|
37
|
+
return [e for e in path["events"] if e["kind"] == "read"]
|
|
38
|
+
|
|
39
|
+
def occurrence(self, result):
|
|
40
|
+
return next(o for p in result["paths"] for o in p["occurrences"])
|
|
41
|
+
|
|
42
|
+
def test_a_reload_outside_every_declared_range_keeps_the_tested_word(self):
|
|
43
|
+
# Positive control: the same query holds with no range, and with a range that misses the word.
|
|
44
|
+
for name, ranges in (("no range", ()), ("range elsewhere", volatile(offset=0x200)),
|
|
45
|
+
("range in another segment", volatile(segment=0x40, offset=0x6C))):
|
|
46
|
+
with self.subTest(name):
|
|
47
|
+
self.assertEqual(self.reload(ranges=ranges)["verdict"], "held")
|
|
48
|
+
for read in self.reads():
|
|
49
|
+
for row in read["byteProducers"]:
|
|
50
|
+
self.assertNotIn("volatileMemory", row)
|
|
51
|
+
self.assertNotIn("mayBeVolatile", row)
|
|
52
|
+
|
|
53
|
+
def test_each_read_of_a_declared_volatile_word_has_its_own_term(self):
|
|
54
|
+
result = self.reload(ranges=volatile())
|
|
55
|
+
self.assertEqual(result["verdict"], "undecided")
|
|
56
|
+
self.assertIn("not shown equal", self.occurrence(result)["reason"])
|
|
57
|
+
first, second = self.reads()
|
|
58
|
+
self.assertNotEqual(first["value"]["expression"], second["value"]["expression"])
|
|
59
|
+
for read in (first, second):
|
|
60
|
+
self.assertEqual(read["missingByteProducers"], [0, 1])
|
|
61
|
+
for row in read["byteProducers"]:
|
|
62
|
+
self.assertEqual(row["unwritten"], {"cause": "declared volatile", "order": read["order"]})
|
|
63
|
+
self.assertEqual((row["producers"], row["writeOrder"], row["volatileMemory"]), ([], None, 0))
|
|
64
|
+
|
|
65
|
+
def test_a_range_over_one_byte_of_the_word_changes_only_that_byte(self):
|
|
66
|
+
self.assertEqual(self.reload(ranges=volatile(offset=0x101, bytes=1))["verdict"], "undecided")
|
|
67
|
+
low, high = self.reads()[1]["byteProducers"]
|
|
68
|
+
self.assertEqual(low["unwritten"]["cause"], "no write on this path")
|
|
69
|
+
self.assertNotIn("volatileMemory", low)
|
|
70
|
+
self.assertEqual((high["unwritten"]["cause"], high["volatileMemory"]), ("declared volatile", 0))
|
|
71
|
+
|
|
72
|
+
def test_a_path_store_to_a_volatile_word_is_not_read_back(self):
|
|
73
|
+
store = "c7 06 00 01 05 00" # mov word [0100], 5
|
|
74
|
+
self.assertEqual(self.reload(store, kind="lastWriter")["verdict"], "held")
|
|
75
|
+
self.assertEqual(self.reads()[1]["value"]["value"], 5)
|
|
76
|
+
result = self.reload(store, ranges=volatile(), kind="lastWriter")
|
|
77
|
+
self.assertEqual(result["verdict"], "undecided")
|
|
78
|
+
reload = self.reads()[1]
|
|
79
|
+
self.assertIsNone(reload["value"]["value"])
|
|
80
|
+
self.assertEqual(self.occurrence(result)["bytes"][0]["unwritten"],
|
|
81
|
+
{"cause": "declared volatile", "order": reload["order"]})
|
|
82
|
+
# The write itself still reports what it stored.
|
|
83
|
+
write = events(self.result, "write")[0]
|
|
84
|
+
self.assertEqual([row["writeOrder"] for row in write["byteProducers"]], [write["order"]] * 2)
|
|
85
|
+
self.assertNotIn("unwritten", write["byteProducers"][0])
|
|
86
|
+
|
|
87
|
+
def test_a_read_whose_address_may_name_a_declared_range_is_flagged_and_keeps_its_term(self):
|
|
88
|
+
# Unknown DS: the word may lie anywhere, so it may lie in the declared range.
|
|
89
|
+
self.assertEqual(self.reload(registers={}, ranges=volatile())["verdict"], "held")
|
|
90
|
+
for read in self.reads():
|
|
91
|
+
self.assertTrue(all(row["mayBeVolatile"] for row in read["byteProducers"]))
|
|
92
|
+
self.assertTrue(all("volatileMemory" not in row for row in read["byteProducers"]))
|
|
93
|
+
|
|
94
|
+
def test_a_concrete_segment_flags_symbolic_offsets_only_when_it_spans_a_range(self):
|
|
95
|
+
# mov bx, [0300]; mov ax, [bx]; ret: the second read has a concrete segment and a symbolic offset.
|
|
96
|
+
code = Code().emit("8b 1e 00 03").label("deref").emit("8b 07 c3")
|
|
97
|
+
for name, ranges, flagged in (("range in DS", volatile(), True),
|
|
98
|
+
("range outside DS", volatile(segment=0x40, offset=0x6C), False)):
|
|
99
|
+
with self.subTest(name):
|
|
100
|
+
result = report(code, registers=FRAME, volatileMemory=ranges)
|
|
101
|
+
pointer, deref = events(result, "read")
|
|
102
|
+
self.assertNotIn("mayBeVolatile", pointer["byteProducers"][0])
|
|
103
|
+
self.assertEqual("mayBeVolatile" in deref["byteProducers"][0], flagged)
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
class ProbeTests(unittest.TestCase):
|
|
107
|
+
def test_an_address_probe_over_a_volatile_word_names_its_checkpoint(self):
|
|
108
|
+
# mov [0100], ax; ret, with a lastWriter address at the return's checkpoint and no read of the word.
|
|
109
|
+
code = Code().label("store").emit("a3 00 01").label("end").emit("c3")
|
|
110
|
+
rule = control("slot", "lastWriter", writers=[code.labels["store"]],
|
|
111
|
+
at={"site": code.labels["end"], "event": "checkpoint"},
|
|
112
|
+
address={"segment": "ds", "displacement": 0x100, "width": 2})
|
|
113
|
+
self.assertEqual(verdict(report(code, relationalControls=[rule], registers=FRAME), "slot")["verdict"], "held")
|
|
114
|
+
result = report(code, relationalControls=[rule], registers=FRAME, volatileMemory=volatile())
|
|
115
|
+
self.assertEqual(verdict(result, "slot")["verdict"], "undecided")
|
|
116
|
+
checkpoint = events(result, "checkpoint")[0]
|
|
117
|
+
for row in checkpoint["memoryProbes"][0]["byteProducers"]:
|
|
118
|
+
self.assertEqual(row["unwritten"], {"cause": "declared volatile", "order": checkpoint["order"]})
|
|
119
|
+
self.assertEqual(row["volatileMemory"], 0)
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
class ScopeTests(unittest.TestCase):
|
|
123
|
+
def test_a_preserved_scope_counts_declared_volatile_bytes_apart(self):
|
|
124
|
+
# mov word [00FE], 7; mov word [0100], 5; mov bx, 00FE; call service (modeled, keeps DS:BX..+4); reload.
|
|
125
|
+
c = (Code().emit("c7 06 fe 00 07 00 c7 06 00 01 05 00 bb fe 00").label("service").branch("e8", "external")
|
|
126
|
+
.label("reload").emit("a1 00 01 c3").label("external").emit("c3"))
|
|
127
|
+
model = {"site": c.labels["service"], "preserves": ["ds", "ss"],
|
|
128
|
+
"preservesMemory": [{"segment": "ds", "base": "bx", "bytes": 4, "evidence": "synthetic kept buffer"}],
|
|
129
|
+
"evidence": "synthetic returning service; other memory unknown", "cases": [{}]}
|
|
130
|
+
for name, ranges, counts, value in (("no range", [], (4, 0, 0), 5), ("range", volatile(), (2, 0, 2), None)):
|
|
131
|
+
with self.subTest(name):
|
|
132
|
+
result = report(c, registers=FRAME, callModels=[model], volatileMemory=ranges)
|
|
133
|
+
kept = result["paths"][0]["conditionalModels"][0]["preservedMemoryScopes"][0]
|
|
134
|
+
self.assertEqual((kept["cachedBytes"], kept["uncachedBytes"], kept["volatileBytes"]), counts)
|
|
135
|
+
reload = next(e for e in events(result, "read") if e["site"] == c.labels["reload"])
|
|
136
|
+
self.assertEqual(reload["value"]["value"], value)
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
class PollLoopTests(unittest.TestCase):
|
|
140
|
+
def test_a_polled_timer_word_can_change_between_iterations(self):
|
|
141
|
+
# l: mov ax, es:[006C]; cmp ax, dx; je l; ret
|
|
142
|
+
code = Code().label("l").emit("26 a1 6c 00 39 d0").branch("74", "l").emit("c3")
|
|
143
|
+
timer = {"segment": 0x40, "offset": 0x6C, "bytes": 2, "evidence": "synthetic timer counter"}
|
|
144
|
+
|
|
145
|
+
def exits(ranges):
|
|
146
|
+
result = report(code, registers={"es": 0x40}, volatileMemory=ranges, visitLimit=3)
|
|
147
|
+
return sorted(sum(1 for e in p["events"] if e["kind"] == "read") for p in result["paths"] if p["returned"])
|
|
148
|
+
|
|
149
|
+
# Without the range every poll reads one term, so the path leaves only after the first poll.
|
|
150
|
+
self.assertEqual(exits([]), [1])
|
|
151
|
+
self.assertEqual(exits([timer]), [1, 2, 3])
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
class FarPointerTests(unittest.TestCase):
|
|
155
|
+
def test_a_pointer_in_volatile_memory_is_not_followed(self):
|
|
156
|
+
parts = (far.STORE_OFFSET, far.STORE_SEGMENT, far.CALL, "c3")
|
|
157
|
+
self.assertTrue(far.run(*parts)["paths"][0]["returned"])
|
|
158
|
+
pointer = {"segment": far.FRAME["ds"], "offset": 0x200, "bytes": 4, "evidence": "synthetic vector a handler rewrites"}
|
|
159
|
+
path = far.run(*parts, volatileMemory=[pointer])["paths"][0]
|
|
160
|
+
self.assertEqual(path["stop"], "unresolved call: far pointer offset and segment words unknown")
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
class ValidationTests(unittest.TestCase):
|
|
164
|
+
def test_malformed_ranges_are_rejected(self):
|
|
165
|
+
for name, ranges, message in (
|
|
166
|
+
("not a list", WORD, "at most 64 ranges"),
|
|
167
|
+
("too many", [dict(WORD, offset=n * 2) for n in range(65)], "at most 64 ranges"),
|
|
168
|
+
("missing evidence", [{k: v for k, v in WORD.items() if k != "evidence"}], "name segment, offset"),
|
|
169
|
+
("extra field", volatile(width=2), "name segment, offset"),
|
|
170
|
+
("blank evidence", volatile(evidence=" "), "nonempty evidence"),
|
|
171
|
+
("segment register name", volatile(segment="es"), "16-bit paragraph"),
|
|
172
|
+
("empty", volatile(bytes=0), "nonempty range"),
|
|
173
|
+
("past the segment", volatile(offset=0xFFFF), "nonempty range"),
|
|
174
|
+
("overlap through another segment", volatile() + volatile(segment=0x2010, offset=0, evidence="x"),
|
|
175
|
+
"overlap")):
|
|
176
|
+
with self.subTest(name):
|
|
177
|
+
with self.assertRaisesRegex(ValueError, message):
|
|
178
|
+
report("c3", volatileMemory=ranges)
|
|
179
|
+
|
|
180
|
+
def test_the_flat_model_takes_linear_offsets_in_segment_zero(self):
|
|
181
|
+
code = bytes.fromhex("a1 00 20 40 00 c3") # mov eax, [00402000]; ret
|
|
182
|
+
with self.assertRaisesRegex(ValueError, "or 0 in the PE32 flat model"):
|
|
183
|
+
pe_report(code, volatileMemory=volatile(segment=1, offset=0x402000))
|
|
184
|
+
read = pe_events(pe_report(code, volatileMemory=volatile(segment=0, offset=0x402002)), "read")[0]
|
|
185
|
+
self.assertEqual([row["unwritten"]["cause"] for row in read["byteProducers"]],
|
|
186
|
+
["no write on this path"] * 2 + ["declared volatile"] * 2)
|
|
187
|
+
|
|
188
|
+
def test_adjacent_ranges_are_accepted(self):
|
|
189
|
+
result = report("c3", volatileMemory=volatile() + volatile(offset=0x102, evidence="next word"))
|
|
190
|
+
self.assertTrue(result["paths"][0]["returned"])
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
if __name__ == "__main__":
|
|
194
|
+
unittest.main()
|
|
@@ -2593,6 +2593,111 @@ class ReporterTests(unittest.TestCase):
|
|
|
2593
2593
|
r = report("c3 a1 ff 01 c3", "uses", query={"offset": 0x200, "width": 1})
|
|
2594
2594
|
self.assertEqual([c["site"] for c in r["rawCandidates"]], [1])
|
|
2595
2595
|
|
|
2596
|
+
def raw_footprints(self, code, **query):
|
|
2597
|
+
r = report(code, "uses", query=query)
|
|
2598
|
+
return {c["site"]: c for c in r["rawCandidates"]}
|
|
2599
|
+
|
|
2600
|
+
def test_raw_candidates_report_each_operand_footprint_against_the_field(self):
|
|
2601
|
+
# ret; then unreached: mov [30],ax; mov [31],ax; mov [32],ax; mov [33],al; mov [34],ax; ret
|
|
2602
|
+
rows = self.raw_footprints("c3 89 06 1e 00 89 06 1f 00 89 06 20 00 88 06 21 00 89 06 22 00 c3",
|
|
2603
|
+
offset=32, width=2)
|
|
2604
|
+
# The store touching the field from below and the one past its end stay out.
|
|
2605
|
+
self.assertNotIn(1, rows)
|
|
2606
|
+
self.assertNotIn(17, rows)
|
|
2607
|
+
footprint = {at: [(o["displacement"], o["width"], o["intersection"], o["access"]) for o in rows[at]["operands"]]
|
|
2608
|
+
for at in (5, 9, 13)}
|
|
2609
|
+
self.assertEqual(footprint, {
|
|
2610
|
+
5: [(31, 2, {"start": 32, "end": 33}, ["write"])],
|
|
2611
|
+
9: [(32, 2, {"start": 32, "end": 34}, ["write"])],
|
|
2612
|
+
13: [(33, 1, {"start": 33, "end": 34}, ["write"])]})
|
|
2613
|
+
row = rows[5]
|
|
2614
|
+
self.assertEqual((row["classification"], row["boundary"], row["overlapsVerified"], row["mnemonic"]),
|
|
2615
|
+
("unverified operand candidate", "unresolvedBoundary", [], "mov"))
|
|
2616
|
+
self.assertEqual((row["operands"][0]["effectiveSegmentRegister"], row["operands"][0]["addressRegisters"],
|
|
2617
|
+
row["operands"][0]["wraps"], row["operands"][0]["operandIndex"]), ("ds", [], False, 0))
|
|
2618
|
+
|
|
2619
|
+
def test_raw_candidate_footprint_keeps_segment_override_and_address_registers(self):
|
|
2620
|
+
# ret; es: mov [bx+32],ax; mov ax,[bp+32]; ret
|
|
2621
|
+
rows = self.raw_footprints("c3 26 89 47 20 8b 46 20 c3", offset=32, width=2)
|
|
2622
|
+
es, ss = rows[1]["operands"][0], rows[5]["operands"][0]
|
|
2623
|
+
self.assertEqual((es["effectiveSegmentRegister"], es["addressRegisters"], es["access"]), ("es", ["bx"], ["write"]))
|
|
2624
|
+
self.assertEqual(rows[1]["prefixes"], [0x26])
|
|
2625
|
+
self.assertEqual((ss["effectiveSegmentRegister"], ss["addressRegisters"], ss["access"]), ("ss", ["bp"], ["read"]))
|
|
2626
|
+
|
|
2627
|
+
def test_raw_candidate_footprint_wraps_past_the_top_of_the_offset_space(self):
|
|
2628
|
+
rows = self.raw_footprints("c3 89 06 ff ff c3", offset=0, width=1)
|
|
2629
|
+
self.assertEqual([(o["wraps"], o["intersection"]) for o in rows[1]["operands"]], [(True, {"start": 0, "end": 1})])
|
|
2630
|
+
|
|
2631
|
+
def test_raw_candidate_of_unknown_footprint_has_no_width_and_stays_when_it_starts_below_the_field(self):
|
|
2632
|
+
# ret; fnsave [16]; fnsave [80]; ret. Capstone's operand size is not the saved state's size.
|
|
2633
|
+
rows = self.raw_footprints("c3 dd 36 10 00 dd 36 50 00 c3", offset=64, width=2)
|
|
2634
|
+
self.assertEqual(list(rows), [1])
|
|
2635
|
+
self.assertEqual([(o["width"], o["wraps"], o["intersection"], o["access"]) for o in rows[1]["operands"]],
|
|
2636
|
+
[(None, None, None, ["write"])])
|
|
2637
|
+
|
|
2638
|
+
def test_raw_candidate_footprint_of_far_pointer_loads_and_lea(self):
|
|
2639
|
+
# ret; les ax,[31]; lss sp,[30]; lea ax,[32]; ret
|
|
2640
|
+
rows = self.raw_footprints("c3 c4 06 1f 00 0f b2 26 1e 00 8d 06 20 00 c3", offset=32, width=2)
|
|
2641
|
+
self.assertEqual([(o["width"], o["intersection"]) for o in rows[1]["operands"]], [(4, {"start": 32, "end": 34})])
|
|
2642
|
+
self.assertEqual([(o["width"], o["intersection"]) for o in rows[5]["operands"]], [(4, {"start": 32, "end": 34})])
|
|
2643
|
+
self.assertEqual(rows[10]["operands"][0]["access"], [])
|
|
2644
|
+
|
|
2645
|
+
def test_cfg_operand_past_a_stop_takes_the_raw_candidate_footprint(self):
|
|
2646
|
+
# int 3 stops the trace. Past it: fnsave [16], of unknown width below the field, a possible alias;
|
|
2647
|
+
# fnsave [80], past the field's end, left out; mov [0x30],ax, a word below the field, left out.
|
|
2648
|
+
r = report("cd 03 dd 36 10 00 dd 36 50 00 89 06 30 00 c3", "uses", query={"offset": 64, "width": 2})
|
|
2649
|
+
self.assertEqual([(e["site"], e["address"]) for e in r["conditionalAccesses"]], [(2, "possible alias")])
|
|
2650
|
+
# Capstone's size for FNSAVE (4) is not the saved state's size, so the row claims no width.
|
|
2651
|
+
row = r["conditionalAccesses"][0]
|
|
2652
|
+
self.assertEqual((row["width"], row["value"]["bits"]), (None, None))
|
|
2653
|
+
self.assertEqual(r["rawCandidates"], [])
|
|
2654
|
+
# A word at 0xFFFF reaches offset 0 only by wrapping, so it is a possible alias, never an overlap.
|
|
2655
|
+
r = report("cd 03 89 06 ff ff c3", "uses", query={"offset": 0, "width": 1})
|
|
2656
|
+
self.assertEqual([(e["site"], e["address"]) for e in r["conditionalAccesses"]], [(2, "possible alias")])
|
|
2657
|
+
# A word starting below the field overlaps it.
|
|
2658
|
+
r = report("cd 03 89 06 3f 00 c3", "uses", query={"offset": 64, "width": 2}, controls=[2])
|
|
2659
|
+
self.assertEqual([(e["site"], e["address"]) for e in r["conditionalAccesses"]], [(2, "overlaps query")])
|
|
2660
|
+
|
|
2661
|
+
def test_raw_candidates_keep_the_query_access_mode(self):
|
|
2662
|
+
# ret; then unreached: mov ax,[32]; mov [32],ax; lea ax,[32]; ret
|
|
2663
|
+
code = "c3 8b 06 20 00 89 06 20 00 8d 06 20 00 c3"
|
|
2664
|
+
self.assertEqual(list(self.raw_footprints(code, offset=32, width=2)), [1, 5, 9])
|
|
2665
|
+
# A write query drops the read; LEA stays, since the use of the address it forms is unknown.
|
|
2666
|
+
r = report(code, "uses", query={"offset": 32, "width": 2, "access": "write"})
|
|
2667
|
+
self.assertEqual([c["site"] for c in r["rawCandidates"]], [5, 9])
|
|
2668
|
+
r = report(code, "uses", query={"offset": 32, "width": 2, "access": "read"})
|
|
2669
|
+
self.assertEqual([c["site"] for c in r["rawCandidates"]], [1, 9])
|
|
2670
|
+
|
|
2671
|
+
def test_raw_candidate_displacement_takes_the_instruction_address_size(self):
|
|
2672
|
+
# ret; then unreached: a32 mov [0x1001f],ax; a32 mov [31],ax; ret. In 16-bit code the 32-bit
|
|
2673
|
+
# displacement is not cut to 16 bits, so only the second store meets the field.
|
|
2674
|
+
rows = self.raw_footprints("c3 67 89 05 1f 00 01 00 67 89 05 1f 00 00 00 c3", offset=32, width=2)
|
|
2675
|
+
self.assertEqual(list(rows), [8])
|
|
2676
|
+
self.assertEqual([(o["displacement"], o["intersection"]) for o in rows[8]["operands"]], [(31, {"start": 32, "end": 33})])
|
|
2677
|
+
|
|
2678
|
+
def test_far_pointer_load_width_is_the_pcode_load_size(self):
|
|
2679
|
+
# memory_width corrects Capstone's word for LDS/LES/LSS/LFS/LGS; SLEIGH's LOAD gives the same size.
|
|
2680
|
+
cases = {False: ["c5 06 20 00", "c4 06 20 00", "0f b2 26 20 00", "0f b4 06 20 00", "0f b5 06 20 00",
|
|
2681
|
+
"66 c4 06 20 00", "66 0f b2 26 20 00"],
|
|
2682
|
+
True: ["c5 05 20 00 00 00", "0f b2 25 20 00 00 00", "66 0f b5 05 20 00 00 00"]}
|
|
2683
|
+
for flat, codes in cases.items():
|
|
2684
|
+
decoder = capstone.Cs(capstone.CS_ARCH_X86, capstone.CS_MODE_32 if flat else capstone.CS_MODE_16)
|
|
2685
|
+
decoder.detail = True
|
|
2686
|
+
context = pypcode.Context("x86:LE:32:default" if flat else "x86:LE:16:Real Mode")
|
|
2687
|
+
for text in codes:
|
|
2688
|
+
code = bytes.fromhex(text)
|
|
2689
|
+
ins = next(decoder.disasm(code, 0))
|
|
2690
|
+
loads = [o.output.size for o in context.translate(code, max_instructions=1).ops
|
|
2691
|
+
if o.opcode == pypcode.OpCode.LOAD]
|
|
2692
|
+
memory = [o for o in ins.operands if o.type == capstone.x86.X86_OP_MEM][0]
|
|
2693
|
+
self.assertEqual([reports.memory_width(ins, memory)], loads, text)
|
|
2694
|
+
|
|
2695
|
+
def test_raw_candidate_inside_a_verified_instruction_is_a_rejected_overlap(self):
|
|
2696
|
+
# mov ax,20a3h; add bl,al; ret. The bytes from 1 also decode as mov [32],ax.
|
|
2697
|
+
rows = self.raw_footprints("b8 a3 20 00 c3 c3", offset=32, width=2)
|
|
2698
|
+
self.assertEqual((rows[1]["boundary"], rows[1]["overlapsVerified"]),
|
|
2699
|
+
("rejectedOverlap", [{"site": 0, "end": 3}, {"site": 3, "end": 5}]))
|
|
2700
|
+
|
|
2596
2701
|
def test_linear_write_invalidates_alias_under_its_last_byte(self):
|
|
2597
2702
|
r = report("b8 00 20 8e c0 26 c6 07 55 c7 06 0f 00 34 12 26 8a 07 c3", registers={"ds": 0x1fff})
|
|
2598
2703
|
write = [e for e in events(r, "write") if e["width"] == 2][0]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/tests/test_effect_order.py
RENAMED
|
File without changes
|
{scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/tests/test_enter_frames.py
RENAMED
|
File without changes
|
{scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/tests/test_entry_frame.py
RENAMED
|
File without changes
|
|
File without changes
|
{scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/tests/test_interrupt_models.py
RENAMED
|
File without changes
|
{scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/tests/test_inventory_check.py
RENAMED
|
File without changes
|
{scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/tests/test_join_terms.py
RENAMED
|
File without changes
|
|
File without changes
|
{scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/tests/test_memory_scopes.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/tests/test_return_checks.py
RENAMED
|
File without changes
|
{scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/tests/test_successor_rule.py
RENAMED
|
File without changes
|
|
File without changes
|
{scientific_method_engine-16.0.0 → scientific_method_engine-17.0.0}/tests/test_term_limit.py
RENAMED
|
File without changes
|