More flexible tracing output
Something like that like put the module name on the side. Hope you implement this thanks.
This is already implemented?
Yeah, I guess those things make sense to add. So the complete list for this issue would be:
- [ ] Allow only tracing specific regions
- [ ] Print the return address if a
callinstruction is encountered
I only implement features I actually need myself, but you are welcome to give it a shot and make a PR if you choose. The trace function is _hook_code.
This is also (somewhat) related to https://github.com/mrexodia/dumpulator/issues/27.
The return address if you’re executing a call is the next instruction… so cip + insn.size (or whatever capstone uses)
You can surround your code with 3x backtick (`)
The RIP is already in the instruction and it’s an argument to the function as well, you don’t have to read it again
A pull request will be better. That will run the tests and give a clearer overview of what actually changed.
No worries, I’ll get to it. The tracing function is the one you already modified…
I did some initial work on the flexible-tracing branch: https://github.com/mrexodia/dumpulator/commit/bbbc3ca7ba6a70c5416e4b63ab769f5dd87c66fe
Currently the idea is that the user derives from the AbstractTrace class and can implement their own logic inside of the step function. The function dp.set_tracing() can be used to enable/disable tracing.
Some thinking is needed about the interface, it would be nice if the user can enable/disable tracing for sequence events (see #27) and also say 'only trace ranges X/Y/Z'.
Unicorn supports tracing specific ranges, but the annoying thing is that the callbacks will be delivered multiple times. This would need some special logic to work as a user might expect.