radareorg / radare2-rlang

Writing Radare2 plugins in various languages
16 stars 7 forks source link

Python bin plugin issues #1

Open aronsky opened 5 years ago

aronsky commented 5 years ago

Several issues in Python's bin plugin (let me know if they should be separated):

  1. The bin_obj object doesn't seem to be very useful. It's not usable in its current state (as it's just set to a C pointer during initialization, instead of being wrapped in a Python object). What is its purpose? The plugin seems to be working fine without it.
  2. PyBinFile_new and PyBinFile_init don't seem to be called, as initialization is done in create_PyBinFile instead... I assume those functions are there for initializing PyBinFile objects in Python, but that doesn't seem to work (unless I'm missing something) since the module isn't properly initialized. Is this code duplication (that can be fixed), or is this WIP?
  3. write_files is incomplete - is it WIP? Also, I think it should be either a module function, or a PyBinFile object method, I'm pretty sure it can't be both.
XVilka commented 5 years ago

This is true. RBin Python plugins are WIP, largely because of the RBin refactoring in radare2 itself. This is why I put it on hold. On the other hand RBin refactoring is still ongoing and progressing very slow, so it might be still useful to remove code duplication and make them work. See RBin Refactoring project in radare2.

See also issue from this repo: https://github.com/radare/radare2-bindings/issues/197

aronsky commented 5 years ago

I see. I will take a deeper look at the project when I have some time, as it's a bit overwhelming right now :)

Meanwhile, I'll make some PRs cleaning up the current code in RBin.

XVilka commented 5 years ago

@aronsky any updates on this?

aronsky commented 5 years ago

Sorry, haven't had the chance yet. The recent updates to radare2/RBin and the switch to MemoryView from a month ago made the current code workable. Will be glad to clean up the code in the future, once I get the time.