Add code implementation for APIHook.cpp