Skip to content

how to use types from std like std::wstring #6497

Answered by emesare
ToufouMaster asked this question in Q&A
Discussion options

You must be logged in to vote

This answer is assuming you have already defined a std::wstring type.

struct `std::wstring` {
	size_t len;
	wchar_t start[1]; // really a length of `len`.
};

struct Test {
	`std::wstring` my_string;
};

Binary Ninja does not support namespaces in type names (the type system was designed around C types). To create and use a type with the :: syntax you must encapsulate the name in a backtick.

Relevant documentation: https://docs.binary.ninja/guide/types/type.html?h=backtick#special-characters

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by plafosse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants