Comments (5)
So, this is implemented in ./Ghidra/Features/Python/data/python-src/ghidradoc.py
. Bridging the Helper class will probably not work because it might just end up printing on the wrong side of the bridge.
Given that the information is just loaded from a zipfile (GhidraAPI_javadoc.zip
) I see two options:
- Some way to request the information over the bridge
- Just getting the path and checking if the file exists on the client side too and using that
To avoid confusion I would suggest adding a bridge specific help function to get the doc for a bridged object that works in a similar way as the builtin. So help(currentProgram)
still gives the doc for the BridgedObject class but b.help(currentProgram)
returns the doc for the ProgramDB class gathered from the ghidra docs.
This still leaves the issue of controlling the IPython magic for currentProgram?
, but the Attribute Errors in the bridge server indicate that a few things are being checked, one of them being getdoc
which might be something that can be implemented properly.
from ghidra_bridge.
I've got a pretty smooth implementation that hooks print
on the ghidra side to capture the output from the Helper class as a string and return that (much easier than trying to re-implement their code and finding the right file to run it against).
BridgedObjects are meant to be as transparent as possible, so I'm not keen on them having their own help, especially at the cost of being harder to get help for the Ghidra objects that people will actually care about. So, my implementation just straight up replaces help()
and punts help for bridged objects across the bridge. Check out feature-ghidra-help for a sneak preview - I still want to come up with some tests before I merge that.
Not sure about the ipython magic, but I'll take a look at those errors.
from ghidra_bridge.
Nice this does seem like a good start. One thing I am missing is that the output is not paged, which is fairly annoying for long output. The only change necessary would probably be print(help_output)
to whatever makes the output paged.
I might be able to look into the IPython ?
magic today.
In general I think that the approach of working with the JSON instead of the parsed and pretty printed output could be better though, if we can use it to populate whatever variables the inspect
modules checks this could allow for more powerful introspection in IPython e.g. suggestion of (optional) parameters. I will play around with this and see if I can make it work.
Your approach bridging help is entirely sufficient though for the typical use, so I am in favor of merging that and not waiting for all the IPython specific stuff.
from ghidra_bridge.
For paged output you can use pydoc.pager(help_output)
from ghidra_bridge.
Fixed by 9c1c7a0
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.