Skip to content

A simple Java Agent template with javassist support.

Notifications You must be signed in to change notification settings

evilpan/HookAgent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HookAgent

A simple Java Agent template with javassist support.

Command line example:

# pass hook arguments via agentArgs.
java -Xmx16G --add-opens java.base/java.lang=ALL-UNNAMED -Xverify:none \
     -javaagent:HookAgent.jar=className=com.example.Foo;methodName=bar;methodImplFile=hook.js \
     target.jar
# or pass hook arguments via Properties.
java -Xmx16G --add-opens java.base/java.lang=ALL-UNNAMED -Xverify:none \
     -javaagent:HookAgent.jar \
     -Dhook.className=com.example.Foo \
     -Dhook.methodName=bar \
     -Dhook.methodImplFile=hook.js \
     target.jar

The hook.js example:

{
    System.out.println("[agent-hook] skip check: " + new java.util.Date());
    return 0;
}

About

A simple Java Agent template with javassist support.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages