forked from openrs2/openrs2
Signed-off-by: Graham <gpe@openrs2.org>
parent
70b35216c9
commit
e18d751125
@ -0,0 +1,15 @@ |
||||
<component name="ProjectRunConfigurationManager"> |
||||
<configuration default="false" name="Deobfuscator" type="JetRunConfigurationType"> |
||||
<module name="openrs2.deob.main" /> |
||||
<option name="VM_PARAMETERS" value="-Xmx3G" /> |
||||
<option name="PROGRAM_PARAMETERS" value="" /> |
||||
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" /> |
||||
<option name="ALTERNATIVE_JRE_PATH" /> |
||||
<option name="PASS_PARENT_ENVS" value="true" /> |
||||
<option name="MAIN_CLASS_NAME" value="org.openrs2.deob.DeobfuscateCommandKt" /> |
||||
<option name="WORKING_DIRECTORY" value="" /> |
||||
<method v="2"> |
||||
<option name="Make" enabled="true" /> |
||||
</method> |
||||
</configuration> |
||||
</component> |
@ -0,0 +1,34 @@ |
||||
plugins { |
||||
`maven-publish` |
||||
application |
||||
kotlin("jvm") |
||||
} |
||||
|
||||
application { |
||||
mainClass.set("org.openrs2.deob.DeobfuscateCommandKt") |
||||
applicationDefaultJvmArgs = listOf("-Xmx3G") |
||||
} |
||||
|
||||
dependencies { |
||||
api("com.github.ajalt.clikt:clikt:${Versions.clikt}") |
||||
|
||||
implementation(project(":decompiler")) |
||||
implementation(project(":deob-ast")) |
||||
implementation(project(":deob-bytecode")) |
||||
} |
||||
|
||||
publishing { |
||||
publications.create<MavenPublication>("maven") { |
||||
from(components["java"]) |
||||
|
||||
pom { |
||||
packaging = "jar" |
||||
name.set("OpenRS2 Deobfuscator") |
||||
description.set( |
||||
""" |
||||
A tool for deobfuscating and decompiling the RuneScape client. |
||||
""".trimIndent() |
||||
) |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,14 @@ |
||||
package org.openrs2.deob |
||||
|
||||
import com.github.ajalt.clikt.core.CliktCommand |
||||
import com.google.inject.Guice |
||||
|
||||
public fun main(args: Array<String>): Unit = DeobfuscateCommand().main(args) |
||||
|
||||
public class DeobfuscateCommand : CliktCommand(name = "deob") { |
||||
override fun run() { |
||||
val injector = Guice.createInjector(DeobfuscatorModule) |
||||
val deobfuscator = injector.getInstance(Deobfuscator::class.java) |
||||
deobfuscator.run() |
||||
} |
||||
} |
@ -0,0 +1,35 @@ |
||||
package org.openrs2.deob |
||||
|
||||
import com.github.michaelbull.logging.InlineLogger |
||||
import org.openrs2.decompiler.Decompiler |
||||
import org.openrs2.deob.ast.AstDeobfuscator |
||||
import org.openrs2.deob.bytecode.BytecodeDeobfuscator |
||||
import org.openrs2.deob.util.Module |
||||
import java.nio.file.Paths |
||||
import javax.inject.Inject |
||||
import javax.inject.Singleton |
||||
|
||||
@Singleton |
||||
public class Deobfuscator @Inject constructor( |
||||
private val bytecodeDeobfuscator: BytecodeDeobfuscator, |
||||
private val decompiler: Decompiler, |
||||
private val astDeobfuscator: AstDeobfuscator |
||||
) { |
||||
public fun run() { |
||||
logger.info { "Deobfuscating bytecode" } |
||||
bytecodeDeobfuscator.run( |
||||
input = Paths.get("nonfree/lib"), |
||||
output = Paths.get("nonfree/var/cache/deob") |
||||
) |
||||
|
||||
logger.info { "Decompiling" } |
||||
decompiler.run(Module.ALL) |
||||
|
||||
logger.info { "Deobfuscating AST" } |
||||
astDeobfuscator.run(Module.ALL) |
||||
} |
||||
|
||||
private companion object { |
||||
private val logger = InlineLogger() |
||||
} |
||||
} |
@ -0,0 +1,12 @@ |
||||
package org.openrs2.deob |
||||
|
||||
import com.google.inject.AbstractModule |
||||
import org.openrs2.deob.ast.AstDeobfuscatorModule |
||||
import org.openrs2.deob.bytecode.BytecodeDeobfuscatorModule |
||||
|
||||
public object DeobfuscatorModule : AbstractModule() { |
||||
override fun configure() { |
||||
install(AstDeobfuscatorModule) |
||||
install(BytecodeDeobfuscatorModule) |
||||
} |
||||
} |
Loading…
Reference in new issue