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

On the way to retrieve system state #9

Open
kingsleyluoxin opened this issue Dec 31, 2019 · 1 comment
Open

On the way to retrieve system state #9

kingsleyluoxin opened this issue Dec 31, 2019 · 1 comment

Comments

@kingsleyluoxin
Copy link

I have found DynamoRIO offers rich APIs to operate for instrumentation. I noticed that most of us used drx_buf_insert_buf_store to store the value retrieved. I am wondering about the differences between drx_buf_insert_buf_store and directly saving using file pointer or something like this. Is this for the sake of efficiency?

@toshipiazza
Copy link
Owner

Can you elaborate? Do you mean to insert assembly instrumentation that manipulates a FILE * structure directly, writing values directly into its buffered contents? Or emitting a clean call directly to fprintf?

Alternatively, most of the DR samples follow the same convention as memtrace_simple. These samples call a clean call at the end of every basic block which calls fprintf. This is less complicated since the clean call can manipulate drmgr TLS fields from C instead of directly in assembly. Is this what you're looking for?

This way is also faster than using the drx_buf API, though I ran those performance benchmarks a few years ago on a crummy laptop in a VM. There may have been something wrong with my testing setup or something else may have changed since then.

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

No branches or pull requests

2 participants