Skip to content

Function interception

Paul-Antoine Arras edited this page Jan 10, 2019 · 1 revision

Functions to be intercepted have to be registered by the plugin. To this end, a pointer to a registration function is provided by the loader as the third argument to the initialisation function. This registration function shall be called by the plugin once for each function to intercept. It takes a single argument which is a pointer to a structure holding the information about the function to intercept (populated by the plugin):

  • name of the library wherein the function is located
  • name of the function
  • pointer to the intercept callback

The intercept callback takes a single argument, which is a pointer to the intercepted function, and returns a pointer to the user-defined handler. The intercept callback is called by the rewriter when the associated registered function is rewritten.

Clone this wiki locally