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

CFString Data Renderer #50

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

CFString Data Renderer #50

wants to merge 1 commit into from

Conversation

0cyn
Copy link
Member

@0cyn 0cyn commented Jan 10, 2023

Resolves Vector35/binaryninja-api#5586

Ports cfstring-renderer branch to latest w/ some fixes.

Comment on lines +183 to +190
auto string = reader.ReadString(size);

DisassemblyTextLine line;
line.addr = address;
line.tokens = prefix;
line.tokens.emplace_back(StringToken, "@\"" + string + "\"", dataPointer);
line.tokens.emplace_back(TextToken, ", ");
line.tokens.emplace_back(IntegerToken, std::to_string(size), dataPointer);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have StringDataRenderer in the core which should give you line wrapping, etc. for free. It might make more sense to call the string data renderer on the underlying (null-terminated) string, then insert additional tokens as necessary.

(Yes, I know this code is largely pirated from one of my old branches where I didn't do this...)

@plafosse plafosse self-assigned this Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add data renderer for CFString types
3 participants