interposers on Windows

泄露秘密 提交于 2020-01-11 10:35:23

问题


Is it possible to substitute system functions, as is possible on Linux and Solaris using the LD_PRELOAD

For example by setting the environment variable: LD_PRELOAD=/path/to/mymalloc.so

I would have my replacement malloc functions instead of in the C runtime already installed in the system libraries. All other functions in the system dll's would run as normal.


回答1:


Microsoft Research has a library called Detours which allows you to intercept Win32 API calls.

Detours is a library for instrumenting arbitrary Win32 functions on x86, x64, and IA64 machines. Detours intercepts Win32 functions by re-writing the in-memory code for target functions. The Detours package also contains utilities to attach arbitrary DLLs and data segments (called payloads) to any Win32 binary.




回答2:


If Detours ( as mentioned previously ) is not an option - then you might take a look at WinAPI Override. It is actively mantained. Note that only 32 bit version is available.



来源:https://stackoverflow.com/questions/1210533/interposers-on-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!