rizinorg / cutter-plugins

A curated list of Community Plugins and Scripts written for Cutter
264 stars 24 forks source link

CyberCutter - contents vizualization #3

Open XVilka opened 6 years ago

XVilka commented 6 years ago

Something in the spirit of https://github.com/patois/IDACyber

image

image

image

image image

XVilka commented 6 years ago

Seems this code can be adopted (license is MIT) https://github.com/kentavv/binary_viewer

XVilka commented 6 years ago

Or Veles (license is Apache 2) https://github.com/codilime/veles

ITAYC0HEN commented 5 years ago

Very nice! Would be implemented in a plug-in. Maybe as part of Veles integration

hello-adam commented 4 years ago

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.

karliss commented 4 years ago

@hello-adam Take a look at sample-cpp plugin it demonstrates the most important parts you need to know:

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.

hello-adam commented 4 years ago

Thanks, @karliss , I'll take a look.

hello-adam commented 4 years ago

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:

  1. Load the whole file whenever it changes (responding to some of the CutterCore::*Changed signals?) into a BitContainer and update the offset whenever I get a CutterCore::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.
  1. Load the "active segment" into a BitContainer in response to every CutterCore::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 the CutterCore::ioRead call?)

  2. 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 call CutterCore::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.

hello-adam commented 4 years ago

here's a functioning version of option 2 https://github.com/Mahlet-Inc/hobbits-cutter-plugin

karliss commented 4 years ago

I recommend moving further discussion of hobbits plugin to https://github.com/Mahlet-Inc/hobbits/issues/9 or separate issue in cutter-plugins.

XVilka commented 4 years ago

See also: