Skip to content

A demo late binding Java agent utilising ASM for transforming classes.

Notifications You must be signed in to change notification settings

theoilie/ASM-Late-Bind-Agent

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ASM Late-Binding Agent

A demo late binding Java agent utilising ASM for transforming classes.

A simple library, it has a deliciously simple API for injecting code into already loaded classes.

Compilation

We use Maven to handle our dependencies.

Usage

There are two classes to be concerned with: AgentLoader and Tools. AgentLoader contains the meat of the injector, while Tools holds various IO helpers.

To load an agent, its as simple as:

    Tools.loadAgentLibrary(); // Loads the OS-specific attach library
    // Loads the agent in `Agent.class`, and packages `AgentLoader.class` as a dependency
    AgentLoader.attachAgentToJVM(Tools.getCurrentPID(), Agent.class, AgentLoader.class);

About

A demo late binding Java agent utilising ASM for transforming classes.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%