This improves deobfuscation of a static field initializer in the 667
client that looks like:
a = b = new X()
This transformer translates it to two separate expressions:
b = new X(); a = b
This allows the StaticFieldUnscrambler to move both fields
independently, rather than them both being forced to remain in their
scrambled class.
Signed-off-by: Graham <gpe@openrs2.org>
This is a slightly nicer solution than running a combined transformer
until it reaches a fixed point: we know we'd only need two passes,
rather than an arbitrary number of passes.
The 667 client uses various exception types beyond RuntimeException in
ZKM exception obfuscation handlers, including Throwable, Exception,
EOFException and IOException. This separation also allows us to remove
the type constraint for ZKM handlers.
Signed-off-by: Graham <gpe@openrs2.org>
The build 667 client has some ZKM exception handlers inside Jagex's
exeption tracing handlers. In a single pass, the regex is only capable
of matching the former and not the latter. The ZKM exception handlers
were removed, confusingly leaving Jagex exception handlers that do match
the CATCH_MATCHER regex.
Signed-off-by: Graham <gpe@openrs2.org>
This fixes a bug when deobfuscating the build 225 client, which has code
that looks like a flow obstructor initializer, but it reads an argument
rather than a static variable.
Signed-off-by: Graham <gpe@openrs2.org>
The previous implementation didn't attempt to walk the call graph, so it
wouldn't remove all unused methods.
Closes#127.
Signed-off-by: Graham <gpe@openrs2.org>
This is in preparation for adding a new deob module which invokes the
bytecode deobfuscator, decompiler and AST deobfuscator in turn.
Signed-off-by: Graham <gpe@openrs2.org>