The Plugins
folder contains the plugin manager (plgmgr
) and demo plugins.
plgmgr
is a plugin manager that should be integrated into the main program.
To run the demonstration:
./run_demo.sh
This demo showcases how plugins p1 and p2 replace functions and methods defined in the business package.
Plugin Configuration The Plugins/plugin_version.json file defines plugin information, including names and versions.
Plugin Implementation Each plugin should implement the following function:
func Hook(m map[string]uintptr) {
// m is a map of [functionName]functionPointer
// It is passed by plgmgr and contains all functions in the main program
// These function pointers are generated by the nm tool during initialization
// Use this map to replace functions as needed
}
This Hook function is the entry point for each plugin to modify or replace functions in the main program.