dumpulator icon indicating copy to clipboard operation
dumpulator copied to clipboard

More flexible tracing output

Open NewAccount777 opened this issue 2 years ago • 14 comments

image Something like that like put the module name on the side. Hope you implement this thanks.

NewAccount777 avatar Mar 18 '23 15:03 NewAccount777

This is already implemented?

mrexodia avatar Mar 18 '23 15:03 mrexodia

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 call instruction 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.

mrexodia avatar Mar 18 '23 16:03 mrexodia

The return address if you’re executing a call is the next instruction… so cip + insn.size (or whatever capstone uses)

mrexodia avatar Apr 04 '23 07:04 mrexodia

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

mrexodia avatar Apr 04 '23 08:04 mrexodia

A pull request will be better. That will run the tests and give a clearer overview of what actually changed.

mrexodia avatar Apr 04 '23 08:04 mrexodia

No worries, I’ll get to it. The tracing function is the one you already modified…

mrexodia avatar Apr 08 '23 07:04 mrexodia

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.

mrexodia avatar Apr 09 '23 08:04 mrexodia