cutter-plugins
cutter-plugins copied to clipboard
CyberCutter - contents vizualization
Something in the spirit of https://github.com/patois/IDACyber
Seems this code can be adopted (license is MIT) https://github.com/kentavv/binary_viewer
Or Veles (license is Apache 2) https://github.com/codilime/veles
Very nice! Would be implemented in a plug-in. Maybe as part of Veles integration
Is there any documentation on the C++ plugin interface? I'd be willing to look into https://github.com/Mahlet-Inc/hobbits/issues/9 if I had some place to start. Seems like it could be pretty easy, but I'd rather not trudge through the code to find the relevant files/concepts.
@hello-adam Take a look at sample-cpp plugin it demonstrates the most important parts you need to know:
- how to create a loadable plugin
- how to create a dockable widget
- how to access information from r2 through cutter
You can also take a look at https://cutter.re/docs/plugins.html#creating-plugins . The example shows how to create a python plugin but API is generated from C++ so doing the same in C++ would be very similar. It can serve you as explanation for C++ example. Cutter coding advices in developer docs are equally relevent for plugins. For more information about querying state read https://cutter.re/docs/api/core/classCutterCore.html . The rest is just is writing code with Qt widgets.
Thanks, @karliss , I'll take a look.
I have a plugin compiling and loading (the examples did not work without some nudging in fedora 30), but I'm a little uncertain about how and when to load the data from CutterCore::ioRead
into a hobbits BitContainer
for the displays. It seems like I should either:
-
Load the whole file whenever it changes (responding to some of the
CutterCore::*Changed
signals?) into aBitContainer
and update the offset whenever I get aCutterCore::seekChanged
. This would be similar to how Hobbits works, but I'm not sure exacly how to load the "whole thing" or even what exactly that would mean in a radare2 context. -
Load the "active segment" into a
BitContainer
in response to everyCutterCore::seekChanged
. Again, not really sure how to get the full size of whatever is currently "active" (that is to say: what is the length parameter for theCutterCore::ioRead
call?) -
EDIT: I guess a third option would be like option 1 except instead of aligning to the current
CutterCore::seekChanged
, one could scroll freely through the file in the hobbits plugin and maybe callCutterCore::seek
from there
This looks like it will be easy once I have a better understanding of the user story and answers to my API questions above.
here's a functioning version of option 2 https://github.com/Mahlet-Inc/hobbits-cutter-plugin
I recommend moving further discussion of hobbits plugin to https://github.com/Mahlet-Inc/hobbits/issues/9 or separate issue in cutter-plugins.
See also:
- https://inside.battelle.org/blog-details/battelle-publishes-open-source-binary-visualization-tool
- https://github.com/Battelle/cantordust