Comments (5)
Hi, Tyler, I'm unable to reproduce this problem based on your description. I'll note that ghidra_bridge has no control over the headless analysis restarting - my guess would be that the most likely issue is something to do with the command you're using to run the analyzeHeadless script.
If you can provide the commands you're using to run analyzeHeadless and the bridge, I can attempt to reproduce the problem to see if it is in fact related to ghidra_bridge.
from ghidra_bridge.
ghidra_9.0.1/support/analyzeHeadless ./ headlessRepo -import ./ lebiniou -scriptPath /ghidra_scripts -postscript ghidra_bridge_server.py &
libinou is my binary name
I dont really understand the 'project' part, so i just made a folder called headlessRepo, so that may be the issue
from ghidra_bridge.
@justfoxing On a side note, is there anyway i can integrate that command above into a shell script? Something like
ghidra_9.0.1/support/analyzeHeadless ./ headlessRepo -import ./ lebiniou -scriptPath /ghidra_scripts -postscript ghidra_bridge_server.py &
&& python useBridge.py $1
&& python endBridge.py
Thats what i have but it isnt working too well. Any thoughts on how to improve that?
from ghidra_bridge.
Yeah, this isn't a ghidra_bridge problem, your command as written is incorrect. The problem is with this part: -import ./ lebiniou
. Note that you have a space between ./ and lebiniou.
If you look at the documentation for analyzeHeadless (as mentioned in the response to your previous issue), you will see that -import can take multiple arguments to import, and that these can be either files or directories. If you import a directory, it will attempt to import every file it finds in that directory.
Because you have -import ./ lebiniou
instead of -import ./lebiniou
, you're telling analyzeHeadless to import everything in ./ as well as ./lebiniou a second time. The ghidra_bridge_server gets run for every file that's imported, so when you send shutdown, it's stopping and analyzeHeadless will import the next file and rerun ghidra_bridge_server on it, which is the issue you're seeing.
analyzeHeadless is complex - I really recommend you take the time to read the documentation and play around with it without ghidra_bridge in the mix to understand how it works. As always, hit up the ghidra project for support with it.
from ghidra_bridge.
WRT your second question, here's the relevant lines in the automated test system for this project:
/opt/ghidra/support/analyzeHeadless /tmp TestProject -import /bin/bash -noanalysis -scriptPath /tmp/ghidra_bridge/test_server -preScript ghidra_bridge_server.py >/tmp/script.log 2>/tmp/script.err & # Run the ghidra_bridge_server in a headless ghidra - we use non-background server, otherwise the script would exit before we could test
( tail -f /tmp/script.err & ) | grep -q "_bridge.bridge:serving!" # pause until we see the ghidra_bridge_server start logging messages
python3 -c "import ghidra_bridge; b = ghidra_bridge.GhidraBridge(namespace=globals()); print(getState().getCurrentAddress())" # run a quick test for ghidra_bridge - we do this before nose, because the last nose test shuts down the bridge
The trickiest part is waiting until the bridge server has been started before attempting to connect to it, which is what the tail/grep combo provides.
from ghidra_bridge.
Related Issues (20)
- Memory.getBytes returns empty array HOT 3
- AttributeError: 'instancemethod' object has no attribute '__len__' (bridge.py", line 974) HOT 5
- PyPI description has three sequential steps all numbered "1" HOT 2
- Timeout value is not configurable in `ghidra_bridge_server.py` HOT 1
- Are you able to write to a ghidra project? HOT 1
- findBytes return an empty Array HOT 1
- Unable to stop auto-analysis for script connected via ghidra_bridge HOT 1
- Expose other IPC channels HOT 1
- How to put arguments in remote_eval?
- setComment causes BridgeException HOT 2
- Cannot inherit bridged classes HOT 1
- Unhashable type _bridged_ghidra.program.database.function.FunctionDB HOT 2
- Bad file descriptor HOT 1
- Socket not closed, when GhidraBridge Object gets out of scope HOT 5
- Timeout Condition HOT 6
- How to remote debug with VSCode? HOT 4
- Windows: Binding on low port blocked by firewall HOT 3
- How to pass arguments to the post script HOT 1
- Question: how does the RPC bridge handle class callbacks? HOT 3
- using in IDE with proper auto completion
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ghidra_bridge.