hotpatching

Hooking framework (Detours-like)

こ雲淡風輕ζ 提交于 2019-12-12 09:23:23
问题 I am looking for a C library/framework that allows me to replace functions in memory and redirect them to my own implementations, while still allowing my implementation to call the original implementation. This seems to be a rather rare need on Linux-y systems, presumably because LD_PRELOAD covers most aspects of runtime-function-replacing-thingies. 回答1: The following approach seems to work on applications I have. I don't like proprietary blobs on my machines, so I don't know if it works with

Does MSVC/Win32 guarantee function start address is aligned

独自空忆成欢 提交于 2019-12-11 23:28:01
问题 This question is about hotpatching. The core of hotpatching is to replace the first two bytes instruction with a two bytes short jump instruction. Microsoft guarantees the first instruction of a hotpatchable function is at least two bytes. Let's call it hotpatch point. To ensure the replacing operation is an atomic operation, the address of the hotpatch point must be at least 16-bit aligned, MSDN says nothing about this. So my question is: Does MSVC/Win32 guarantee function start address is