#ifndef ELFSPY_HOOK_H #define ELFSPY_HOOK_H #include "elfspy/HookImpl.h" #include "elfspy/GOTEntry.h" #include "elfspy/Function.h" #include "elfspy/MethodInfo.h" #include "elfspy/Thunk.h" #include #include namespace spy { /** * @namespace spy * @class Hook * An instance is a function that is executed after a call to a * function/method and before it is run, essentially injected between the two. * It is very lightweight as it only holds reference(s) to static data members. * Calling convention is unified between methods and functions so that methods * are functions where the first type in Args... is the class type. */ class IHook { public: virtual ~IHook() { std::cout << "HookI" << std::endl; } }; extern std::vector hook_list; void delete_mocks (void); template class Hook : public HookImpl { public: using Result = ReturnType; /** * typedefs to re-export variadic ArgTypes to other variadic templates */ template