Problem
POST /load is intended to load a binary from an external client, but it's currently blocked by the "binary must already be loaded" gate.
plugin/server/http_server.py do_POST checks _check_binary_loaded() for all paths except /logs and /console.
- As a result,
/load returns 400 {"error": "No binary loaded"} when called in an empty session, making it unusable as a bootstrap endpoint.
Repro
curl -sS -X POST http://localhost:9009/load \
-H "Content-Type: application/json" \
-d "{\"filepath\": \"/path/to/binary\"}"
Proposed fix
- Add
/load to the no-binary-required allowlist in do_POST.
- Execute
BinaryOperations.load_binary(...) on the main thread (e.g., binaryninja.mainthread.execute_on_main_thread_and_wait) to avoid UI/threading issues.
- Define behavior for selecting/attaching the loaded
BinaryView (set binary_ops.current_view) and whether to trigger analysis.
Notes
If /load is kept, document intended usage (UI vs headless) and consider gating (config flag and/or auth token) since it opens files and can be used alongside /console/execute.
Problem
POST /loadis intended to load a binary from an external client, but it's currently blocked by the "binary must already be loaded" gate.plugin/server/http_server.pydo_POSTchecks_check_binary_loaded()for all paths except/logsand/console./loadreturns400 {"error": "No binary loaded"}when called in an empty session, making it unusable as a bootstrap endpoint.Repro
Proposed fix
/loadto the no-binary-required allowlist indo_POST.BinaryOperations.load_binary(...)on the main thread (e.g.,binaryninja.mainthread.execute_on_main_thread_and_wait) to avoid UI/threading issues.BinaryView(setbinary_ops.current_view) and whether to trigger analysis.Notes
If
/loadis kept, document intended usage (UI vs headless) and consider gating (config flag and/or auth token) since it opens files and can be used alongside/console/execute.