-
-
Notifications
You must be signed in to change notification settings - Fork 52
Fix Capstone plugin #110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Capstone plugin #110
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation refers to the alias "cs," but the alias being registered in the code is "cs-dis"
https://hugsy.github.io/gef-extras/commands/capstone-disassemble/
scripts/capstone.py
Outdated
@@ -182,7 +182,7 @@ def do_invoke(self, _: List[str], **kwargs: Any) -> None: | |||
args = kwargs["arguments"] | |||
show_opcodes = args.show_opcodes | |||
length = args.length or gef.config["context.nb_lines_code"] | |||
location = parse_address(args.location) | |||
location = int(gdb.parse_and_eval(args.location).address) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
location = int(gdb.parse_and_eval(args.location).address) | |
location = parse_address(args.location) |
@hugsy int(gdb.parse_and_eval(args.location).address) is not working on my setup (GDB 13.1 Python engine 3.11), with this suggestion cs-dis command works again:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 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 |
But I think this should not happen with the latest change to gef because now loading gef-extras with |
I am using the last version (GEF+EXTRAS) and the problem is still here :\ |
0d773f0
to
0b7041f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on each run capstone is set to false!
dreg@rootkit:~/.config/gef-extras$ git log
commit 0b7041f (HEAD -> fix_capstone_disass_switch, origin/fix_capstone_disass_switch)
Author: hugsy crazy.hugsy@outlook.com
Date: Mon Jun 3 09:51:40 2024 -0700
make dreg happy
commit 296049f (tag: 2024.06, origin/main, origin/HEAD, main)
Author: MinatoTW shaks19jais@gmail.com
Date: Thu May 16 08:39:56 2024 +0530
64bit libc table generator had $r10 as 4th argument (#113)
## Description/Motivation/Screenshots
Fixes `scripts/libc_function_args/tables/generator.py` which was wrong using `$r10` as 4th argument
GEF: (Standalone)
Blob Hash(/home/dreg/.gef-2024.06.py): 88981e223320723f9df39bd8714ea2d56da4dbee
SHA256(/home/dreg/.gef-2024.06.py): 764738509912bea65f67927691d5fa0421444d1969678208095733fdbf0dd83d
GDB: 15.0.50.20240403-git
GDB-Python: 3.12
So Dreg is only partially happy @hugsy :D
This is a different problem to what this PR fixes (and again it can be worked around by doing Different problems. |
Okay, we'll fix it in another PR. Thanks for your patience :D |
hugsy/gef#1118 fixes the problem! thx! |
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
adequate tests have been added.
CONTRIBUTING document.