Ejemplo n.º 1
0
 /// <summary>
 /// Installs hook.
 /// </summary>
 /// <param name="link">Link to call back interface i.e. to the method which will be called by makeCallBack method from the hook handler</param>
 public void installHook(InterceptorCallBackInterface link)
 {
     hook = LocalHook.Create(
         LocalHook.GetProcAddress(api_full_name.library_name, api_full_name.api_name),
         createHookDelegate(),
         link);
     Console.WriteLine("Installing hook: " + api_full_name);
     hook.ThreadACL.SetExclusiveACL(new Int32[] { 0 });
 }
Ejemplo n.º 2
0
 public static void setHooks(APIFullName[] list_of_api_names, InterceptorCallBackInterface _call_back)
 {
     lock (sync_object)
     {
         hooks_to_install.UnionWith(list_of_api_names);
         //hooks_to_install.Add(new APIMonLib.Hooks.ntdll.dll.Hook_LdrLoadDll().api_full_name);
         hooks_to_install.ExceptWith(hooks_installed);
     }
     call_back = _call_back;
     checkHooksToInstall();
 }
Ejemplo n.º 3
0
 /// <summary>
 /// This method must be called by hook processing method before
 /// anything. It sets up hook runtime information
 /// </summary>
 protected void preprocessHook()
 {
     callback_interface = (InterceptorCallBackInterface)HookRuntimeInfo.Callback;
 }