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

Got some time to play around? Here is a sample playground #1980

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

BitMaskMixer
Copy link
Contributor

Debugging is sometimes quite time consuming, especially if you have just a "script" to work on.

The script itself might have a bug, or the binding - or somewhere in between - or is it really Unicorn?
Find it out - with the playground.

Here is a sample (minimal, extendable framework, single file) written in C
to play around to figure out if the bug is inside Unicorn.
Just attach your favorite debugger and step through the code to figure out whats happening.

As an example, I took the #1971 issue to play around.
Only a couple of lines should be needed to convert the python script into C, (you need that for the memory access).
Have a look into the "get_config" method to change the Unicorn specific and platform parameters.

The application sets up hooks and memory to operate on.
It reads a binary file and write it into memory if you provide the filename as argument during start-up of the app.
If no arguments are passed, a default "code chunk" is executed, which only contains invalid instructions to trigger hooks.

For simplicity, there are (almost) no nullptr checks for the pointers.

@BitMaskMixer BitMaskMixer changed the base branch from master to dev July 22, 2024 18:48
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.

1 participant