forked from openrs2/openrs2
parent
3dcf91cfef
commit
3db4c82569
@ -0,0 +1,11 @@ |
|||||||
|
package dev.openrs2.asm |
||||||
|
|
||||||
|
import com.fasterxml.jackson.core.JsonParser |
||||||
|
import com.fasterxml.jackson.databind.DeserializationContext |
||||||
|
import com.fasterxml.jackson.databind.deser.std.StdDeserializer |
||||||
|
|
||||||
|
object MemberRefDeserializer : StdDeserializer<MemberRef>(MemberRef::class.java) { |
||||||
|
override fun deserialize(parser: JsonParser, ctx: DeserializationContext): MemberRef { |
||||||
|
return MemberRef.fromString(ctx.readValue(parser, String::class.java)) |
||||||
|
} |
||||||
|
} |
@ -1,9 +1,12 @@ |
|||||||
package dev.openrs2.asm.filter |
package dev.openrs2.asm.filter |
||||||
|
|
||||||
class GlobClassFilter(vararg patterns: String) : ClassFilter { |
import com.fasterxml.jackson.annotation.JsonIgnore |
||||||
private val patterns = patterns.map(Glob::compileClass).toList() |
|
||||||
|
class GlobClassFilter(@Suppress("CanBeParameter") private val patterns: List<String>) : ClassFilter { |
||||||
|
@JsonIgnore |
||||||
|
private val compiledPatterns = patterns.map(Glob::compileClass).toList() |
||||||
|
|
||||||
override fun matches(name: String): Boolean { |
override fun matches(name: String): Boolean { |
||||||
return patterns.any { it.matches(name) } |
return compiledPatterns.any { it.matches(name) } |
||||||
} |
} |
||||||
} |
} |
||||||
|
@ -1,56 +1,12 @@ |
|||||||
package dev.openrs2.deob |
package dev.openrs2.deob |
||||||
|
|
||||||
import dev.openrs2.asm.filter.ClassFilter |
|
||||||
import dev.openrs2.asm.filter.GlobClassFilter |
import dev.openrs2.asm.filter.GlobClassFilter |
||||||
import dev.openrs2.asm.filter.GlobMemberFilter |
import dev.openrs2.asm.filter.GlobMemberFilter |
||||||
import dev.openrs2.asm.filter.MemberFilter |
|
||||||
|
|
||||||
class Profile( |
class Profile( |
||||||
val excludedClasses: ClassFilter, |
val excludedClasses: GlobClassFilter, |
||||||
val excludedMethods: MemberFilter, |
val excludedMethods: GlobMemberFilter, |
||||||
val excludedFields: MemberFilter, |
val excludedFields: GlobMemberFilter, |
||||||
val entryPoints: MemberFilter, |
val entryPoints: GlobMemberFilter, |
||||||
val maxObfuscatedNameLen: Int |
val maxObfuscatedNameLen: Int |
||||||
) { |
) |
||||||
companion object { |
|
||||||
val BUILD_550 = Profile( |
|
||||||
excludedClasses = GlobClassFilter( |
|
||||||
"client", |
|
||||||
"com/sun/opengl/impl/x11/**", |
|
||||||
"jagex3/jagmisc/jagmisc", |
|
||||||
"jaggl/**", |
|
||||||
"javax/media/opengl/**", |
|
||||||
"loader", |
|
||||||
"unpack", |
|
||||||
"unpackclass" |
|
||||||
), |
|
||||||
excludedMethods = GlobMemberFilter( |
|
||||||
"**.<clinit> *", |
|
||||||
"**.<init> *", |
|
||||||
"**.main *", |
|
||||||
"**.providesignlink *", |
|
||||||
"**.quit *", |
|
||||||
"com/sun/opengl/impl/x11/**.* *", |
|
||||||
"jaggl/**.* *", |
|
||||||
"javax/media/opengl/**.* *" |
|
||||||
), |
|
||||||
excludedFields = GlobMemberFilter( |
|
||||||
"**.cache *", |
|
||||||
"com/sun/opengl/impl/x11/**.* *", |
|
||||||
"jaggl/**.* *", |
|
||||||
"javax/media/opengl/**.* *" |
|
||||||
), |
|
||||||
entryPoints = GlobMemberFilter( |
|
||||||
"**.<clinit> *", |
|
||||||
"**.main *", |
|
||||||
"**.providesignlink *", |
|
||||||
"client.<init> *", |
|
||||||
"com/sun/opengl/impl/x11/DRIHack.begin *", |
|
||||||
"com/sun/opengl/impl/x11/DRIHack.end *", |
|
||||||
"loader.<init> *", |
|
||||||
"unpackclass.<init> *" |
|
||||||
), |
|
||||||
maxObfuscatedNameLen = 2 |
|
||||||
) |
|
||||||
} |
|
||||||
} |
|
||||||
|
@ -0,0 +1,15 @@ |
|||||||
|
package dev.openrs2.deob |
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper |
||||||
|
import java.nio.file.Files |
||||||
|
import java.nio.file.Paths |
||||||
|
import javax.inject.Inject |
||||||
|
import javax.inject.Provider |
||||||
|
|
||||||
|
class ProfileProvider @Inject constructor(private val mapper: ObjectMapper) : Provider<Profile> { |
||||||
|
override fun get(): Profile { |
||||||
|
return Files.newBufferedReader(Paths.get("share/deob/profile.yaml")).use { reader -> |
||||||
|
mapper.readValue(reader, Profile::class.java) |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,34 @@ |
|||||||
|
--- |
||||||
|
excluded_classes: |
||||||
|
- "client" |
||||||
|
- "com/sun/opengl/impl/x11/**" |
||||||
|
- "jagex3/jagmisc/jagmisc" |
||||||
|
- "jaggl/**" |
||||||
|
- "javax/media/opengl/**" |
||||||
|
- "loader" |
||||||
|
- "unpack" |
||||||
|
- "unpackclass" |
||||||
|
excluded_methods: |
||||||
|
- "**.<clinit> *" |
||||||
|
- "**.<init> *" |
||||||
|
- "**.main *" |
||||||
|
- "**.providesignlink *" |
||||||
|
- "**.quit *" |
||||||
|
- "com/sun/opengl/impl/x11/**.* *" |
||||||
|
- "jaggl/**.* *" |
||||||
|
- "javax/media/opengl/**.* *" |
||||||
|
excluded_fields: |
||||||
|
- "**.cache *" |
||||||
|
- "com/sun/opengl/impl/x11/**.* *" |
||||||
|
- "jaggl/**.* *" |
||||||
|
- "javax/media/opengl/**.* *" |
||||||
|
entry_points: |
||||||
|
- "**.<clinit> *" |
||||||
|
- "**.main *" |
||||||
|
- "**.providesignlink *" |
||||||
|
- "client.<init> *" |
||||||
|
- "com/sun/opengl/impl/x11/DRIHack.begin *" |
||||||
|
- "com/sun/opengl/impl/x11/DRIHack.end *" |
||||||
|
- "loader.<init> *" |
||||||
|
- "unpackclass.<init> *" |
||||||
|
max_obfuscated_name_len: 2 |
Loading…
Reference in new issue