hugsy / gef-extras

Extra goodies for GEF to (try to) make GDB suck even less
https://hugsy.github.io/gef-extras
MIT License
148 stars 50 forks source link

Fix Capstone plugin #110

Closed hugsy closed 1 month ago

hugsy commented 2 months ago

Description/Motivation/Screenshots

How Has This Been Tested ?

"Tested" indicates that the PR works and the unit test (i.e. make test) run passes without issue.

Checklist

hugsy commented 2 months ago

The value from the configuration file is not taken into account.

So, capstone-disassemble.use-capstone is always False (on every boot)

here my conf file:

[capstone-disassemble]
use-capstone = True
gef➤  gef config capstone-disassemble.use-capstone 
──────────────────────────────────────── GEF configuration setting: capstone-disassemble.use-capstone ────────────────────────────────────────
capstone-disassemble.use-capstone (bool) = False

Description:
  Replace the GDB disassembler in the `context` with Capstone
gef➤  

@hugsy Is it possible that this issue is happening with more plugins?

This is what I explained to you and partially fixed in #1090

image

All gef-extras settings are impacted

therealdreg commented 2 months ago

The value from the configuration file is not taken into account. So, capstone-disassemble.use-capstone is always False (on every boot) here my conf file:

[capstone-disassemble]
use-capstone = True
gef➤  gef config capstone-disassemble.use-capstone 
──────────────────────────────────────── GEF configuration setting: capstone-disassemble.use-capstone ────────────────────────────────────────
capstone-disassemble.use-capstone (bool) = False

Description:
    Replace the GDB disassembler in the `context` with Capstone
gef➤  

@hugsy Is it possible that this issue is happening with more plugins?

This is what I explained to you and partially fixed in #1090

image

All gef-extras settings are impacted

And what can we do to fix this? I wouldn’t like to release the next version with this issue... And I know you don’t like dirty hacks

hugsy commented 2 months ago

And what can we do to fix this?

gef restore

But I think this should not happen with the latest change to gef because now loading gef-extras with on_changed callback should result in a config reloading.

therealdreg commented 2 months ago

And what can we do to fix this?

gef restore

But I think this should not happen with the latest change to gef because now loading gef-extras with on_changed callback should result in a config reloading.

I am using the last version (GEF+EXTRAS) and the problem is still here :\

therealdreg commented 1 month ago

The command works fine, and the alias is fixed!

image


But on each run capstone is set to false!

image

image

hugsy commented 1 month ago

This is a different problem to what this PR fixes (and again it can be worked around by doing gef restore in your gdbinit) In GEF you can do a PR that will execute gef restore if load_plugins_from_directory() return > 0

Different problems.

therealdreg commented 1 month ago

This is a different problem to what this PR fixes (and again it can be worked around by doing gef restore in your gdbinit) In GEF you can do a PR that will execute gef restore if load_plugins_from_directory() return > 0

Different problems.

Okay, we'll fix it in another PR. Thanks for your patience :D

therealdreg commented 1 month ago

https://github.com/hugsy/gef/pull/1118 fixes the problem! thx!

image