Skip to content

feat: add reverse engineering tool integrations - #1279

Closed
dandgabr wants to merge 18 commits into
morluto:mainfrom
dandgabr:feat/upstream-reverse-engineering-tools
Closed

dandgabr wants to merge 18 commits into
morluto:mainfrom
dandgabr:feat/upstream-reverse-engineering-tools

Conversation

@dandgabr

@dandgabr dandgabr commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add provider-backed CLI and MCP support for GNU objdump, GDB, Rizin, and Cutter.
  • Document provider behavior, authority, platform boundaries, setup, and verification lanes.
  • Add automated Cutter CI dispatch and real-provider verification guidance.

Verification

  • npm run build:cached
  • npm run check:fast
  • npm run docs:check
  • Focused provider, MCP, CLI catalog, and composition tests: 7 files, 36 tests passed.
  • Cutter POSIX bridge safety regression and Python syntax check passed.

Real upstream Cutter smoke execution was not run in this environment; CI documents the self-hosted per-OS lane and its limits.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-11T05:48:49.296523Z ce1aa9b New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 168ba252e4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/cutter/CutterBridgeClient.ts Resolved
Comment thread src/gdb/GdbSessionManager.ts Resolved
Comment thread src/gdb/GdbSessionManager.ts Resolved
Comment thread src/gdb/GdbSessionManager.ts Resolved
Comment thread src/gdb/GdbSessionManager.ts Resolved
Comment thread src/gdb/GdbSessionManager.ts Resolved
@dandgabr
dandgabr force-pushed the feat/upstream-reverse-engineering-tools branch from 168ba25 to 6d4710c Compare October 9, 2026 13:32

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7266a8257a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/process/ownedDebuggerSession.ts Resolved
Comment thread src/server/registerCutterTools.ts Resolved
Comment thread src/objdump/ObjdumpCommand.ts Resolved
Comment thread src/domain/hopperValues.ts Resolved
Comment thread src/gdb/GdbSessionManager.ts Resolved
Comment thread src/rizin/RizinDebugSessionManager.ts Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 337923b709

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/gdb/GdbSessionManager.ts Resolved
Comment thread scripts/verify-website.py Resolved
Comment thread src/gdb/GdbSessionManager.ts Resolved
Comment thread src/gdb/GdbSessionManager.ts Resolved
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ce1aa9b515

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

