@henols/c64-re-tools 1.0.0 → 2.0.0-rc.10
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.
- package/LICENSE +21 -0
- package/README.md +154 -37
- package/distribution/package.ts +21 -0
- package/distribution/plugin.ts +122 -0
- package/package.json +34 -40
- package/skills/c64-assembler/SKILL.md +76 -0
- package/skills/c64-assembler/scripts/assemble.ts +110 -0
- package/skills/c64-assembler/scripts/compare.ts +84 -0
- package/skills/c64-basic/SKILL.md +66 -0
- package/skills/c64-basic/scripts/basic.ts +46 -0
- package/skills/c64-disk/SKILL.md +93 -0
- package/skills/c64-disk/scripts/containers.ts +124 -0
- package/skills/c64-disk/scripts/disk.ts +120 -0
- package/skills/c64-emulator/SKILL.md +134 -0
- package/skills/c64-knowledge/SKILL.md +166 -0
- package/skills/c64-knowledge/scripts/knowledge.ts +492 -0
- package/skills/c64-memory-map/SKILL.md +79 -0
- package/skills/c64-memory-map/scripts/memmap.ts +92 -0
- package/skills/c64-provenance/SKILL.md +110 -0
- package/skills/c64-provenance/scripts/compare.ts +152 -0
- package/skills/c64-provenance/scripts/provenance.ts +334 -0
- package/skills/c64-provenance/scripts/runtime.ts +191 -0
- package/skills/c64-provenance/scripts/separate.ts +140 -0
- package/skills/c64-reverse-engineering/SKILL.md +144 -0
- package/skills/c64-source/SKILL.md +126 -0
- package/skills/c64-source/scripts/generate.ts +490 -0
- package/skills/c64-source/scripts/loader.ts +571 -0
- package/skills/c64-source/scripts/opcodes.ts +61 -0
- package/skills/c64-source/scripts/source.ts +595 -0
- package/skills/c64-static-analysis/SKILL.md +119 -0
- package/skills/c64-static-analysis/scripts/analyze.ts +275 -0
- package/skills/c64-static-analysis/scripts/coverage.ts +78 -0
- package/skills/c64-static-analysis/scripts/findings.ts +75 -0
- package/skills/c64-static-analysis/scripts/idioms.ts +149 -0
- package/skills/c64-static-analysis/scripts/instructions.ts +105 -0
- package/skills/c64-testing/SKILL.md +103 -0
- package/skills/c64-testing/references/scenario-format.md +116 -0
- package/skills/c64-testing/scripts/checklist.ts +51 -0
- package/skills/c64-testing/scripts/run.ts +189 -0
- package/skills/c64-testing/scripts/scenario.ts +493 -0
- package/skills/c64-testing/scripts/test.ts +65 -0
- package/skills/c64-unpacker/SKILL.md +135 -0
- package/skills/c64-unpacker/scripts/evidence.ts +207 -0
- package/skills/c64-unpacker/scripts/loads.ts +209 -0
- package/skills/c64-unpacker/scripts/machine.ts +80 -0
- package/skills/c64-unpacker/scripts/stages.ts +130 -0
- package/skills/c64-unpacker/scripts/unpack.ts +683 -0
- package/src/c64.ts +411 -0
- package/src/cli/ap-sdk.ts +44 -0
- package/src/cli/cleanup.ts +194 -0
- package/src/cli/main.ts +125 -0
- package/src/cli/status.ts +61 -0
- package/src/host/main.ts +134 -0
- package/src/host/server.ts +392 -0
- package/src/host/tools/c1541.ts +284 -0
- package/src/host/tools/index.ts +35 -0
- package/src/host/tools/petcat.ts +77 -0
- package/src/host/tools/status.ts +47 -0
- package/src/host/tools/version.ts +41 -0
- package/src/host/vice/adapter.ts +804 -0
- package/src/host/vice/binary-monitor.ts +389 -0
- package/src/host/vice/chips.ts +118 -0
- package/src/host/vice/connect.ts +34 -0
- package/src/host/vice/process.ts +413 -0
- package/src/host/vice/screen.ts +184 -0
- package/src/host/vice/session.ts +1426 -0
- package/src/host/vice/text-monitor.ts +223 -0
- package/src/host-client/autostart.ts +55 -0
- package/src/host-client/connect.ts +241 -0
- package/src/host-client/coverage.ts +63 -0
- package/src/host-client/steps.ts +170 -0
- package/src/host-client/tools.ts +89 -0
- package/src/host-client/transfer.ts +126 -0
- package/src/host-client/vice-session.ts +316 -0
- package/src/knowledge/database.ts +132 -0
- package/src/knowledge/history.ts +163 -0
- package/src/knowledge/import.ts +391 -0
- package/src/knowledge/read.ts +342 -0
- package/src/knowledge/schema.ts +229 -0
- package/src/knowledge/write.ts +663 -0
- package/src/mcp/main.ts +134 -0
- package/src/mcp/output.ts +32 -0
- package/src/mcp/server.ts +316 -0
- package/src/mcp/tools/debug.ts +327 -0
- package/src/mcp/tools/execution.ts +117 -0
- package/src/mcp/tools/input.ts +72 -0
- package/src/mcp/tools/machine.ts +100 -0
- package/src/mcp/tools/media.ts +129 -0
- package/src/mcp/tools/memory.ts +250 -0
- package/src/mcp/tools/video.ts +271 -0
- package/src/native/acme.ts +116 -0
- package/src/native/discover.ts +179 -0
- package/src/native/dxa.ts +166 -0
- package/src/native/ghidra/analyze.ts +86 -0
- package/src/native/ghidra/index.ts +173 -0
- package/src/native/ghidra/language/c64rt_6510.cspec +34 -0
- package/src/native/ghidra/language/c64rt_6510.ldefs +15 -0
- package/src/native/ghidra/language/c64rt_6510.pspec +15 -0
- package/src/native/ghidra/language/c64rt_6510.slaspec +596 -0
- package/src/native/ghidra/scripts/C64Export.java +274 -0
- package/src/native/ghidra/scripts/C64Prepare.java +60 -0
- package/src/native/local.ts +34 -0
- package/src/native/processes.ts +350 -0
- package/src/native/run.ts +172 -0
- package/src/native/staging.ts +83 -0
- package/src/native/status.ts +113 -0
- package/src/native/types.ts +257 -0
- package/src/native/watchdog.ts +78 -0
- package/src/package.ts +21 -0
- package/src/platform.ts +441 -0
- package/src/project.ts +39 -0
- package/src/protocol/framing.ts +132 -0
- package/src/protocol/messages.ts +259 -0
- package/src/protocol/tools.ts +266 -0
- package/src/protocol/vice.ts +1348 -0
- package/src/script.ts +60 -0
- package/src/time.ts +15 -0
- package/src/trace.ts +194 -0
- package/THIRD-PARTY-NOTICES.md +0 -26
- package/bin/cli.mjs +0 -283
- package/skills/acme-build/SKILL.md +0 -260
- package/skills/acme-build/scripts/acme.mjs +0 -341
- package/skills/acme-build/template.a +0 -53
- package/skills/c64-disk-access/SKILL.md +0 -159
- package/skills/c64-disk-access/scripts/c1541.mjs +0 -569
- package/skills/c64-memory-mapping/SKILL.md +0 -631
- package/skills/c64-memory-mapping/memmap.json +0 -8800
- package/skills/c64-memory-mapping/scripts/driver.mjs +0 -553
- package/skills/c64-petcat/SKILL.md +0 -87
- package/skills/c64-petcat/scripts/petcat.mjs +0 -221
- package/skills/c64-program-recon/SKILL.md +0 -706
- package/skills/c64-program-recon/references/control-flow.md +0 -180
- package/skills/c64-program-recon/references/graphics.md +0 -79
- package/skills/c64-program-recon/references/observation-hazards.md +0 -143
- package/skills/c64-program-recon/references/reconstruction.md +0 -133
- package/skills/c64-program-recon/references/sound-and-input.md +0 -74
- package/skills/c64-program-recon/references/tool-selection.md +0 -78
- package/skills/c64-program-recon/scripts/derive.mjs +0 -364
- package/skills/c64-program-recon/scripts/packer-finding.mjs +0 -709
- package/skills/c64-program-recon/templates/memory-map.template.md +0 -101
- package/skills/c64-provenance-diff/SKILL.md +0 -292
- package/skills/c64-provenance-diff/scripts/diff-images.mjs +0 -984
- package/skills/c64-provenance-diff/scripts/recovery-schema.mjs +0 -395
- package/skills/c64-ram-capture/RELEASES.json.example +0 -17
- package/skills/c64-ram-capture/SKILL.md +0 -474
- package/skills/c64-ram-capture/scripts/compare-cross-binary.mjs +0 -525
- package/skills/c64-ram-capture/scripts/compare.mjs +0 -258
- package/skills/c64-ram-capture/scripts/derive-transients.mjs +0 -575
- package/skills/c64-ram-capture/scripts/dump-artifacts.mjs +0 -317
- package/skills/c64-ram-capture/scripts/mcp-module.mjs +0 -174
- package/skills/c64-ram-capture/scripts/project-paths.mjs +0 -81
- package/skills/c64-ram-capture/scripts/releases.mjs +0 -109
- package/skills/c64-ram-capture/scripts/vsf-slice.mjs +0 -147
- package/skills/c64-ram-capture/scripts/watch-loads.mjs +0 -581
- package/skills/c64-ram-capture/templates/capture-record.template.md +0 -99
- package/skills/c64-ram-capture/transients/README.md +0 -137
- package/skills/routine-queue-walker/SKILL.md +0 -394
- package/skills/routine-queue-walker/scripts/completeness-report.mjs +0 -465
- package/skills/vice-wedge-triage/SKILL.md +0 -269
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: c64-disk-access
|
|
3
|
-
description: Read a Commodore .d64 disk image's directory, block allocation map, a named file's sector chain, or a named file's raw bytes, using VICE's own c1541 disk tool as the reference implementation, and audit its directory for fabricated or corrupted entries. Use when asked to list what a disk image contains, check a disk's free blocks or block allocation map, trace which sectors a named file occupies on disk, extract a named file's raw bytes from a .d64, or check whether a disk's directory entries are genuine (a cracker-fabricated filename, a corrupted first track/sector, or a cyclic directory chain).
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Reading C64 disk images with c1541
|
|
7
|
-
|
|
8
|
-
Read-only. Six capabilities, one script, one binary (`c1541`) reached only
|
|
9
|
-
through the host-tool execution seam:
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
S=src/skills/c64-disk-access/scripts/c1541.mjs # from the repo root
|
|
13
|
-
|
|
14
|
-
node $S bam --image path/to/image.d64 # block allocation map
|
|
15
|
-
node $S dir --image path/to/image.d64 # what's on the disk
|
|
16
|
-
node $S entry --image path/to/image.d64 --name FILENAME # one directory entry's raw fields
|
|
17
|
-
node $S chain --image path/to/image.d64 --name FILENAME # a named file's sector chain
|
|
18
|
-
node $S read --image path/to/image.d64 --name FILENAME # extract a named file's bytes
|
|
19
|
-
node $S audit --image path/to/image.d64 # find fabricated/corrupted directory entries
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
The script wraps `c1541` and nothing else — **read-only**. `bam`/`dir`/`audit`
|
|
23
|
-
need only `--image`. `entry`/`chain`/`read` also need `--name`, a CBM
|
|
24
|
-
filename or glob pattern (never a path). No `-format`, `-write`, `-bwrite`
|
|
25
|
-
or `-delete` verb is reachable from here, deliberately: this skill only
|
|
26
|
-
ever reads a disk image, never mutates one.
|
|
27
|
-
|
|
28
|
-
Options: `--image PATH` `--name CBM-NAME` `--out-dir DIR` `--json`.
|
|
29
|
-
|
|
30
|
-
`--out-dir` defaults to the image's own directory, exactly like
|
|
31
|
-
`acme-build`'s own `--out-dir` default. Both `--image` and `--out-dir` are
|
|
32
|
-
resolved **workspace-relative** to the smallest ancestor directory
|
|
33
|
-
containing both, before the request reaches the seam. This is the same
|
|
34
|
-
resolution `acme-build`'s `source`/`--out-dir` already go through. The seam
|
|
35
|
-
passes `--name` straight through and never resolves it as a path. The seam
|
|
36
|
-
refuses a value beginning with `-` before it spawns any child process.
|
|
37
|
-
Otherwise `c1541`'s own CLI would read it as a flag.
|
|
38
|
-
|
|
39
|
-
## Directory listing
|
|
40
|
-
|
|
41
|
-
```bash
|
|
42
|
-
node $S dir --image game.d64 --json
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
Prints the seam's response verbatim as one line of JSON:
|
|
46
|
-
|
|
47
|
-
```json
|
|
48
|
-
{"ok":true,"tool":"c1541.dir","exitStatus":0,"results":[{"path":"/abs/path/game.dir.txt","sha256":"...","byteLength":123}],"stderrTail":""}
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
`results[0].path` names the listing file the seam wrote — `c1541`'s own
|
|
52
|
-
`-dir` output, captured and digested.
|
|
53
|
-
|
|
54
|
-
## Block allocation map
|
|
55
|
-
|
|
56
|
-
```bash
|
|
57
|
-
node $S bam --image game.d64 --json
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
Same response shape as `dir`. `results[0].path` names a file carrying one
|
|
61
|
-
per-sector allocation row per track. Each row is a run of `*`/`.`
|
|
62
|
-
characters, `*` for an allocated sector.
|
|
63
|
-
|
|
64
|
-
## One directory entry's raw fields
|
|
65
|
-
|
|
66
|
-
```bash
|
|
67
|
-
node $S entry --image game.d64 --name FILENAME --json
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
`results[0].path` names a file carrying the entry's raw 32-byte directory
|
|
71
|
-
record (as a hex dump). A `T/S: <t>/<s>, <n> blocks` summary line follows
|
|
72
|
-
the record. This script also parses that line back and adds
|
|
73
|
-
`firstTrack`/`firstSector` as numeric fields on the JSON response. These
|
|
74
|
-
fields exist purely to show the values — the file itself is still the
|
|
75
|
-
authoritative source.
|
|
76
|
-
|
|
77
|
-
## A named file's sector chain
|
|
78
|
-
|
|
79
|
-
```bash
|
|
80
|
-
node $S chain --image game.d64 --name FILENAME --json
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
`results[0].path` names a file listing every `(track,sector)` hop the file
|
|
84
|
-
occupies, in order. A single-sector file's chain shows one hop with no
|
|
85
|
-
second tuple on the arrow's right side. A multi-sector file's chain repeats
|
|
86
|
-
the tuple at every hop.
|
|
87
|
-
|
|
88
|
-
## Extracting a named file's bytes
|
|
89
|
-
|
|
90
|
-
```bash
|
|
91
|
-
node $S read --image game.d64 --name FILENAME --out-dir /scratch --json
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
Writes the file's raw bytes. Unlike the other four capabilities, this one
|
|
95
|
-
is NOT a captured-stdout listing — `c1541` writes the output file itself.
|
|
96
|
-
`results[0]` carries that file's `path`/`sha256`/`byteLength`.
|
|
97
|
-
|
|
98
|
-
## Auditing for fabricated or corrupted entries
|
|
99
|
-
|
|
100
|
-
```bash
|
|
101
|
-
node $S audit --image game.d64 --json
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
The `audit` command composes `dir` (names and block counts) and `bam` (the
|
|
105
|
-
per-sector allocation map). For each name, it also makes one `entry` call
|
|
106
|
-
to get that file's own claimed first track/sector and its directory
|
|
107
|
-
sector's "next directory" pointer. Together these calls form a ported,
|
|
108
|
-
read-only detector — no `-format`/`-write`/mutating verb, and no seventh
|
|
109
|
-
`host_tool` id. This is three existing capabilities composed client-side.
|
|
110
|
-
|
|
111
|
-
The `audit` command flags a directory entry `suspicious`, with **named
|
|
112
|
-
reasons, never a bare boolean**, on any of:
|
|
113
|
-
|
|
114
|
-
1. its block count is `0`.
|
|
115
|
-
2. its first track/sector lies outside the image's own geometry. There is
|
|
116
|
-
no such track, or no such sector on that track.
|
|
117
|
-
3. the allocation map reports its first **sector** — not merely its whole
|
|
118
|
-
track — free, meaning the file cannot really start there. This is
|
|
119
|
-
sharper than checking only whether the whole track is free, because the
|
|
120
|
-
per-sector map is available.
|
|
121
|
-
|
|
122
|
-
A directory chain is cyclic or self-referential when two entries claim the
|
|
123
|
-
same first track/sector. It is also cyclic or self-referential when a
|
|
124
|
-
"next directory" pointer refers back to a sector already seen, including
|
|
125
|
-
the directory's own starting sector. When this happens, the command stops
|
|
126
|
-
treating the repeat as new information. Instead of looping, it reports a
|
|
127
|
-
top-level `chain_error` naming the repeated pointer. Every remaining entry
|
|
128
|
-
is still audited afterward — a chain error on one entry never hides another
|
|
129
|
-
entry's own independent flag.
|
|
130
|
-
|
|
131
|
-
```json
|
|
132
|
-
{"entries":[{"name":"basicstub","blocks":1,"first_track":17,"first_sector":0,"suspicious":false,"suspicious_reasons":[]}],"chain_error":null}
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
**A flag is a signal to investigate, not a verdict.** A directory entry a
|
|
136
|
-
cracker fabricated for a file never actually written, a genuinely
|
|
137
|
-
corrupted image, and (rarely) an unusual-but-legitimate disk layout can
|
|
138
|
-
all produce a flag. This command reports what it finds, named, and leaves
|
|
139
|
-
the interpretation to whoever is looking at the disk.
|
|
140
|
-
|
|
141
|
-
## Failure shape
|
|
142
|
-
|
|
143
|
-
The seam reports a nonexistent image, a nonexistent named entry, or any
|
|
144
|
-
other call `c1541` cannot service as `{"ok":false,"message":"..."}` with a
|
|
145
|
-
non-zero exit code. This is **never** a success envelope over an empty or
|
|
146
|
-
partial result. `c1541` itself exits `0` even on a genuine failure (it
|
|
147
|
-
prints its own `Error - ...` lines to stdout instead). The seam's own
|
|
148
|
-
classifier, not the exit code, is what decides success here.
|
|
149
|
-
|
|
150
|
-
## What this skill does NOT do
|
|
151
|
-
|
|
152
|
-
- **No mutating verb.** `-format`/`-write`/`-bwrite`/`-delete` are never
|
|
153
|
-
reachable from this script, on the wire, or anywhere in this skill's tree
|
|
154
|
-
— this skill exposes only the six read-only capabilities above.
|
|
155
|
-
- **No direct binary spawn.** `c1541` runs host-side. This script only ever
|
|
156
|
-
constructs a typed request and reads the produced files back off the
|
|
157
|
-
shared workspace tree — the host-tool execution seam is the only route.
|
|
158
|
-
- **No emulator dependency.** This skill names no VICE emulator tool at
|
|
159
|
-
all — it works entirely on files, never on a running machine, by construction.
|