Tag Archives: hooking

Custom prolog and epilog for a function in C++

Traditionally, the compiler is responsible for creating the prolog and epilog of a function. However, custom prolog and epilog code can be written if a function has been declared with the naked attribute. The snippet below demonstrates a naked function with custom prolog and epilog code. __declspec(naked) void foo(){ // Prolog __asm { push ebp [...]

Posted in Assembler, C++ | Also tagged , , , , , , , , , , , , , | Leave a comment

Hooking with the Microsoft Detours library in C++

The DLL Injection example described how to inject a DLL into an existing process. The snippets below demonstrate a combination of hooking and DLL injection in C++ with the Microsoft Detours library. Quote: In computer programming, the term hooking covers a range of techniques used to alter or augment the behavior of an operating system, [...]

Posted in C++ | Also tagged , , , , , , , , , , , , , , , | 5 Comments