Skip to content

MrWrong77/go_hotpatch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Plugin System

The Plugins folder contains the plugin manager (plgmgr) and demo plugins.

Plugin Manager

plgmgr is a plugin manager that should be integrated into the main program.

Demo

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.

About

A go plugin which can hotpatch function and method used in main program

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors