Skip to content
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

Highlight in decompiler view #7

Open
chq-matteo opened this issue Dec 15, 2019 · 4 comments
Open

Highlight in decompiler view #7

chq-matteo opened this issue Dec 15, 2019 · 4 comments

Comments

@chq-matteo
Copy link

Is it possible to highlight the corresponding source code lines in the decompiler view?

@0ffffffffh
Copy link
Owner

it isn't at the moment. actually that's one of my to-do features that I want to implement to the dragondance. https://github.com/0ffffffffh/dragondance#the-features-that-i-want-to-bring-on-it

but i'm not able to do that because the Ghidra does not providing any pseudo code painting API. but I'm trying to find a workaround to achieve this feature. I'm looking at the ghidra source to get some hints for reliable pseudo code paint tricks when I have some free time.

I'm going to mark this issue as a requested feature.

@chq-matteo
Copy link
Author

Yeah, I think that using selection is the only way to highlight at all in the decompiler since it does not support markers.

Maybe it could still be a meaningful improvement?

@0ffffffffh
Copy link
Owner

I'm not sure for now but I can say that it would not fit what we want to get. but it's underlying mechanism might be helpful to find out some way. I'm aware of that. thanks.

@kd5bwt
Copy link

kd5bwt commented Apr 10, 2020

I think selection would be a great improvement but it obviously depends on your goals. Using the scripting API it is pretty easy to make a selection from all code that is colored by Dragon Dance. In this snippet you need to click on the listing where it is colored and then you can run this code to make a selection matching that background color:

from ghidra.app.plugin.core.colorizer import ColorizingService
service = state.getTool().getService(ColorizingService)
ranges = service.getBackgroundColorAddresses(service.getBackgroundColor( currentAddress ) )
setCurrentSelection (ranges)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants