Skip to content
This repository has been archived by the owner on Jun 8, 2022. It is now read-only.

A Kotlin / Java library for modifying classes at runtime using ASM

License

Notifications You must be signed in to change notification settings

stardust-enterprises/injector

 
 

Repository files navigation

Injector

Injector is a Kotlin / Java library for modifying classes at runtime using ASM

Installation

repositories {
    mavenCentral()
    
    // Required for Koffee, which is a dependency of Injector
    maven("https://maven.hackery.site/")
    
    // Required to retrieve Injector from GitHub
    maven("https://jitpack.io/")
}

dependencies {
    implementation("com.github.cbyrneee:Injector:latest-commit-hash")
}

Usage

Example.kt

fun run() {
    injectMethod<Test>("Test", "main", "()V") { (params, fields, returnInfo) -> // this: Test ->
        println("Injecting before the first instruction in Test#main and returning!")
        returnInfo.cancel()
    }
    
    Test().main() // will simply return
}

For a full example, check out the example project

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please update the example project if making a major change.

License

GPL 3.0

About

A Kotlin / Java library for modifying classes at runtime using ASM

Resources

License

Stars

Watchers

Forks

Languages

  • Kotlin 85.1%
  • Java 14.9%