const result: GdbCommandResult = {
command,
mi: "",
records: [...session.lines],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Scope GDB exit fallback to the active command

When a second or later GDB command makes the debugger exit before emitting its token result, session.lines is the global 256-record history and already contains startup and prior-command records. Although this fallback now propagates history truncation, it still attributes those unrelated records (and the derived console/target/log text) to the current command's Evidence; retain the active pending command's bounded lines through the exit rejection and use that command-local capture instead.

AGENTS.md reference: AGENTS.md:L5-L5

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed on this branch. Each pending GDB command now keeps a bounded, command-local MI capture, and the process-exit fallback builds Evidence from that capture instead of session-wide history. The regression includes startup and prior-command records and verifies they are not attributed to the active command, including truncation status.

Comment on lines +358 to +359
if (signal?.aborted || cause instanceof AnalysisCancelledError)
return err(new AnalysisCancelledError("gdb_console", { cause }));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve failed GDB cancellation cleanup

When an AbortSignal fires and stopDebuggerOnly cannot confirm that GDB exited, #request rejects with an AnalysisCapabilityUnavailableError, but the still-aborted signal makes this condition rewrite that failure to AnalysisCancelledError. The remaining unconditional remap is fresh evidence beyond the cancellation-wiring fix: callers are told only that cancellation occurred while the owned debugger and its effects may still be running, so preserve the cleanup failure and only map actual cancellation errors.

AGENTS.md reference: AGENTS.md:L21-L21

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed on this branch. Cancellation handling now preserves the cleanup failure when the owned GDB process cannot be confirmed stopped, even when the signal is already aborted; only an actual cancellation error is translated to AnalysisCancelledError. The regression verifies that callers retain the actionable cleanup failure.

if (!(await session.supervisor.waitForExit(300))) {
session.launched.process.kill("SIGKILL");
if (!(await session.supervisor.waitForExit(1_000))) {
session.supervisor.dispose();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep supervision after an incomplete debugger stop

When a debugger survives the SIGKILL grace period, this branch reports incomplete and closeOwnedDebuggerSessions deliberately retains the session, but dispose() removes the supervisor's exit and diagnostic listeners as though ownership had been released. A later retry cannot observe a newly occurring exit through waitForExit during that attempt and the retained session loses live diagnostics; keep the supervisor attached until a later stop or observed exit actually releases ownership.

AGENTS.md reference: AGENTS.md:L17-L17

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed on this branch. The process supervisor keeps its exit and diagnostic listeners after an incomplete stop, so a later retry can observe the process exit and release ownership exactly once. The regression covers the incomplete stop followed by a successful retry.

expect(started.ok).toBe(true);
if (!started.ok) return;
const timedOut = await manager.execute(started.value.session_id, "slow");
expect(timedOut.ok).toBe(false);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Update the stale Rizin timeout expectation

When this fake provider suppresses the completion marker, the current manager handles RizinCommandTimeoutError by returning successful partial Evidence with unknown completion, so this assertion deterministically fails; the later regression at DebuggerSessionReviewRegressions.test.ts:447 already expects result.ok to be true. The fresh post-fix evidence is this contradictory assertion, which should instead verify the retained partial result and completion_status: "unknown".

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed on this branch. The stale timeout assertion now checks the returned partial observation, retained output, and completion_status: unknown, matching the timeout Evidence contract. The focused provider suite passes.

received = await waitForFrame(session, remaining, signal);
} catch (cause) {
if (cause instanceof AnalysisCancelledError) throw cause;
throw new RizinCommandTimeoutError(output.join("\n"));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve Rizin process-exit reasons

When Rizin exits or crashes while a command is waiting for its next frame, waitForFrame rejects with an exit-specific error, but this blanket conversion turns every non-cancellation failure into RizinCommandTimeoutError. execute therefore reports successful partial Evidence claiming the deadline expired, and its later session.exited branch cannot handle this path; preserve the process-exit reason (and partial output) separately from an actual timer expiry.

AGENTS.md reference: AGENTS.md:L21-L21

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed on this branch. Rizin process exit now has a distinct error path from deadline expiry and returns partial frame output with completion_status: unknown and process-exit-specific Evidence limitations. The regression exits after two partial frames and verifies their newline-joined output in the result and Evidence.

Comment on lines +170 to +174
signalName = capture.signal;
outputTruncated = capture.outputTruncated;
if (code === "ERR_CHILD_PROCESS_STDIO_MAXBUFFER") {
exitCode = null;
completionStatus = "unknown";

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Mark signal-terminated commands as unknown

When a one-shot objdump/Rizin provider crashes or is externally killed by a signal, the captured failure has exit_code: null and a non-null signal, but completion_status remains complete; only the max-buffer code path changes it to unknown. The remaining capture.signal path is fresh evidence beyond the max-buffer fix: for unrestricted mutating Rizin commands this can present a partially executed command as completed and invite an unsafe retry, so signal termination should also produce unknown completion and a corresponding limitation.

AGENTS.md reference: AGENTS.md:L21-L21

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed on this branch. A signal-terminated one-shot provider command now reports completion_status: unknown and records a limitation explaining that execution ended by signal, while retaining captured output. The provider regression covers signal termination.

@morluto

morluto commented Oct 11, 2026

Copy link
Copy Markdown
Owner

I think it'd be better if you could split these into individual PRs so we can evaluate + test the tools!

@dandgabr

Copy link
Copy Markdown
Contributor Author

Agreed. The fixes are implemented and validated locally, with provider-specific coverage and mutation selectors for Cutter and Rizin plus separate GDB, Rizin, and shared-process regressions. The changes are still consolidated on this working branch; I have not pushed them or opened separate PRs yet. I will split the integration changes into individually reviewable PRs before publishing, keeping the shared process-ownership work as the dependency for the debugger-specific PRs.

@dandgabr

dandgabr commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor Author

Update: PR #1279 is closed. Its replacement PRs are open and ready for review:

Review corrections are pushed, and each inline review thread has an English reply. GitHub currently reports all three PRs as mergeable with no conflicts. No CI status checks are reported yet.

The remaining integration branches are pushed to dandgabr/rea; GitHub previously rejected creating their upstream PRs because of a CreatePullRequest permission error. Comparison links:

Latest aggregate validation: 237 tests passed; statements 1007/1007, branches 680/680, functions 166/166, and lines 967/967. The primary mutation run killed all 147 valid mutants, with zero survivors or timeouts (148 generated mutations were rejected by TypeScript compilation). The semantics run killed all 19 valid mutants, also with zero survivors or timeouts (6 compile-invalid mutations).

@dandgabr
dandgabr marked this pull request as draft October 11, 2026 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants