Commit Graph
30 Commits
Author SHA1 Message Date
Alexander Kiselev 912cd0137b feat: Add PyGhidra installation support and enhance daemon command handling
- Implemented `install_pyghidra` function to set up PyGhidra in a Python virtual environment for Ghidra installations.
- Enhanced `install_ghidra` to call `install_pyghidra` after Ghidra installation.
- Updated daemon command handling to include program name in start, restart, and stop commands.
- Refactored project path resolution to streamline project management.
- Improved socket path handling to respect `GHIDRA_CLI_SOCKET` environment variable for testing.
- Modified tests to remove ignore flags, allowing for automated testing without Ghidra installation.
- Added analysis step in test project setup to ensure comments and other features work correctly.
2026-01-25 16:39:23 -08:00
Alexander KiselevandClaude Opus 4.5 18592bbd8c docs: Add comprehensive README for v0.1.0 release
Document all features, commands, and usage examples for the
open source release.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 07:10:54 -08:00
Alexander KiselevandClaude Opus 4.5 a1cf872189 feat: Implement all analysis commands with daemon routing
Add complete implementation for all stub commands:
- Symbol operations (list, get, create, rename, delete)
- Type operations (list, get, create, apply)
- Comment operations (list, get, set, delete)
- Graph operations (calls, callers, callees, export)
- Find operations (string, bytes, function, calls, crypto, interesting)
- Diff operations (programs, functions)
- Patch operations (bytes, nop, export)
- Script operations (list, run, python inline)
- Disasm command (disassembly at address)
- Batch operations (execute commands from file)
- Stats command (program statistics)

Fix critical routing bug where new commands fell through to
"Command not yet implemented" instead of being routed to daemon.

Add ExecuteCli IPC command for forwarding CLI commands through daemon.
Add comprehensive integration tests for all new commands.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 07:08:59 -08:00
Alexander Kiselev d23e059168 changes 2026-01-25 05:05:07 -08:00
Alexander KiselevandClaude Opus 4.5 0470caf015 refactor: Remove HeadlessExecutor in favor of daemon-only architecture
HeadlessExecutor spawned a new Ghidra process per command, which was
slow. The daemon maintains a persistent connection and is now the only
way to execute queries.

Changes:
- Delete src/ghidra/headless.rs entirely
- Remove dead handler functions that used HeadlessExecutor:
  - handle_query, handle_function_command, handle_decompile,
  - handle_decompile_impl, handle_strings_command,
  - handle_memory_command, handle_dump_command, handle_summary
- Update handle_quick to inform user about daemon requirement
- Query::execute replaced with Query::process_results for
  post-processing of daemon results

All query commands (function list, decompile, strings, memory, etc.)
now require the daemon to be running. The CLI prints clear instructions
when daemon is not available.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 04:53:30 -08:00
Alexander KiselevandClaude Opus 4.5 3db0af7a3c feat: Add comprehensive E2E test suite and fix CLI argument conflicts
Add E2E test infrastructure:
- DaemonTestHarness for managing daemon lifecycle in tests
- Test fixtures and helpers in tests/common/
- Sample binary fixture for integration tests

Add test coverage:
- command_tests.rs: version, doctor, config commands
- project_tests.rs: project create/list/info/delete, import, analyze
- daemon_tests.rs: daemon start/status/ping/stop/clear-cache
- query_tests.rs: function list, strings, memory, decompile, xref
- unimplemented_tests.rs: 39 tests for graceful error messages

Fix CLI bugs:
- DisasmArgs: rename count to num_instructions (--instructions/-n)
  to avoid conflict with QueryOptions.count
- GraphExportArgs: add unique arg id for format positional to avoid
  conflict with QueryOptions.format

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 04:47:22 -08:00
Alexander KiselevandClaude Opus 4.5 33dc10dcca feat: Implement daemon-only architecture for query operations
This commit implements the daemon-only architecture where all query
operations (functions, strings, decompile, memory, summary, xrefs)
must go through the persistent daemon instead of spawning new Ghidra
processes per command.

Key changes:
- Wire IPC client in main.rs to route queries through daemon
- Add requires_daemon() to determine which commands need daemon
- Add execute_via_daemon() to translate CLI commands to IPC calls
- Deprecate HeadlessExecutor with migration notice
- Fix filter.pest hex number parsing order (hex before number)
- Add #[allow(dead_code)] to infrastructure modules for future use
- Mark E2E tests requiring daemon as #[ignore]

Architecture benefits:
- Faster queries: Ghidra stays loaded, no 5-30s startup per command
- Simpler code: One execution path instead of two
- Better UX: Clear daemon requirement with helpful error messages

When daemon is not running, users see:
  Error: This command requires the daemon to be running.
  Start the daemon with: ghidra daemon start --project <name>

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 03:06:08 -08:00
Alexander KiselevandClaude Opus 4.5 2fe77ac4a2 docs: Rewrite plan for daemon-only architecture
Key changes:
- Remove HeadlessExecutor as execution path
- All query operations require daemon
- Wire IPC layer (already implemented) as primary client
- 9 milestones for complete implementation

Rationale: Binary analysis is slow enough that persistent
daemon is always preferable to per-command process spawning.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 02:24:48 -08:00
Alexander KiselevandClaude Opus 4.5 3335e72b95 docs: Finalize open source release plan with code diffs
Plan covers 7 milestones:
- M1: Fix Cargo.toml repository URL
- M2: Fix unused import warnings (7 files)
- M3: Fix dead code warnings (10 files)
- M4: Implement XRefs query type
- M5: Add XRefs E2E tests
- M6: Expand README.md
- M7: Technical documentation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 02:18:59 -08:00
Alexander KiselevandClaude Opus 4.5 592958f8fe chore: Add open source release plan and update e2e tests
- Add docs/plan-prod.md with comprehensive release plan
- Include sample_binary test fixture
- Update e2e tests

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 01:54:02 -08:00
Alexander Kiselev 5f2ee92bc1 feat: Enable Ghidra decompile script to find functions by name or address, standardize script argument parsing and error output, and add a sample binary fixture. 2026-01-25 01:54:02 -08:00
Alexander Kiselev 370e578cae jython script works? 2026-01-25 01:54:02 -08:00
Alexander KiselevandGitHub 4023ca79bb Merge pull request #5 from akiselev/add-claude-github-actions-1769047291778
Add Claude Code GitHub Workflow
2026-01-21 18:02:03 -08:00
Alexander Kiselev a89b027173 "Claude PR Assistant workflow" 2026-01-21 18:01:33 -08:00
Alexander Kiselev 759dda6c2a refactor notes 2026-01-20 16:19:44 -08:00
Alexander Kiselev 35a864bd2f refactoring to use python bridge and a persistent ghidra 2026-01-20 16:15:02 -08:00
Alexander Kiselev 6b5097463c deleted outdated readme. need to rewrite it later 2026-01-20 12:18:07 -08:00
Alexander Kiselev bd4291795b ghidra setup command 2026-01-20 12:04:00 -08:00
Alexander Kiselev 8344c2b4ed added refactor and setup command plans (Setup first) 2026-01-20 11:55:12 -08:00
Alexander Kiselev de4772b0e5 some fixes, daemon mode still doesnt work 2026-01-12 15:04:28 -08:00
Alexander Kiselev 6be24192a7 fixes 2026-01-12 14:18:52 -08:00
Alexander KiselevandGitHub 7a1d81f5fa Merge pull request #3 from akiselev/claude/implement-background-mode-QpGLP
Implement background mode feature
2026-01-12 14:02:05 -08:00
Claude 847d53f462 Implement proper daemon background mode for Unix and Windows
Add true background daemonization that detaches from terminal and allows the process to continue after terminal closes.

Unix implementation:
- Use daemonize crate for proper fork/detach/setsid
- Redirect stdout/stderr to log file
- Create PID file for process tracking
- Change working directory to root

Windows implementation:
- Spawn detached child process with CREATE_NO_WINDOW flag
- Pass --foreground flag to child to run in foreground internally
- Parent process exits immediately after spawn

Resolves the TODO at main.rs:180 for proper daemonization.
2026-01-12 22:00:03 +00:00
Alexander Kiselev 780601cbee moved stuff 2026-01-12 13:48:15 -08:00
Alexander KiselevandGitHub c2d8b131d6 Merge pull request #2 from akiselev/claude/ghidra-daemon-queue-KQJ1d
Convert Ghidra CLI to daemon with queue system
2026-01-12 13:44:58 -08:00