scientific-method-engine 13.5.0__tar.gz → 13.6.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-13.5.0 → scientific_method_engine-13.6.0}/PKG-INFO +2 -2
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/README.md +1 -1
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/pyproject.toml +1 -1
- scientific_method_engine-13.6.0/src/scientific_method_engine/ghidra/ReportInstructionWindow.java +122 -0
- scientific_method_engine-13.5.0/src/scientific_method_engine/ghidra/ReportInstructionWindow.java +0 -71
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/.gitignore +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/LICENSE +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/src/scientific_method_engine/__init__.py +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/src/scientific_method_engine/__main__.py +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/src/scientific_method_engine/cli.py +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/src/scientific_method_engine/ghidra/ClearNoReturnFunctions.java +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/src/scientific_method_engine/ghidra/CreateFunctions.java +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/src/scientific_method_engine/ghidra/ExportBoundedFlow.java +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/src/scientific_method_engine/ghidra/ExportCallEdges.java +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/src/scientific_method_engine/ghidra/ExportFunctionFingerprints.java +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/src/scientific_method_engine/ghidra/ExportFunctionInventory.java +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/src/scientific_method_engine/ghidra/MergeFallThroughFragment.java +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/src/scientific_method_engine/ghidra/RecoverCitedFunctions.java +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/src/scientific_method_engine/ghidra/RepairReturningCallers.java +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/src/scientific_method_engine/ghidra/ReportCallArguments.java +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/src/scientific_method_engine/ghidra/ReportCallPaths.java +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/src/scientific_method_engine/ghidra/ReportCallSitesWithScalars.java +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/src/scientific_method_engine/ghidra/ReportCallsToRange.java +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/src/scientific_method_engine/ghidra/ReportConstantFirstArgumentCalls.java +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/src/scientific_method_engine/ghidra/ReportDataBytes.java +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/src/scientific_method_engine/ghidra/ReportDecompileMatches.java +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/src/scientific_method_engine/ghidra/ReportDecompileWindow.java +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/src/scientific_method_engine/ghidra/ReportFilePatternInMemory.java +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/src/scientific_method_engine/ghidra/ReportFirstArgumentCallSummary.java +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/src/scientific_method_engine/ghidra/ReportFunctionScalarConstants.java +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/src/scientific_method_engine/ghidra/ReportFunctionSummary.java +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/src/scientific_method_engine/ghidra/ReportInstructionContext.java +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/src/scientific_method_engine/ghidra/ReportMemoryBlockForFileOffset.java +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/src/scientific_method_engine/ghidra/ReportMemoryBlocks.java +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/src/scientific_method_engine/ghidra/ReportRandomnessCandidates.java +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/src/scientific_method_engine/ghidra/ReportReferences.java +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/src/scientific_method_engine/ghidra/ReportScalarConstants.java +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/src/scientific_method_engine/ghidra/ReportStringReferences.java +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/src/scientific_method_engine/ghidra/ReportSymbolReferences.java +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/src/scientific_method_engine/ghidra/scientificmethod/FirstArgumentLookBack.java +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/src/scientific_method_engine/ghidra/scientificmethod/InstructionStart.java +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/src/scientific_method_engine/ghidra/scientificmethod/OperandConstants.java +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/src/scientific_method_engine/x86/__init__.py +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/src/scientific_method_engine/x86/argument_frames.py +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/src/scientific_method_engine/x86/dispatch.py +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/src/scientific_method_engine/x86/effect_order.py +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/src/scientific_method_engine/x86/image.py +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/src/scientific_method_engine/x86/inventory.py +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/src/scientific_method_engine/x86/loops.py +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/src/scientific_method_engine/x86/machine.py +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/src/scientific_method_engine/x86/memory_scopes.py +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/src/scientific_method_engine/x86/pcode.py +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/src/scientific_method_engine/x86/pcode_backend.py +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/src/scientific_method_engine/x86/pe.py +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/src/scientific_method_engine/x86/reach.py +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/src/scientific_method_engine/x86/relational.py +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/src/scientific_method_engine/x86/reports.py +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/src/scientific_method_engine/x86/result_flow.py +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/src/scientific_method_engine/x86/trace.py +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/src/scientific_method_engine/x86/values.py +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/tests/oracle.py +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/tests/test_continuation_budget.py +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/tests/test_dispatch.py +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/tests/test_effect_order.py +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/tests/test_enter_frames.py +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/tests/test_entry_frame.py +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/tests/test_indirect_far_transfers.py +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/tests/test_interrupt_models.py +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/tests/test_inventory_check.py +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/tests/test_loops.py +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/tests/test_memory_scopes.py +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/tests/test_nested_frame_request.py +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/tests/test_oracle.py +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/tests/test_pe.py +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/tests/test_reach.py +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/tests/test_relational_controls.py +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/tests/test_return_checks.py +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/tests/test_successor_rule.py +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/tests/test_table_continuations.py +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/tests/test_term_limit.py +0 -0
- {scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/tests/test_x86.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: scientific-method-engine
|
|
3
|
-
Version: 13.
|
|
3
|
+
Version: 13.6.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
|
|
@@ -60,7 +60,7 @@ Reading code and data:
|
|
|
60
60
|
| Script | Arguments | Prints |
|
|
61
61
|
|---|---|---|
|
|
62
62
|
| `ReportInstructionContext` | one or more instruction addresses | a bounded instruction window around the instruction containing each address; the header names the requested address when it is inside that instruction |
|
|
63
|
-
| `ReportInstructionWindow` | address where an instruction starts, instruction count (1..200) | a header, the instructions from the address onward with a `gap:` line wherever the listing skips bytes, then the count printed or where the listing ended. An address inside an instruction, in data, in undisassembled bytes or outside memory prints an error naming what is there and the next instruction start, and no window |
|
|
63
|
+
| `ReportInstructionWindow` | address where an instruction starts, instruction count (1..200) | a header, the instructions from the address onward with a `gap:` line wherever the listing skips bytes, a `span:` line for each run of instructions with no gap (its half-open range ending after the last instruction's final byte, byte count, last byte and instruction count, or that it reaches the end of its address space and has no exclusive end; the next instruction's start when the count closed the span and the run goes on; each instruction whose length the listing overrides, with the bytes it decodes), then the count printed or where the listing ended. An address inside an instruction, in data, in undisassembled bytes or outside memory prints an error naming what is there and the next instruction start, and no window |
|
|
64
64
|
| `ReportDataBytes` | address, byte count (1..256) | the bytes at the address |
|
|
65
65
|
| `ReportFunctionSummary` | one or more addresses | focused decompiler output of each containing function, its body ranges and each call without a fall-through (a sign of a wrong no-return flag), then the addresses with no function or a failed decompile |
|
|
66
66
|
| `ReportDecompileWindow` | address, first line (1-based), line count (a count above 160 is cut to 160) | a window of one function's decompilation, its total line count and where the next window starts |
|
|
@@ -44,7 +44,7 @@ Reading code and data:
|
|
|
44
44
|
| Script | Arguments | Prints |
|
|
45
45
|
|---|---|---|
|
|
46
46
|
| `ReportInstructionContext` | one or more instruction addresses | a bounded instruction window around the instruction containing each address; the header names the requested address when it is inside that instruction |
|
|
47
|
-
| `ReportInstructionWindow` | address where an instruction starts, instruction count (1..200) | a header, the instructions from the address onward with a `gap:` line wherever the listing skips bytes, then the count printed or where the listing ended. An address inside an instruction, in data, in undisassembled bytes or outside memory prints an error naming what is there and the next instruction start, and no window |
|
|
47
|
+
| `ReportInstructionWindow` | address where an instruction starts, instruction count (1..200) | a header, the instructions from the address onward with a `gap:` line wherever the listing skips bytes, a `span:` line for each run of instructions with no gap (its half-open range ending after the last instruction's final byte, byte count, last byte and instruction count, or that it reaches the end of its address space and has no exclusive end; the next instruction's start when the count closed the span and the run goes on; each instruction whose length the listing overrides, with the bytes it decodes), then the count printed or where the listing ended. An address inside an instruction, in data, in undisassembled bytes or outside memory prints an error naming what is there and the next instruction start, and no window |
|
|
48
48
|
| `ReportDataBytes` | address, byte count (1..256) | the bytes at the address |
|
|
49
49
|
| `ReportFunctionSummary` | one or more addresses | focused decompiler output of each containing function, its body ranges and each call without a fall-through (a sign of a wrong no-return flag), then the addresses with no function or a failed decompile |
|
|
50
50
|
| `ReportDecompileWindow` | address, first line (1-based), line count (a count above 160 is cut to 160) | a window of one function's decompilation, its total line count and where the next window starts |
|
|
@@ -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 = "13.
|
|
8
|
+
version = "13.6.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"
|
scientific_method_engine-13.6.0/src/scientific_method_engine/ghidra/ReportInstructionWindow.java
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
// Prints a bounded instruction window that begins at an instruction start.
|
|
2
|
+
// @category Restoration
|
|
3
|
+
|
|
4
|
+
import java.util.ArrayList;
|
|
5
|
+
import java.util.List;
|
|
6
|
+
|
|
7
|
+
import ghidra.app.script.GhidraScript;
|
|
8
|
+
import ghidra.program.model.address.Address;
|
|
9
|
+
import ghidra.program.model.listing.Instruction;
|
|
10
|
+
|
|
11
|
+
import scientificmethod.InstructionStart;
|
|
12
|
+
|
|
13
|
+
public class ReportInstructionWindow extends GhidraScript {
|
|
14
|
+
private static final int MAX_INSTRUCTIONS = 200;
|
|
15
|
+
|
|
16
|
+
@Override
|
|
17
|
+
protected void run() throws Exception {
|
|
18
|
+
String[] arguments = getScriptArgs();
|
|
19
|
+
if (arguments.length != 2) {
|
|
20
|
+
printerr("Supply a virtual address and instruction count.");
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
Address address = toAddr(arguments[0]);
|
|
25
|
+
if (address == null) {
|
|
26
|
+
printerr(arguments[0] + ": not an address in this program");
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
int count;
|
|
30
|
+
try {
|
|
31
|
+
count = Integer.parseInt(arguments[1]);
|
|
32
|
+
} catch (NumberFormatException exception) {
|
|
33
|
+
count = 0;
|
|
34
|
+
}
|
|
35
|
+
if (count < 1 || count > MAX_INSTRUCTIONS) {
|
|
36
|
+
printerr("Instruction count must be between 1 and " + MAX_INSTRUCTIONS + ".");
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// The window starts only where an instruction starts. Starting at the next instruction
|
|
41
|
+
// instead would print a window that looks like the requested one but is not.
|
|
42
|
+
String missing = InstructionStart.missingStart(currentProgram, address);
|
|
43
|
+
if (missing != null) {
|
|
44
|
+
printerr(missing + " No window printed.");
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
println("===== up to " + count + " instructions from " + address + " =====");
|
|
49
|
+
Instruction instruction = currentProgram.getListing().getInstructionAt(address);
|
|
50
|
+
int printed = 0;
|
|
51
|
+
// Each run of printed instructions with no gap between them, closed at a gap and at the
|
|
52
|
+
// window's last instruction.
|
|
53
|
+
List<String> spans = new ArrayList<>();
|
|
54
|
+
Address spanStart = null;
|
|
55
|
+
int spanInstructions = 0;
|
|
56
|
+
// The instructions in the current span whose listed length the listing overrides.
|
|
57
|
+
List<String> overrides = new ArrayList<>();
|
|
58
|
+
while (instruction != null && printed < count) {
|
|
59
|
+
if (spanStart == null) {
|
|
60
|
+
spanStart = instruction.getAddress();
|
|
61
|
+
}
|
|
62
|
+
println(instruction.getAddress() + ": " + instruction);
|
|
63
|
+
printed++;
|
|
64
|
+
spanInstructions++;
|
|
65
|
+
if (instruction.isLengthOverridden()) {
|
|
66
|
+
overrides.add(instruction.getAddress() + " (listed as " + instruction.getLength() + " of the "
|
|
67
|
+
+ instruction.getParsedLength() + " bytes it decodes)");
|
|
68
|
+
}
|
|
69
|
+
Instruction next = instruction.getNext();
|
|
70
|
+
// Address.next() is null when the instruction ends its address space, so a gap is
|
|
71
|
+
// measured from the instruction's last byte, and such a span has no exclusive end.
|
|
72
|
+
Address last = instruction.getMaxAddress();
|
|
73
|
+
Address end = last.next();
|
|
74
|
+
boolean adjacent = end != null && next != null && next.getAddress().equals(end);
|
|
75
|
+
if (printed == count || !adjacent) {
|
|
76
|
+
spans.add(span(spanStart, last, end, spanInstructions, overrides, adjacent));
|
|
77
|
+
spanStart = null;
|
|
78
|
+
spanInstructions = 0;
|
|
79
|
+
overrides.clear();
|
|
80
|
+
if (printed < count && next != null) {
|
|
81
|
+
if (end == null) {
|
|
82
|
+
println("gap: no instruction after " + last + " up to " + next.getAddress());
|
|
83
|
+
} else {
|
|
84
|
+
println("gap: no instruction from " + end + " up to " + next.getAddress());
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
instruction = next;
|
|
89
|
+
}
|
|
90
|
+
for (String line : spans) {
|
|
91
|
+
println(line);
|
|
92
|
+
}
|
|
93
|
+
if (printed < count) {
|
|
94
|
+
println("The listing ends after " + printed + " of " + count + " instructions.");
|
|
95
|
+
} else {
|
|
96
|
+
println("Printed " + printed + " instructions.");
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// A span as a half-open range with its last byte, so a range copied from it ends after the
|
|
101
|
+
// final byte of its last instruction. Past the end of an address space no address can end it.
|
|
102
|
+
// A span the window's count closed says when the next instruction starts at its end, since
|
|
103
|
+
// the run goes on past the window. An instruction whose length the listing overrides decodes
|
|
104
|
+
// bytes past where the next instruction or the span ends, so the span names it.
|
|
105
|
+
private static String span(Address first, Address last, Address end, int instructions,
|
|
106
|
+
List<String> overrides, boolean continues) {
|
|
107
|
+
long bytes = last.subtract(first) + 1;
|
|
108
|
+
String range = end == null ? first + " to the end of its address space" : first + ".." + end;
|
|
109
|
+
StringBuilder line = new StringBuilder("span: " + range + " (" + bytes + (bytes == 1 ? " byte" : " bytes") + ", last byte " + last
|
|
110
|
+
+ ", " + instructions + (instructions == 1 ? " instruction)" : " instructions)"));
|
|
111
|
+
if (end == null) {
|
|
112
|
+
line.append("; no address follows its last byte, so it has no exclusive end");
|
|
113
|
+
}
|
|
114
|
+
if (continues) {
|
|
115
|
+
line.append("; the window stops here and the next instruction starts at ").append(end);
|
|
116
|
+
}
|
|
117
|
+
for (String override : overrides) {
|
|
118
|
+
line.append("; the listing overrides the length of the instruction at ").append(override);
|
|
119
|
+
}
|
|
120
|
+
return line.toString();
|
|
121
|
+
}
|
|
122
|
+
}
|
scientific_method_engine-13.5.0/src/scientific_method_engine/ghidra/ReportInstructionWindow.java
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
// Prints a bounded instruction window that begins at an instruction start.
|
|
2
|
-
// @category Restoration
|
|
3
|
-
|
|
4
|
-
import ghidra.app.script.GhidraScript;
|
|
5
|
-
import ghidra.program.model.address.Address;
|
|
6
|
-
import ghidra.program.model.listing.Instruction;
|
|
7
|
-
|
|
8
|
-
import scientificmethod.InstructionStart;
|
|
9
|
-
|
|
10
|
-
public class ReportInstructionWindow extends GhidraScript {
|
|
11
|
-
private static final int MAX_INSTRUCTIONS = 200;
|
|
12
|
-
|
|
13
|
-
@Override
|
|
14
|
-
protected void run() throws Exception {
|
|
15
|
-
String[] arguments = getScriptArgs();
|
|
16
|
-
if (arguments.length != 2) {
|
|
17
|
-
printerr("Supply a virtual address and instruction count.");
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
Address address = toAddr(arguments[0]);
|
|
22
|
-
if (address == null) {
|
|
23
|
-
printerr(arguments[0] + ": not an address in this program");
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
int count;
|
|
27
|
-
try {
|
|
28
|
-
count = Integer.parseInt(arguments[1]);
|
|
29
|
-
} catch (NumberFormatException exception) {
|
|
30
|
-
count = 0;
|
|
31
|
-
}
|
|
32
|
-
if (count < 1 || count > MAX_INSTRUCTIONS) {
|
|
33
|
-
printerr("Instruction count must be between 1 and " + MAX_INSTRUCTIONS + ".");
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// The window starts only where an instruction starts. Starting at the next instruction
|
|
38
|
-
// instead would print a window that looks like the requested one but is not.
|
|
39
|
-
String missing = InstructionStart.missingStart(currentProgram, address);
|
|
40
|
-
if (missing != null) {
|
|
41
|
-
printerr(missing + " No window printed.");
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
println("===== up to " + count + " instructions from " + address + " =====");
|
|
46
|
-
Instruction instruction = currentProgram.getListing().getInstructionAt(address);
|
|
47
|
-
int printed = 0;
|
|
48
|
-
while (instruction != null && printed < count) {
|
|
49
|
-
println(instruction.getAddress() + ": " + instruction);
|
|
50
|
-
printed++;
|
|
51
|
-
Instruction next = instruction.getNext();
|
|
52
|
-
if (printed < count && next != null) {
|
|
53
|
-
// next() is null when the instruction ends its address space, so the gap is
|
|
54
|
-
// measured from the instruction's last byte.
|
|
55
|
-
Address last = instruction.getMaxAddress();
|
|
56
|
-
Address end = last.next();
|
|
57
|
-
if (end == null) {
|
|
58
|
-
println("gap: no instruction after " + last + " up to " + next.getAddress());
|
|
59
|
-
} else if (!next.getAddress().equals(end)) {
|
|
60
|
-
println("gap: no instruction from " + end + " up to " + next.getAddress());
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
instruction = next;
|
|
64
|
-
}
|
|
65
|
-
if (printed < count) {
|
|
66
|
-
println("The listing ends after " + printed + " of " + count + " instructions.");
|
|
67
|
-
} else {
|
|
68
|
-
println("Printed " + printed + " instructions.");
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
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
|
|
File without changes
|
|
File without changes
|
{scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/tests/test_effect_order.py
RENAMED
|
File without changes
|
{scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/tests/test_enter_frames.py
RENAMED
|
File without changes
|
{scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/tests/test_entry_frame.py
RENAMED
|
File without changes
|
|
File without changes
|
{scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/tests/test_interrupt_models.py
RENAMED
|
File without changes
|
{scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/tests/test_inventory_check.py
RENAMED
|
File without changes
|
|
File without changes
|
{scientific_method_engine-13.5.0 → scientific_method_engine-13.6.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-13.5.0 → scientific_method_engine-13.6.0}/tests/test_return_checks.py
RENAMED
|
File without changes
|
{scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/tests/test_successor_rule.py
RENAMED
|
File without changes
|
|
File without changes
|
{scientific_method_engine-13.5.0 → scientific_method_engine-13.6.0}/tests/test_term_limit.py
RENAMED
|
File without changes
|
|
File without changes
|