unicorn icon indicating copy to clipboard operation
unicorn copied to clipboard

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

Open BitMaskMixer opened this issue 1 year ago • 0 comments

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 https://github.com/unicorn-engine/unicorn/issues/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 avatar Jul 22 '24 18:07 BitMaskMixer