DynamoRIO / DynamoRIO/dynamorio

support replacing app code w/ static code that calls app lib routines but isn't redirected to private libraries

Open
#758 4 comments 0 reactions 0 assignees View on GitHub
Component-API Component-Extension Migrated Priority-Medium Type-Feature
Dominant language
C
Stars
3.2k
Forks
629
Avg merge
2d 15h
Merged PRs (30d)
31

Description

_From [bruen...@google.com](https://code.google.com/u/109494838902877177630/) on April 26, 2012 21:46:41_

filing some feature requests from a while back:

Application code is not allowed to use the DR API (it will raise an error).
It is also not allowed to call private library routines. If you use static
code in the client library, any library calls you make will be redirected
to private libraries, which is not what you want. To replace an app
function with a piece of code of your own construction that calls
application libraries, one method is to have a static template whose calls
are updated dynamically to have application targets. For anything really
extensive you'd probably want to have such code, or purely generated code,
load a library (using app loader) that contains your code. We have yet to
have need to replace application functions with anything complicated.

automatic support?

easiest I can come up w/ is to have automatic support for the replacement
code to use the app loader (dlopen via gencode to avoid priv loader
redirect) to load a library, and then client has its app code in a separate
library loaded by app loader

although unlike Windows libdl is not always loaded

Qin: why not just add into LD_PRELOAD to load that library instead?
me: that's only linux and requires an out-of-band solution: have to control starting env vars. won't work on suid apps. etc.

_Original issue: http://code.google.com/p/dynamorio/issues/detail?id=758_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.