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

Stack-based string initialization on a single line #6431

Open
Stefan-Radu opened this issue Apr 16, 2024 · 2 comments
Open

Stack-based string initialization on a single line #6431

Stefan-Radu opened this issue Apr 16, 2024 · 2 comments
Assignees
Labels
Feature: Decompiler Status: Triage Information is being gathered Type: Enhancement New feature or request

Comments

@Stefan-Radu
Copy link

Screenshot_20240416_230904

I run into scenarios like the above quite often, which involves some kind of stack-based array. Is there a way to have Ghidra display such an initialization on a single line, as follows:

wchar16 buf[22] = L"69F2a+18d346b/SQ5c65e";

For me at least, having the option would make the decompilation a lot easier on the eyes.

If this feature does not exist, how would one go about implementing it? Thanks!

@astrelsky
Copy link
Contributor

astrelsky commented Apr 17, 2024

It is not currently possible. It's even more painful when it's a pointer because you can't even get that output and are stuck doing mental gymnastics to figure out the value from different sized assignments and concat macros.

Also you're lucky that example is showing the assignments in order.

@EmosewaMC
Copy link

It is not currently possible. It's even more painful when it's a pointer because you can't even get that output and are stuck doing mental gymnastics to figure out the value from different sized assignments and concat macros.

Also you're lucky that example is showing the assignments in order.

Why do those issues exist and what makes stack based strings so difficult to work with?

@ryanmkurtz ryanmkurtz added Type: Enhancement New feature or request Feature: Decompiler Status: Triage Information is being gathered labels Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature: Decompiler Status: Triage Information is being gathered Type: Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants