Open-source multiplayer game server compatible with the RuneScape client
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
openrs2/deob-cli/src/main/java/dev/openrs2/deob/cli/ir/MethodScopedCommand.kt

26 lines
1.0 KiB

package dev.openrs2.deob.cli.ir
import com.github.ajalt.clikt.core.CliktCommand
import com.github.ajalt.clikt.core.requireObject
import com.github.ajalt.clikt.parameters.arguments.argument
import dev.openrs2.deob.cli.DeobfuscatorOptions
import dev.openrs2.deob.ir.Method
import dev.openrs2.deob.ir.translation.BytecodeToIrTranlator
abstract class MethodScopedCommand(command: String) : CliktCommand(name = command) {
val className: String by argument(help = "Fully qualified name of the class name to disassemble")
val methodName: String by argument(help = "Name of the method to print the control flow graph for")
val options by requireObject<DeobfuscatorOptions>()
final override fun run() {
val clazz = PrintCfgCommand.options.classLoader.load(PrintCfgCommand.className)
val method = clazz.methods.find { it.name == PrintCfgCommand.methodName }!!
val decompiler = BytecodeToIrTranlator()
val ir = decompiler.decompile(clazz, method)
run(ir)
}
abstract fun run(method: Method)
}