@eyeauras/insight-cli 0.5.5 → 0.5.7
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/.cli-package-build.json +1 -1
- package/SKILL.md +1 -1
- package/dist/src/cli.js +4 -0
- package/dist/src/contexts.js +34 -2
- package/dist/src/initial-model.d.ts +3 -2
- package/dist/src/initial-model.js +23 -15
- package/dist/src/initial-progress.js +15 -5
- package/dist/src/server.d.ts +1 -0
- package/dist/src/server.js +5 -2
- package/package.json +1 -1
- package/references/native/InsightImportProgress.java +15 -2
- package/references/native/InsightInitialImport.java +2 -2
- package/references/native/InsightInitialJournal.java +9 -0
- package/references/native/InsightInitialPublication.java +1 -1
- package/references/native/InsightInitialRecovery.java +131 -0
- package/references/recovery.md +13 -1
- package/skill-bundle/insight-artifacts/SKILL.md +1 -1
- package/skill-bundle/insight-artifacts/references/recovery.md +13 -1
- package/skill-bundle/insight-binary/SKILL.md +1 -1
- package/skill-bundle/insight-capture/SKILL.md +1 -1
- package/skill-bundle/insight-cli/SKILL.md +1 -1
- package/skill-bundle/insight-cli/references/recovery.md +13 -1
- package/skill-bundle/insight-die/SKILL.md +1 -1
- package/skill-bundle/insight-dnspy/SKILL.md +1 -1
- package/skill-bundle/insight-dotnet-dump/SKILL.md +1 -1
- package/skill-bundle/insight-dotnet-stack/SKILL.md +1 -1
- package/skill-bundle/insight-dotnet-trace/SKILL.md +1 -1
- package/skill-bundle/insight-frida/SKILL.md +1 -1
- package/skill-bundle/insight-ghidra/SKILL.md +1 -1
- package/skill-bundle/insight-ghidra/references/recovery.md +13 -1
- package/skill-bundle/insight-ilspy/SKILL.md +1 -1
- package/skill-bundle/insight-interop/SKILL.md +1 -1
- package/skill-bundle/insight-lldb/SKILL.md +1 -1
- package/skill-bundle/insight-llvm/SKILL.md +1 -1
- package/skill-bundle/insight-managed-heap/SKILL.md +1 -1
- package/skill-bundle/insight-managed-metadata/SKILL.md +1 -1
- package/skill-bundle/insight-mitmproxy/SKILL.md +1 -1
- package/skill-bundle/insight-overview/SKILL.md +1 -1
- package/skill-bundle/insight-procmon/SKILL.md +1 -1
- package/skill-bundle/insight-re/SKILL.md +1 -1
- package/skill-bundle/insight-re/references/recovery.md +13 -1
- package/skill-bundle/insight-sevenzip/SKILL.md +1 -1
- package/skill-bundle/insight-strace/SKILL.md +1 -1
- package/skill-bundle/insight-tshark/SKILL.md +1 -1
- package/skill-bundle/insight-windbg/SKILL.md +1 -1
- package/skill-bundle/manifest.json +1 -1
- package/skills/insight-artifacts/SKILL.md +1 -1
- package/skills/insight-artifacts/references/recovery.md +13 -1
- package/skills/insight-binary/SKILL.md +1 -1
- package/skills/insight-capture/SKILL.md +1 -1
- package/skills/insight-die/SKILL.md +1 -1
- package/skills/insight-dnspy/SKILL.md +1 -1
- package/skills/insight-dotnet-dump/SKILL.md +1 -1
- package/skills/insight-dotnet-stack/SKILL.md +1 -1
- package/skills/insight-dotnet-trace/SKILL.md +1 -1
- package/skills/insight-frida/SKILL.md +1 -1
- package/skills/insight-ghidra/SKILL.md +1 -1
- package/skills/insight-ghidra/references/recovery.md +13 -1
- package/skills/insight-ilspy/SKILL.md +1 -1
- package/skills/insight-interop/SKILL.md +1 -1
- package/skills/insight-lldb/SKILL.md +1 -1
- package/skills/insight-llvm/SKILL.md +1 -1
- package/skills/insight-managed-heap/SKILL.md +1 -1
- package/skills/insight-managed-metadata/SKILL.md +1 -1
- package/skills/insight-mitmproxy/SKILL.md +1 -1
- package/skills/insight-overview/SKILL.md +1 -1
- package/skills/insight-procmon/SKILL.md +1 -1
- package/skills/insight-re/SKILL.md +1 -1
- package/skills/insight-re/references/recovery.md +13 -1
- package/skills/insight-sevenzip/SKILL.md +1 -1
- package/skills/insight-strace/SKILL.md +1 -1
- package/skills/insight-tshark/SKILL.md +1 -1
- package/skills/insight-windbg/SKILL.md +1 -1
package/.cli-package-build.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":1,"artifact":"
|
|
1
|
+
{"version":1,"artifact":"e77840a74e349bcf70a3aeb2064a90849b65676a86c24364eadd0738e1e6d82a"}
|
package/SKILL.md
CHANGED
|
@@ -3,7 +3,7 @@ name: insight-cli
|
|
|
3
3
|
description: Choose and prepare reverse-engineering capabilities from the insight-cli toolbox for binary, managed-code and runtime investigations. Use to discover the appropriate tool or its packaged skill before installing native runtimes.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# insight-cli 0.5.
|
|
6
|
+
# insight-cli 0.5.7
|
|
7
7
|
|
|
8
8
|
If local help/status reports AppData or IPC access denied, retry that **read-only probe**
|
|
9
9
|
with the agent host's normal permission escalation, then use that route for later authorized
|
package/dist/src/cli.js
CHANGED
|
@@ -247,6 +247,10 @@ function scopedFailures(entry, owner, parents = []) {
|
|
|
247
247
|
catch { }
|
|
248
248
|
if (!selected)
|
|
249
249
|
return await run(input, c);
|
|
250
|
+
// Progress reads an atomic observation; it must remain available while open
|
|
251
|
+
// holds this context's research boundary for a long native import.
|
|
252
|
+
if (path[1] === 'progress')
|
|
253
|
+
return await run(input, c);
|
|
250
254
|
const services = owner.selected(c);
|
|
251
255
|
// First open of an already known target reserves its context inside Research.open.
|
|
252
256
|
// Existing contexts still use the command boundary to order automatic sync phases.
|
package/dist/src/contexts.js
CHANGED
|
@@ -28,7 +28,8 @@ import { nativeQuery } from './native-queries.js';
|
|
|
28
28
|
import { runInline } from './inline-script.js';
|
|
29
29
|
import { researchView } from './research-view.js';
|
|
30
30
|
import { sdkWrites } from './sdk-contracts.js';
|
|
31
|
-
import { initialIntent, initializeModel } from './initial-model.js';
|
|
31
|
+
import { initialRoot, initialIntent, initializeModel, validateInitialIntent } from './initial-model.js';
|
|
32
|
+
import { initialProgress } from './initial-progress.js';
|
|
32
33
|
import { managedGhidraDebugger, prepareGhidraDebugger } from './ghidra-debugger-runtime.js';
|
|
33
34
|
const alive = (pid) => {
|
|
34
35
|
try {
|
|
@@ -364,7 +365,38 @@ export class GhidraContexts {
|
|
|
364
365
|
if (model.state === 'ready')
|
|
365
366
|
return;
|
|
366
367
|
const server = this.server(), binding = await server.ensure();
|
|
367
|
-
if (
|
|
368
|
+
if (this.workspace.activePublication(target.id))
|
|
369
|
+
fail('blocked', 'Shared publication requires reconciliation before initial-model recovery.');
|
|
370
|
+
const intent = await initialIntent(this.workspace, target.id);
|
|
371
|
+
if (intent) {
|
|
372
|
+
await validateInitialIntent(this.workspace, target, binding, this.inputs.fingerprint, undefined, true);
|
|
373
|
+
if (intent.runtimeFingerprint !== this.inputs.fingerprint) {
|
|
374
|
+
const root = initialRoot(this.workspace, target.id);
|
|
375
|
+
const result = await server.initialRecovery(binding, root, this.inputs.fingerprint);
|
|
376
|
+
if (result.state === 'busy')
|
|
377
|
+
fail('busy', 'The retained initial-model worker is still active.');
|
|
378
|
+
if (result.state === 'candidate') {
|
|
379
|
+
const receipt = text(result.receipt);
|
|
380
|
+
if (!/^canonical-[a-f0-9-]{36}\.json$/.test(receipt))
|
|
381
|
+
fail('binding', 'Invalid canonical recovery receipt.');
|
|
382
|
+
const proof = await server.initialRecovery(binding, root, this.inputs.fingerprint, receipt);
|
|
383
|
+
if (proof.state !== 'verified' || proof.version !== result.version || proof.snapshotBuffersVerified !== true || proof.snapshot !== result.snapshot ||
|
|
384
|
+
typeof proof.snapshot !== 'string' || !/^canonical-[a-f0-9-]{36}\.gzf$/.test(proof.snapshot))
|
|
385
|
+
fail('unknown', 'Canonical model changed or independent recovery readback remains unproved.');
|
|
386
|
+
const snapshot = await this.workspace.captureSnapshot(join(root, proof.snapshot));
|
|
387
|
+
if (snapshot.sha256 !== proof.snapshotSha256)
|
|
388
|
+
fail('binding', 'Recovered canonical snapshot changed.');
|
|
389
|
+
this.workspace.establishModel(target.id, version(proof.version), snapshot);
|
|
390
|
+
await initialProgress(root, target.id, 'complete', 'complete');
|
|
391
|
+
return;
|
|
392
|
+
}
|
|
393
|
+
if (result.state !== 'absent' || result.root !== 'runtime-' + this.inputs.fingerprint)
|
|
394
|
+
fail('unknown', 'Retained initial-model outcome requires reconciliation.');
|
|
395
|
+
await initializeModel(this.workspace, target, binding, server, this.inputs.fingerprint, join(root, String(result.root)));
|
|
396
|
+
return;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
if (!intent) {
|
|
368
400
|
// Old builds imported into an unversioned local shared-project stage. First stop
|
|
369
401
|
// its authenticated worker; a failed probe is never treated as authoritative absence.
|
|
370
402
|
if (model.state === 'unknown')
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Workspace, ResearchTarget } from './workspace.js';
|
|
2
2
|
import type { GhidraServer, ServerBinding } from './server.js';
|
|
3
3
|
export declare const initialRoot: (workspace: Workspace, target: string) => string;
|
|
4
|
-
export declare function initialIntent(workspace: Workspace, target: string): Promise<Record<string, unknown> | undefined>;
|
|
4
|
+
export declare function initialIntent(workspace: Workspace, target: string, root?: string): Promise<Record<string, unknown> | undefined>;
|
|
5
|
+
export declare function validateInitialIntent(workspace: Workspace, target: ResearchTarget, binding: ServerBinding, fingerprint: string, root?: string, allowRuntimeChange?: boolean): Promise<Record<string, unknown>>;
|
|
5
6
|
/** Immutable input/authority binding; private attempts and conditional first creation share it. */
|
|
6
|
-
export declare function initializeModel(workspace: Workspace, target: ResearchTarget, binding: ServerBinding, server: Pick<GhidraServer, 'initialImport' | 'initialPublication'>, fingerprint: string): Promise<void>;
|
|
7
|
+
export declare function initializeModel(workspace: Workspace, target: ResearchTarget, binding: ServerBinding, server: Pick<GhidraServer, 'initialImport' | 'initialPublication'>, fingerprint: string, root?: string): Promise<void>;
|
|
@@ -4,9 +4,9 @@ import { randomUUID } from 'node:crypto';
|
|
|
4
4
|
import { stable, object, fail } from './model.js';
|
|
5
5
|
import { initialProgress, progressPhase, readInitialProgress } from './initial-progress.js';
|
|
6
6
|
export const initialRoot = (workspace, target) => join(workspace.directory, 'ghidra-native', 'initial', target);
|
|
7
|
-
export async function initialIntent(workspace, target) {
|
|
7
|
+
export async function initialIntent(workspace, target, root = initialRoot(workspace, target)) {
|
|
8
8
|
try {
|
|
9
|
-
return object(JSON.parse(await readFile(join(
|
|
9
|
+
return object(JSON.parse(await readFile(join(root, 'intent.json'), 'utf8')));
|
|
10
10
|
}
|
|
11
11
|
catch (error) {
|
|
12
12
|
if (error.code === 'ENOENT')
|
|
@@ -14,10 +14,21 @@ export async function initialIntent(workspace, target) {
|
|
|
14
14
|
throw error;
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
+
export async function validateInitialIntent(workspace, target, binding, fingerprint, root = initialRoot(workspace, target.id), allowRuntimeChange = false) {
|
|
18
|
+
const expected = { schema: 1, target: target.id, sha256: target.binarySha256, input: await workspace.artifacts.verify(target.input),
|
|
19
|
+
origin: binding.origin, repository: binding.repository, readerUser: binding.readerUser, publisherUser: binding.publisherUser,
|
|
20
|
+
settings: workspace.model(target.id).settings, runtimeFingerprint: fingerprint };
|
|
21
|
+
const intent = await initialIntent(workspace, target.id, root);
|
|
22
|
+
if (!intent || typeof intent.id !== 'string' || !/^[a-f0-9-]{36}$/.test(intent.id) ||
|
|
23
|
+
Object.entries(expected).filter(([key]) => key !== 'input' && !(allowRuntimeChange && key === 'runtimeFingerprint')).some(([key, value]) => stable(intent[key]) !== stable(value)) ||
|
|
24
|
+
typeof intent.runtimeFingerprint !== 'string' || typeof intent.input !== 'string' || await realpath(intent.input) !== expected.input)
|
|
25
|
+
fail('binding', 'Retained initial model differs from its input, load settings, runtime or repository authority.');
|
|
26
|
+
return intent;
|
|
27
|
+
}
|
|
17
28
|
/** Immutable input/authority binding; private attempts and conditional first creation share it. */
|
|
18
|
-
export async function initializeModel(workspace, target, binding, server, fingerprint) {
|
|
29
|
+
export async function initializeModel(workspace, target, binding, server, fingerprint, root = initialRoot(workspace, target.id)) {
|
|
19
30
|
try {
|
|
20
|
-
return await initialize(workspace, target, binding, server, fingerprint);
|
|
31
|
+
return await initialize(workspace, target, binding, server, fingerprint, root);
|
|
21
32
|
}
|
|
22
33
|
catch (error) {
|
|
23
34
|
try {
|
|
@@ -33,15 +44,14 @@ export async function initializeModel(workspace, target, binding, server, finger
|
|
|
33
44
|
throw error;
|
|
34
45
|
}
|
|
35
46
|
}
|
|
36
|
-
async function initialize(workspace, target, binding, server, fingerprint) {
|
|
37
|
-
const root = initialRoot(workspace, target.id);
|
|
47
|
+
async function initialize(workspace, target, binding, server, fingerprint, root) {
|
|
38
48
|
await mkdir(root, { recursive: true, mode: 0o700 });
|
|
39
49
|
if (await realpath(root) !== resolve(root))
|
|
40
50
|
fail('binding', 'Initial model storage moved outside its owned root.');
|
|
41
51
|
const expected = { schema: 1, target: target.id, sha256: target.binarySha256, input: await workspace.artifacts.verify(target.input),
|
|
42
52
|
origin: binding.origin, repository: binding.repository, readerUser: binding.readerUser, publisherUser: binding.publisherUser,
|
|
43
53
|
settings: workspace.model(target.id).settings, runtimeFingerprint: fingerprint };
|
|
44
|
-
let intent = await initialIntent(workspace, target.id);
|
|
54
|
+
let intent = await initialIntent(workspace, target.id, root);
|
|
45
55
|
if (!intent) {
|
|
46
56
|
const temporary = join(root, 'intent.new-' + randomUUID()), handle = await open(temporary, 'wx', 0o600);
|
|
47
57
|
try {
|
|
@@ -70,12 +80,9 @@ async function initialize(workspace, target, binding, server, fingerprint) {
|
|
|
70
80
|
await directory.close();
|
|
71
81
|
}
|
|
72
82
|
}
|
|
73
|
-
intent = await initialIntent(workspace, target.id);
|
|
83
|
+
intent = await initialIntent(workspace, target.id, root);
|
|
74
84
|
}
|
|
75
|
-
|
|
76
|
-
Object.entries(expected).filter(([key]) => key !== 'input').some(([key, value]) => stable(intent[key]) !== stable(value)) ||
|
|
77
|
-
typeof intent.input !== 'string' || await realpath(intent.input) !== expected.input)
|
|
78
|
-
fail('binding', 'Retained initial model differs from its input, load settings, runtime or repository authority.');
|
|
85
|
+
await validateInitialIntent(workspace, target, binding, fingerprint, root);
|
|
79
86
|
if (workspace.model(target.id).state === 'opening')
|
|
80
87
|
workspace.beginModelInitialization(target.id);
|
|
81
88
|
const prepared = await server.initialImport(root);
|
|
@@ -86,10 +93,11 @@ async function initialize(workspace, target, binding, server, fingerprint) {
|
|
|
86
93
|
const receipt = object(JSON.parse(await readFile(join(root, 'import.json'), 'utf8'))), name = receipt.snapshot;
|
|
87
94
|
if (typeof name !== 'string' || !/^attempt-[a-f0-9-]{36}\.gzf$/.test(name))
|
|
88
95
|
fail('binding', 'Initial model snapshot receipt is malformed.');
|
|
89
|
-
const
|
|
96
|
+
const observation = initialRoot(workspace, target.id);
|
|
97
|
+
const snapshot = await progressPhase(observation, target.id, 'snapshot-verification', () => workspace.captureSnapshot(join(root, name)));
|
|
90
98
|
if (snapshot.sha256 !== receipt.snapshotSha256)
|
|
91
99
|
fail('binding', 'Initial saved snapshot changed before publication.');
|
|
92
|
-
const publication = (operation) => progressPhase(
|
|
100
|
+
const publication = (operation) => progressPhase(observation, target.id, 'publication-' + operation, () => server.initialPublication(binding, root, operation));
|
|
93
101
|
let result = await publication('stage');
|
|
94
102
|
if (result.state === 'staged') {
|
|
95
103
|
const proof = await publication('verify-stage');
|
|
@@ -103,5 +111,5 @@ async function initialize(workspace, target, binding, server, fingerprint) {
|
|
|
103
111
|
if (verified.state !== 'verified' || verified.version !== 1 || verified.snapshotBuffersVerified !== true)
|
|
104
112
|
fail('unknown', 'Independent initial-model readback did not establish the complete saved buffers.');
|
|
105
113
|
workspace.establishModel(target.id, 1, snapshot);
|
|
106
|
-
await initialProgress(
|
|
114
|
+
await initialProgress(observation, target.id, 'complete', 'complete');
|
|
107
115
|
}
|
|
@@ -30,17 +30,27 @@ export async function readInitialProgress(directory, target) {
|
|
|
30
30
|
}
|
|
31
31
|
export async function initialProgress(root, target, phase, state = 'running') {
|
|
32
32
|
await mkdir(root, { recursive: true, mode: 0o700 });
|
|
33
|
-
let startedAt = new Date().toISOString();
|
|
33
|
+
let startedAt = new Date().toISOString(), previous;
|
|
34
34
|
try {
|
|
35
|
-
const
|
|
36
|
-
if (
|
|
37
|
-
|
|
35
|
+
const saved = JSON.parse(await readFile(join(root, 'progress.json'), 'utf8'));
|
|
36
|
+
if (saved.schema === 1 && saved.target === target) {
|
|
37
|
+
previous = saved;
|
|
38
|
+
startedAt = saved.startedAt;
|
|
39
|
+
}
|
|
38
40
|
}
|
|
39
41
|
catch (error) {
|
|
40
42
|
if (error.code !== 'ENOENT')
|
|
41
43
|
throw error;
|
|
42
44
|
}
|
|
43
|
-
|
|
45
|
+
// A terminal observation describes the worker's last task, not a fresh owner task.
|
|
46
|
+
// Keep its counters/message/PID so timeout handling cannot erase native progress.
|
|
47
|
+
const retained = {};
|
|
48
|
+
if (state !== 'running' && previous?.phase === phase)
|
|
49
|
+
for (const key of ['pid', 'message', 'completed', 'total', 'indeterminate'])
|
|
50
|
+
if (previous[key] !== undefined)
|
|
51
|
+
retained[key] = previous[key];
|
|
52
|
+
await atomicWrite(join(root, 'progress.json'), { schema: 1, target, phase, state, pid: process.pid, startedAt, indeterminate: true,
|
|
53
|
+
...(previous?.attempt === undefined ? {} : { attempt: previous.attempt }), ...retained, updatedAt: new Date().toISOString() });
|
|
44
54
|
}
|
|
45
55
|
export async function progressPhase(root, target, phase, action) {
|
|
46
56
|
await initialProgress(root, target, phase);
|
package/dist/src/server.d.ts
CHANGED
|
@@ -43,6 +43,7 @@ export declare class GhidraServer {
|
|
|
43
43
|
projectOutcome(requestId: string, expected: Record<string, unknown>): Promise<Record<string, unknown> | undefined>;
|
|
44
44
|
administration(operation: string, parameters: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
45
45
|
programStatus(binding: ServerBinding, path: string): Promise<Record<string, unknown>>;
|
|
46
|
+
initialRecovery(binding: ServerBinding, root: string, fingerprint: string, receipt?: string): Promise<Record<string, unknown>>;
|
|
46
47
|
initialImport(root: string): Promise<Record<string, unknown>>;
|
|
47
48
|
initialPublication(binding: ServerBinding, root: string, operation?: 'stage' | 'verify-stage' | 'promote' | 'verify'): Promise<Record<string, unknown>>;
|
|
48
49
|
publish(binding: ServerBinding, path: string, snapshot: string, expected: number, request: string, journal: string, sourceSha: string): Promise<Record<string, unknown>>;
|
package/dist/src/server.js
CHANGED
|
@@ -4,7 +4,7 @@ import { launchProcess, terminateProcess } from './tool-runtime/supervisor.js';
|
|
|
4
4
|
import { runTool } from './tool-runtime/run.js';
|
|
5
5
|
import { randomUUID, randomBytes, createHash } from 'node:crypto';
|
|
6
6
|
import { readFile, mkdir, open, rename, readdir, stat, chmod, realpath } from 'node:fs/promises';
|
|
7
|
-
import { delimiter, dirname, join, resolve } from 'node:path';
|
|
7
|
+
import { basename, delimiter, dirname, join, resolve } from 'node:path';
|
|
8
8
|
import { createServer } from 'node:net';
|
|
9
9
|
import { setTimeout as delay } from 'node:timers/promises';
|
|
10
10
|
import { fail, object, stable, text, digest } from './model.js';
|
|
@@ -201,11 +201,14 @@ export class GhidraServer {
|
|
|
201
201
|
async programStatus(binding, path) {
|
|
202
202
|
return this.run('program-status', 'InsightRepositoryProbe', [binding.repository, path, 'reader'], await this.credentials(binding, 'reader'));
|
|
203
203
|
}
|
|
204
|
+
async initialRecovery(binding, root, fingerprint, receipt = '') {
|
|
205
|
+
return this.run('initial-recovery', 'db.InsightInitialRecovery', [root, fingerprint, receipt], await this.credentials(binding, 'reader'));
|
|
206
|
+
}
|
|
204
207
|
async initialImport(root) {
|
|
205
208
|
const timeoutMilliseconds = ghidraBudget(this.c.profile.values, 'import');
|
|
206
209
|
const report = async () => {
|
|
207
210
|
try {
|
|
208
|
-
const p = object(JSON.parse(await readFile(join(root, 'progress.json'), 'utf8')));
|
|
211
|
+
const p = object(JSON.parse(await readFile(join(/^runtime-[a-f0-9]{64}$/.test(basename(root)) ? dirname(root) : root, 'progress.json'), 'utf8')));
|
|
209
212
|
const elapsed = Math.round((Date.now() - Date.parse(String(p.startedAt))) / 1000);
|
|
210
213
|
this.c.progress(`Ghidra ${String(p.phase)}: ${elapsed}s${typeof p.total === 'number' ? `; task ${String(p.completed)}/${p.total}` : ''}${p.message ? `; ${String(p.message).replace(/[\r\n\x00-\x1f]/g, ' ')}` : ''}`);
|
|
211
214
|
}
|
package/package.json
CHANGED
|
@@ -8,7 +8,8 @@ import java.util.*;
|
|
|
8
8
|
/** A bounded observation channel, never a completion receipt or an overall percentage. */
|
|
9
9
|
class InsightImportProgress extends TaskMonitorAdapter implements AutoCloseable {
|
|
10
10
|
private final Path root;
|
|
11
|
-
private final String target,
|
|
11
|
+
private final String target,attempt;
|
|
12
|
+
private final String started=Instant.now().toString();
|
|
12
13
|
private final Timer heartbeat=new Timer("insight-import-progress",true);
|
|
13
14
|
private String phase="starting",state="running";
|
|
14
15
|
private String message="";
|
|
@@ -16,7 +17,18 @@ class InsightImportProgress extends TaskMonitorAdapter implements AutoCloseable
|
|
|
16
17
|
private boolean indeterminate=true;
|
|
17
18
|
private volatile Throwable writeFailure;
|
|
18
19
|
InsightImportProgress(Path root,String target)throws Exception{
|
|
19
|
-
|
|
20
|
+
this(root,target,null);
|
|
21
|
+
}
|
|
22
|
+
InsightImportProgress(Path root,String target,String attempt)throws Exception{
|
|
23
|
+
super(true);this.root=root;this.target=target;this.attempt=attempt;
|
|
24
|
+
Path previous=root.resolve("progress.json");
|
|
25
|
+
if(Files.exists(previous)){
|
|
26
|
+
JsonObject saved=InsightInitialJournal.read(previous);
|
|
27
|
+
if(saved.get("schema").getAsInt()!=1||!target.equals(saved.get("target").getAsString()))throw new SecurityException("Initial progress binding changed");
|
|
28
|
+
// Preserve observations only; an analysis checkpoint requires its own prepared snapshot.
|
|
29
|
+
InsightInitialJournal.write(root.resolve("progress-history-"+UUID.randomUUID()+".json"),saved);
|
|
30
|
+
}
|
|
31
|
+
emit();
|
|
20
32
|
heartbeat.scheduleAtFixedRate(new TimerTask(){public void run(){try{emit();}catch(Throwable failure){writeFailure=failure;}}},2000,2000);
|
|
21
33
|
}
|
|
22
34
|
synchronized void phase(String value)throws Exception{phase=value;setMessage("");initialize(0);setIndeterminate(true);emit();}
|
|
@@ -33,6 +45,7 @@ class InsightImportProgress extends TaskMonitorAdapter implements AutoCloseable
|
|
|
33
45
|
synchronized void state(String value)throws Exception{state=value;emit();}
|
|
34
46
|
private synchronized void emit()throws Exception{
|
|
35
47
|
JsonObject p=new JsonObject();p.addProperty("schema",1);p.addProperty("target",target);p.addProperty("phase",phase);p.addProperty("state",state);
|
|
48
|
+
if(attempt!=null)p.addProperty("attempt",attempt);
|
|
36
49
|
p.addProperty("pid",ProcessHandle.current().pid());p.addProperty("startedAt",started);p.addProperty("updatedAt",Instant.now().toString());
|
|
37
50
|
p.addProperty("indeterminate",isIndeterminate());String message=Objects.toString(getMessage(),"");p.addProperty("message",message.substring(0,Math.min(message.length(),1024)));
|
|
38
51
|
if(!isIndeterminate()&&getMaximum()>0){p.addProperty("completed",getProgress());p.addProperty("total",getMaximum());}
|
|
@@ -11,7 +11,7 @@ class InsightInitialImport {
|
|
|
11
11
|
public static void main(String[] args){var out=System.out;System.setOut(System.err);
|
|
12
12
|
try{
|
|
13
13
|
Path root=Path.of(args[0]);JsonObject p=InsightInitialJournal.intent(root);
|
|
14
|
-
try(var channel=FileChannel.open(root.resolve("lock"),StandardOpenOption.CREATE,StandardOpenOption.WRITE);var lock=channel.tryLock()){
|
|
14
|
+
try(var channel=FileChannel.open(InsightInitialJournal.lockRoot(root).resolve("lock"),StandardOpenOption.CREATE,StandardOpenOption.WRITE);var lock=channel.tryLock()){
|
|
15
15
|
if(lock==null){out.println("{\"state\":\"busy\"}");System.exit(0);}
|
|
16
16
|
Path journal=root.resolve("import.json");
|
|
17
17
|
if(Files.exists(journal)&&InsightInitialJournal.text(InsightInitialJournal.read(journal),"phase").equals("prepared")){
|
|
@@ -23,7 +23,7 @@ class InsightInitialImport {
|
|
|
23
23
|
JsonObject s=new JsonObject();s.addProperty("intentHash",InsightInitialJournal.hash(root.resolve("intent.json")));
|
|
24
24
|
s.addProperty("phase","importing");s.addProperty("pid",ProcessHandle.current().pid());s.addProperty("snapshot","attempt-"+UUID.randomUUID()+".gzf");
|
|
25
25
|
Path attempt=root.resolve(InsightInitialJournal.text(s,"snapshot")+".json");InsightInitialJournal.write(attempt,s);InsightInitialJournal.write(journal,s);
|
|
26
|
-
try(var progress=new InsightImportProgress(root,InsightInitialJournal.text(p,"target"))){
|
|
26
|
+
try(var progress=new InsightImportProgress(InsightInitialJournal.lockRoot(root),InsightInitialJournal.text(p,"target"),InsightInitialJournal.text(s,"snapshot"))){
|
|
27
27
|
progress.phase("runtime-initialization");
|
|
28
28
|
Application.initializeApplication(new GhidraApplicationLayout(),new HeadlessGhidraApplicationConfiguration());
|
|
29
29
|
JsonObject settings=p.getAsJsonObject("settings"),request=new JsonObject();
|
|
@@ -31,6 +31,15 @@ public class InsightInitialJournal {
|
|
|
31
31
|
if(p.get("schema").getAsInt()!=1||!text(p,"target").matches("t_[a-f0-9]{32}")||!text(p,"id").matches("[a-f0-9-]{36}")||!text(p,"sha256").matches("[a-f0-9]{64}"))throw new SecurityException("Invalid initial-model identity");
|
|
32
32
|
return p;
|
|
33
33
|
}
|
|
34
|
+
/** Upgraded preparations share the original attempt's native lock. */
|
|
35
|
+
public static Path lockRoot(Path root)throws Exception{
|
|
36
|
+
JsonObject p=intent(root);if(!p.has("recoveryOf"))return root;
|
|
37
|
+
Path parent=root.getParent();JsonObject original=intent(parent);
|
|
38
|
+
if(!root.getFileName().toString().equals("runtime-"+text(p,"runtimeFingerprint"))||!text(p,"recoveryOf").equals(hash(parent.resolve("intent.json"))))throw new SecurityException("Recovery ancestry changed");
|
|
39
|
+
JsonObject expected=original.deepCopy();expected.add("id",p.get("id"));expected.add("runtimeFingerprint",p.get("runtimeFingerprint"));expected.add("recoveryOf",p.get("recoveryOf"));
|
|
40
|
+
if(!expected.equals(p))throw new SecurityException("Recovery immutable identity changed");
|
|
41
|
+
return parent;
|
|
42
|
+
}
|
|
34
43
|
public static JsonObject prepared(Path root)throws Exception{
|
|
35
44
|
JsonObject p=intent(root),s=read(root.resolve("import.json"));
|
|
36
45
|
if(!text(s,"intentHash").equals(hash(root.resolve("intent.json")))||!text(s,"phase").equals("prepared"))throw new SecurityException("Import is not prepared");
|
|
@@ -54,7 +54,7 @@ class InsightInitialPublication {
|
|
|
54
54
|
public static void main(String[] args){var out=System.out;System.setOut(System.err);
|
|
55
55
|
try{
|
|
56
56
|
Path root=Path.of(args[0]);String operation=args[1];boolean readOnly=operation.startsWith("verify");JsonObject p=InsightInitialJournal.intent(root);
|
|
57
|
-
try(var channel=FileChannel.open(root.resolve("lock"),StandardOpenOption.CREATE,StandardOpenOption.WRITE);var lock=channel.tryLock()){
|
|
57
|
+
try(var channel=FileChannel.open(InsightInitialJournal.lockRoot(root).resolve("lock"),StandardOpenOption.CREATE,StandardOpenOption.WRITE);var lock=channel.tryLock()){
|
|
58
58
|
if(lock==null){out.println("{\"state\":\"busy\"}");System.exit(0);}
|
|
59
59
|
JsonObject saved=InsightInitialJournal.prepared(root);Path snapshot=root.resolve(text(saved,"snapshot")),journalPath=root.resolve("publication.json");
|
|
60
60
|
JsonObject j=Files.exists(journalPath)?InsightInitialJournal.read(journalPath):null;
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
package db;
|
|
2
|
+
|
|
3
|
+
import com.google.gson.*;
|
|
4
|
+
import com.xebyte.headless.GhidraServerManager;
|
|
5
|
+
import db.buffers.InsightBlockTransfer;
|
|
6
|
+
import db.buffers.LocalBufferFile;
|
|
7
|
+
import ghidra.framework.store.local.ItemSerializer;
|
|
8
|
+
import ghidra.GhidraApplicationLayout;
|
|
9
|
+
import ghidra.framework.*;
|
|
10
|
+
import ghidra.framework.client.RepositoryAdapter;
|
|
11
|
+
import ghidra.framework.data.OpenMode;
|
|
12
|
+
import ghidra.framework.store.db.PackedDatabase;
|
|
13
|
+
import ghidra.program.database.ProgramDB;
|
|
14
|
+
import ghidra.util.task.TaskMonitor;
|
|
15
|
+
import insight.InsightInitialJournal;
|
|
16
|
+
import java.nio.file.*;
|
|
17
|
+
import java.nio.channels.*;
|
|
18
|
+
import java.util.*;
|
|
19
|
+
|
|
20
|
+
/** Read-only canonical recovery; only local preparation journals may be created here. */
|
|
21
|
+
class InsightInitialRecovery {
|
|
22
|
+
static String text(JsonObject p,String key){return InsightInitialJournal.text(p,key);}
|
|
23
|
+
static void stopped(Path root)throws Exception{
|
|
24
|
+
for(String name:List.of("import.json","publication.json"))if(Files.exists(root.resolve(name))){
|
|
25
|
+
var j=InsightInitialJournal.read(root.resolve(name));
|
|
26
|
+
if(j.has("pid")&&ProcessHandle.of(j.get("pid").getAsLong()).map(ProcessHandle::isAlive).orElse(false))
|
|
27
|
+
throw new IllegalStateException("Retained initial worker is live; no takeover");
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
static void quiescent(RepositoryAdapter repo,String name,String id,int revision)throws Exception{
|
|
31
|
+
var item=repo.getItem("/",name);
|
|
32
|
+
if(item==null||!id.equals(item.getFileID())||item.getVersion()!=revision||repo.isCheckinActive("/",name)||repo.getCheckouts("/",name).length!=0)
|
|
33
|
+
throw new IllegalStateException("Canonical revision or ownership changed");
|
|
34
|
+
var history=repo.getVersions("/",name);
|
|
35
|
+
if(Arrays.stream(history).noneMatch(v->v.getVersion()==revision)||
|
|
36
|
+
Arrays.stream(history).noneMatch(v->v.getVersion()==1&&("insight target "+name.substring(0,name.length()-4)).equals(v.getComment())))
|
|
37
|
+
throw new SecurityException("Canonical initial provenance is unproved");
|
|
38
|
+
}
|
|
39
|
+
static void buffers(RepositoryAdapter repo,String name,int version,Path path,String sha)throws Exception{
|
|
40
|
+
DBHandle saved=PackedDatabase.getPackedDatabase(path.toFile(),true,TaskMonitor.DUMMY).open(TaskMonitor.DUMMY);
|
|
41
|
+
DBHandle observed=new DBHandle(repo.openDatabase("/",name,version,-1));
|
|
42
|
+
try{
|
|
43
|
+
if(saved.getDatabaseId()!=observed.getDatabaseId()||!InsightBlockTransfer.fingerprint(saved.getBufferMgr().getSourceFile()).equals(InsightBlockTransfer.fingerprint(observed.getBufferMgr().getSourceFile())))
|
|
44
|
+
throw new SecurityException("Exact canonical buffers differ");
|
|
45
|
+
Object consumer=new Object();ProgramDB program=new ProgramDB(observed,OpenMode.IMMUTABLE,TaskMonitor.DUMMY,consumer);
|
|
46
|
+
try{if(!sha.equals(program.getExecutableSHA256()))throw new SecurityException("Canonical target changed");}finally{program.release(consumer);}
|
|
47
|
+
}finally{saved.close();observed.close();}
|
|
48
|
+
}
|
|
49
|
+
static void packExact(DBHandle db,Path path,String name)throws Exception{
|
|
50
|
+
// Program.saveToPackedFile / PackedDatabase.packDatabase allocate a fresh DB identity.
|
|
51
|
+
// Preserve the exact committed identity before serializing the same GZF container format.
|
|
52
|
+
Path raw=path.resolveSibling(path.getFileName()+".db");
|
|
53
|
+
LocalBufferFile file=new LocalBufferFile(raw.toFile(),db.getBufferSize());
|
|
54
|
+
try{db.saveAs(file,Long.valueOf(db.getDatabaseId()),false,TaskMonitor.DUMMY);}finally{file.dispose();}
|
|
55
|
+
try(var input=Files.newInputStream(raw)){
|
|
56
|
+
ItemSerializer.outputItem(name,"Program",0,Files.size(raw),input,path.toFile(),TaskMonitor.DUMMY);
|
|
57
|
+
}
|
|
58
|
+
Files.delete(raw);
|
|
59
|
+
}
|
|
60
|
+
static void settings(ProgramDB program,JsonObject p)throws Exception{
|
|
61
|
+
if(!program.getExecutableSHA256().equals(text(p,"sha256")))throw new SecurityException("Canonical source changed");
|
|
62
|
+
JsonObject settings=p.getAsJsonObject("settings");
|
|
63
|
+
if(settings.has("language")&&!program.getLanguageID().toString().equals(text(settings,"language"))||
|
|
64
|
+
settings.has("compilerSpec")&&!program.getCompilerSpec().getCompilerSpecID().toString().equals(text(settings,"compilerSpec"))||
|
|
65
|
+
settings.has("imageBase")&&!program.getImageBase().toString().replaceFirst("^0+(?!$)","").equals(text(settings,"imageBase")))
|
|
66
|
+
throw new SecurityException("Canonical load settings changed");
|
|
67
|
+
}
|
|
68
|
+
public static void main(String[] args){var out=System.out;System.setOut(System.err);
|
|
69
|
+
try{
|
|
70
|
+
Path root=Path.of(args[0]);String fingerprint=args[1],receipt=args[2];
|
|
71
|
+
if(!fingerprint.matches("[a-f0-9]{64}"))throw new SecurityException("Invalid runtime fingerprint");
|
|
72
|
+
JsonObject p=InsightInitialJournal.intent(root);String intentHash=InsightInitialJournal.hash(root.resolve("intent.json"));
|
|
73
|
+
try(var channel=FileChannel.open(root.resolve("lock"),StandardOpenOption.CREATE,StandardOpenOption.WRITE);var lock=channel.tryLock()){
|
|
74
|
+
if(lock==null){out.println("{\"state\":\"busy\"}");System.exit(0);}
|
|
75
|
+
stopped(root);
|
|
76
|
+
try(var children=Files.newDirectoryStream(root,"runtime-*")){for(Path child:children){
|
|
77
|
+
if(!Files.isDirectory(child,LinkOption.NOFOLLOW_LINKS)||!child.toRealPath().equals(child.toAbsolutePath().normalize()))throw new SecurityException();
|
|
78
|
+
stopped(child);
|
|
79
|
+
}}
|
|
80
|
+
Application.initializeApplication(new GhidraApplicationLayout(),new HeadlessGhidraApplicationConfiguration());
|
|
81
|
+
var manager=new GhidraServerManager();manager.connect();var repo=manager.server().getRepository(text(p,"repository"));repo.connect();
|
|
82
|
+
var user=repo.getUser();
|
|
83
|
+
if(user==null||!user.isReadOnly()||!user.getName().equals(text(p,"readerUser"))||!user.getName().equals(System.getenv("GHIDRA_SERVER_USER")))throw new SecurityException();
|
|
84
|
+
String name=text(p,"target")+".bin";var item=repo.getItem("/",name);
|
|
85
|
+
if(item==null){
|
|
86
|
+
if(!receipt.isEmpty()||repo.fileExists("/",name)||Files.exists(root.resolve("publication.json")))throw new SecurityException("Canonical absence or prior publication remains unproved");
|
|
87
|
+
// All earlier preparations remain retained; none may have a pending publication.
|
|
88
|
+
try(var children=Files.newDirectoryStream(root,"runtime-*")){for(Path child:children)if(!child.getFileName().toString().equals("runtime-"+fingerprint)&&Files.exists(child.resolve("publication.json")))throw new SecurityException("Earlier runtime publication requires reconciliation");}
|
|
89
|
+
Path next=root.resolve("runtime-"+fingerprint);Files.createDirectories(next);
|
|
90
|
+
if(!next.toRealPath().equals(next.toAbsolutePath().normalize()))throw new SecurityException();
|
|
91
|
+
Path intent=next.resolve("intent.json");
|
|
92
|
+
JsonObject expected=p.deepCopy();expected.addProperty("runtimeFingerprint",fingerprint);expected.addProperty("recoveryOf",intentHash);
|
|
93
|
+
if(Files.exists(intent)){
|
|
94
|
+
JsonObject actual=InsightInitialJournal.intent(next);expected.add("id",actual.get("id"));
|
|
95
|
+
if(!expected.equals(actual))throw new SecurityException("Runtime recovery intent changed");
|
|
96
|
+
}else{expected.addProperty("id",UUID.randomUUID().toString());InsightInitialJournal.write(intent,expected);}
|
|
97
|
+
out.println(new Gson().toJson(Map.of("state","absent","root",next.getFileName().toString())));System.exit(0);
|
|
98
|
+
}
|
|
99
|
+
String id=item.getFileID();int revision=item.getVersion();quiescent(repo,name,id,revision);
|
|
100
|
+
// A lost initial publication is reconciled against its exact R1, never inferred from latest alone.
|
|
101
|
+
List<Path> attempts=new ArrayList<>();attempts.add(root);
|
|
102
|
+
try(var children=Files.newDirectoryStream(root,"runtime-*")){for(Path child:children)attempts.add(child);}
|
|
103
|
+
for(Path attempt:attempts)if(Files.exists(attempt.resolve("publication.json"))){
|
|
104
|
+
var j=InsightInitialJournal.read(attempt.resolve("publication.json"));var saved=InsightInitialJournal.prepared(attempt);
|
|
105
|
+
if(!text(j,"intentHash").equals(InsightInitialJournal.hash(attempt.resolve("intent.json")))||!id.equals(j.has("fileId")?text(j,"fileId"):text(InsightInitialJournal.intent(attempt),"id"))||
|
|
106
|
+
!text(j,"snapshotSha256").equals(text(saved,"snapshotSha256")))throw new SecurityException("Prior publication identity remains unknown");
|
|
107
|
+
buffers(repo,name,1,attempt.resolve(text(saved,"snapshot")),text(p,"sha256"));
|
|
108
|
+
}
|
|
109
|
+
if(receipt.isEmpty()){
|
|
110
|
+
String token=UUID.randomUUID().toString(),snapshot="canonical-"+token+".gzf";Path path=root.resolve(snapshot);
|
|
111
|
+
DBHandle db=new DBHandle(repo.openDatabase("/",name,revision,-1));Object consumer=new Object();
|
|
112
|
+
try{ProgramDB program=new ProgramDB(db,OpenMode.IMMUTABLE,TaskMonitor.DUMMY,consumer);
|
|
113
|
+
try{settings(program,p);packExact(db,path,name);}finally{program.release(consumer);}
|
|
114
|
+
}finally{db.close();}
|
|
115
|
+
InsightInitialJournal.sync(path);quiescent(repo,name,id,revision);
|
|
116
|
+
JsonObject journal=new JsonObject();journal.addProperty("intentHash",intentHash);journal.addProperty("runtimeFingerprint",fingerprint);
|
|
117
|
+
journal.addProperty("fileId",id);journal.addProperty("version",revision);journal.addProperty("snapshot",snapshot);journal.addProperty("snapshotSha256",InsightInitialJournal.hash(path));
|
|
118
|
+
receipt="canonical-"+token+".json";InsightInitialJournal.write(root.resolve(receipt),journal);
|
|
119
|
+
journal.addProperty("receipt",receipt);journal.addProperty("state","candidate");out.println(journal);System.exit(0);
|
|
120
|
+
}
|
|
121
|
+
if(!receipt.matches("canonical-[a-f0-9-]{36}\\.json"))throw new SecurityException();
|
|
122
|
+
JsonObject proof=InsightInitialJournal.read(root.resolve(receipt));String snapshot=text(proof,"snapshot");
|
|
123
|
+
if(!snapshot.matches("canonical-[a-f0-9-]{36}\\.gzf")||!intentHash.equals(text(proof,"intentHash"))||!fingerprint.equals(text(proof,"runtimeFingerprint"))||
|
|
124
|
+
!id.equals(text(proof,"fileId"))||revision!=proof.get("version").getAsInt()||!text(proof,"snapshotSha256").equals(InsightInitialJournal.hash(root.resolve(snapshot))))throw new SecurityException("Canonical recovery receipt changed");
|
|
125
|
+
buffers(repo,name,revision,root.resolve(snapshot),text(p,"sha256"));quiescent(repo,name,id,revision);
|
|
126
|
+
proof.addProperty("state","verified");proof.addProperty("snapshotBuffersVerified",true);out.println(proof);
|
|
127
|
+
}
|
|
128
|
+
System.exit(0);
|
|
129
|
+
}catch(Throwable failure){failure.printStackTrace(System.err);out.println("{\"state\":\"unknown\"}");System.exit(0);}
|
|
130
|
+
}
|
|
131
|
+
}
|
package/references/recovery.md
CHANGED
|
@@ -9,7 +9,11 @@ First-import recovery uses the same scoped `ghidra open` or the original request
|
|
|
9
9
|
Import/analysis writes a private snapshot and completion receipt before any initial publication.
|
|
10
10
|
If its worker is still running, continuation reports busy; wait and continue the same scope.
|
|
11
11
|
If that worker stopped before completing its receipt, continuation can repeat private analysis
|
|
12
|
-
from the immutable input while retaining previous attempts. A
|
|
12
|
+
from the immutable input while retaining previous attempts. A progressing analyzer can exceed the
|
|
13
|
+
default one-hour wall-clock budget: after verifying that worker has stopped, use `ghidra budgets set
|
|
14
|
+
--initial-import-seconds <seconds>` (up to 86400), then continue the same session/target. No partial
|
|
15
|
+
analysis checkpoint is implied. Terminal progress retains the last native message/counters; a new
|
|
16
|
+
attempt archives the previous observation as `progress-history-<uuid>.json`. A completed snapshot is reused.
|
|
13
17
|
Initial publication first creates a uniquely named staging object. A separate read-only process
|
|
14
18
|
verifies its complete saved DB buffers before a conditional server move to the absent canonical
|
|
15
19
|
path. It never checks in a new version of an existing canonical item. Lost promotion replies
|
|
@@ -41,6 +45,14 @@ A missing/unreadable/mismatched proof stays blocked; never kill by port, basenam
|
|
|
41
45
|
Other platforms retain their existing ownership authentication; this does not claim equivalent
|
|
42
46
|
hang recovery where no independent proof is available. No compiler is required on installation.
|
|
43
47
|
|
|
48
|
+
A bridge/runtime upgrade can also be continued in the original scope. The old immutable
|
|
49
|
+
intent remains retained. Recovery checks input/settings/authority, stopped native ownership
|
|
50
|
+
and publication journals first. Existing canonical research is recovered from its latest
|
|
51
|
+
committed revision through independent exact-version/full-buffer readback; private pending
|
|
52
|
+
edits stay private. A revision change or live checkout blocks adoption. Only an authoritative
|
|
53
|
+
absent path permits a separately journaled preparation under the current verified runtime,
|
|
54
|
+
using the original lock and conditional creation. An unknown publication still freezes recovery.
|
|
55
|
+
|
|
44
56
|
## Interrupted save or close
|
|
45
57
|
|
|
46
58
|
After restoring profile storage, inspect the selected session and target with
|
|
@@ -3,7 +3,7 @@ name: insight-artifacts
|
|
|
3
3
|
description: Retain a completed reverse-engineering evidence file or directory as an ordinary checkpoint using insight-cli artifacts save. Use after Ghidra or any external tool; preserve existing project formats and source of truth.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Insight Artifacts 0.5.
|
|
6
|
+
# Insight Artifacts 0.5.7
|
|
7
7
|
|
|
8
8
|
If local help/status reports AppData or IPC access denied, retry that **read-only probe**
|
|
9
9
|
with the agent host's normal permission escalation, then use that route for later authorized
|
|
@@ -9,7 +9,11 @@ First-import recovery uses the same scoped `ghidra open` or the original request
|
|
|
9
9
|
Import/analysis writes a private snapshot and completion receipt before any initial publication.
|
|
10
10
|
If its worker is still running, continuation reports busy; wait and continue the same scope.
|
|
11
11
|
If that worker stopped before completing its receipt, continuation can repeat private analysis
|
|
12
|
-
from the immutable input while retaining previous attempts. A
|
|
12
|
+
from the immutable input while retaining previous attempts. A progressing analyzer can exceed the
|
|
13
|
+
default one-hour wall-clock budget: after verifying that worker has stopped, use `ghidra budgets set
|
|
14
|
+
--initial-import-seconds <seconds>` (up to 86400), then continue the same session/target. No partial
|
|
15
|
+
analysis checkpoint is implied. Terminal progress retains the last native message/counters; a new
|
|
16
|
+
attempt archives the previous observation as `progress-history-<uuid>.json`. A completed snapshot is reused.
|
|
13
17
|
Initial publication first creates a uniquely named staging object. A separate read-only process
|
|
14
18
|
verifies its complete saved DB buffers before a conditional server move to the absent canonical
|
|
15
19
|
path. It never checks in a new version of an existing canonical item. Lost promotion replies
|
|
@@ -41,6 +45,14 @@ A missing/unreadable/mismatched proof stays blocked; never kill by port, basenam
|
|
|
41
45
|
Other platforms retain their existing ownership authentication; this does not claim equivalent
|
|
42
46
|
hang recovery where no independent proof is available. No compiler is required on installation.
|
|
43
47
|
|
|
48
|
+
A bridge/runtime upgrade can also be continued in the original scope. The old immutable
|
|
49
|
+
intent remains retained. Recovery checks input/settings/authority, stopped native ownership
|
|
50
|
+
and publication journals first. Existing canonical research is recovered from its latest
|
|
51
|
+
committed revision through independent exact-version/full-buffer readback; private pending
|
|
52
|
+
edits stay private. A revision change or live checkout blocks adoption. Only an authoritative
|
|
53
|
+
absent path permits a separately journaled preparation under the current verified runtime,
|
|
54
|
+
using the original lock and conditional creation. An unknown publication still freezes recovery.
|
|
55
|
+
|
|
44
56
|
## Interrupted save or close
|
|
45
57
|
|
|
46
58
|
After restoring profile storage, inspect the selected session and target with
|
|
@@ -3,7 +3,7 @@ name: insight-binary
|
|
|
3
3
|
description: Query structured PE, ELF and thin Mach-O headers, sections, imports and exports, or make an explicitly guarded new PE subsystem copy through insight-cli binary. Use for scoped binary structure, linkage and copy-only header edits without target execution.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Insight Binary 0.5.
|
|
6
|
+
# Insight Binary 0.5.7
|
|
7
7
|
|
|
8
8
|
If local help/status reports AppData or IPC access denied, retry that **read-only probe**
|
|
9
9
|
with the agent host's normal permission escalation, then use that route for later authorized
|
|
@@ -3,7 +3,7 @@ name: insight-capture
|
|
|
3
3
|
description: Capture one explicitly authorized native program run, exact stdout/stderr and declared file snapshots through insight-cli capture, then inspect or compare retained reports without replay. Use for controlled input/output research, preserving original files and interrupted or unknown outcomes.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Insight Capture 0.5.
|
|
6
|
+
# Insight Capture 0.5.7
|
|
7
7
|
|
|
8
8
|
If local help/status reports AppData or IPC access denied, retry that **read-only probe**
|
|
9
9
|
with the agent host's normal permission escalation, then use that route for later authorized
|
|
@@ -3,7 +3,7 @@ name: insight-cli
|
|
|
3
3
|
description: Choose and prepare reverse-engineering capabilities from the insight-cli toolbox for binary, managed-code and runtime investigations. Use to discover the appropriate tool or its packaged skill before installing native runtimes.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# insight-cli 0.5.
|
|
6
|
+
# insight-cli 0.5.7
|
|
7
7
|
|
|
8
8
|
If local help/status reports AppData or IPC access denied, retry that **read-only probe**
|
|
9
9
|
with the agent host's normal permission escalation, then use that route for later authorized
|
|
@@ -9,7 +9,11 @@ First-import recovery uses the same scoped `ghidra open` or the original request
|
|
|
9
9
|
Import/analysis writes a private snapshot and completion receipt before any initial publication.
|
|
10
10
|
If its worker is still running, continuation reports busy; wait and continue the same scope.
|
|
11
11
|
If that worker stopped before completing its receipt, continuation can repeat private analysis
|
|
12
|
-
from the immutable input while retaining previous attempts. A
|
|
12
|
+
from the immutable input while retaining previous attempts. A progressing analyzer can exceed the
|
|
13
|
+
default one-hour wall-clock budget: after verifying that worker has stopped, use `ghidra budgets set
|
|
14
|
+
--initial-import-seconds <seconds>` (up to 86400), then continue the same session/target. No partial
|
|
15
|
+
analysis checkpoint is implied. Terminal progress retains the last native message/counters; a new
|
|
16
|
+
attempt archives the previous observation as `progress-history-<uuid>.json`. A completed snapshot is reused.
|
|
13
17
|
Initial publication first creates a uniquely named staging object. A separate read-only process
|
|
14
18
|
verifies its complete saved DB buffers before a conditional server move to the absent canonical
|
|
15
19
|
path. It never checks in a new version of an existing canonical item. Lost promotion replies
|
|
@@ -41,6 +45,14 @@ A missing/unreadable/mismatched proof stays blocked; never kill by port, basenam
|
|
|
41
45
|
Other platforms retain their existing ownership authentication; this does not claim equivalent
|
|
42
46
|
hang recovery where no independent proof is available. No compiler is required on installation.
|
|
43
47
|
|
|
48
|
+
A bridge/runtime upgrade can also be continued in the original scope. The old immutable
|
|
49
|
+
intent remains retained. Recovery checks input/settings/authority, stopped native ownership
|
|
50
|
+
and publication journals first. Existing canonical research is recovered from its latest
|
|
51
|
+
committed revision through independent exact-version/full-buffer readback; private pending
|
|
52
|
+
edits stay private. A revision change or live checkout blocks adoption. Only an authoritative
|
|
53
|
+
absent path permits a separately journaled preparation under the current verified runtime,
|
|
54
|
+
using the original lock and conditional creation. An unknown publication still freezes recovery.
|
|
55
|
+
|
|
44
56
|
## Interrupted save or close
|
|
45
57
|
|
|
46
58
|
After restoring profile storage, inspect the selected session and target with
|