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

Add support for wrapped formatter hooks #2

Merged
merged 8 commits into from
Oct 4, 2017
Merged

Conversation

th0rex
Copy link
Collaborator

@th0rex th0rex commented Sep 29, 2017

These hooks make it easier to actually print things into a Buffer from rust. There are also some bugfixes in this PR, see the first commit message for more detail.

These functions make it easier for the rust code to use the formatter hooks, since there is no more dealing with a `*mut *mut c_char` and all the pointers are already dereferenced, which means that the hook doesn't need any unsafe blocks (usually).

This commit also fixes some minor bugs that were undetected until now (i.e. Hook::FuncPrintDecorator had the wrong type and transmuted it which could lead to crashes).

The only thing left to do would be to decide whether we actually pass mutable reference to instances of ZydisDecodedInstruction and ZydisDecodedOperand. That would allow setting the user context, for which I don't really see a use case.
@th0rex th0rex changed the title Add supported for wrapped formatter hooks Add support for wrapped formatter hooks Sep 29, 2017
@athre0z athre0z merged commit d014f0b into zyantific:master Oct 4, 2017
@athre0z
Copy link
Member

athre0z commented Oct 4, 2017

Merged, ty!

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.

None yet

2 participants