The unsigned client has a Class.forName() method with two differences:
* The NoClassDefFoundError is created with a slightly different sequence
of instructions.
* The arms of the if/else statement for initializing the synthetic field
if it is null are swapped.
This commit adds support for translating Class.forName() methods with
either or both of these differences to the modern LDC form.
Signed-off-by: Graham <gpe@openrs2.dev>
game_unpacker.dat is the name of the file when downloaded in the
.jagex_cache_32/runescape directory. However, the other files containing
code are all named after the files on the web/JAGGRAB server.
This commit uses unpackclass.pack for consistency with all the other
files.
Signed-off-by: Graham <gpe@openrs2.dev>
This ensures the bundler/deobfuscator can only see classes that are part
of the Java runtime, and not classes from the bundler/deobfuscator
themselves.
Signed-off-by: Graham <gpe@openrs2.dev>
I'm very keen on being able to use the jdk.jartool module (which is only
available in JDK11 onwards) as it allows us to avoid shelling out to
jarsigner entirely.
11 is the current LTS release and is already widespread in Linux
distributions, so I think it's reasonable to require it.
This commit removes the jsobject module. We might need to re-add it in
the future (if jdk.jsobject is removed from the JDK). However, it was
only necessary in 8 because modern versions of 8 tended to be
distributed without plugin.jar. JDK11 is distributed with the
jdk.jsobject module.
Signed-off-by: Graham <gpe@openrs2.dev>
The split is no longer required - we haven't run javah automatically
since splitting the natives out into a separate repository.
Signed-off-by: Graham <gpe@openrs2.dev>
This is a special case, so I've just hard-coded the GlEnum name and
value. Luckily its value is only used in the client in an OpenGL
context.
Signed-off-by: Graham <gpe@openrs2.dev>
It's actually hard to determine whether to use a vendor suffix or not.
For example, the client sometimes uses a bunch of *ARB functions with
_ARB constants. However, it uses the non-_ARB constant with glGetFloat.
It's very hard to fix this inconsistency while still using vendor
suffixes. It seems much easier to just use the constants without the
suffixes all the time.
Signed-off-by: Graham <gpe@openrs2.dev>
Removes GOTO instructions that point to the next instruction, typically
left over from stripping exceptions inserted by the obfuscator.
Although modern decompilers can handle such GOTOs fine, removing them
makes for a nicer IR representation.
Signed-off-by: Major <major@emulate.rs>
It's possible that future versions of ASM will introduce additional
types of virtual node. Only counting real instructions should make this
more reliable.
Signed-off-by: Graham <gpe@openrs2.dev>
While it isn't useful for retaining the name of the constructor itself,
as they don't really have names, it will be useful for tracking argument
names and positions.
Signed-off-by: Graham <gpe@openrs2.dev>
The transformer does _not_ check for use via reflection. The only cases
in the 550 and OSRS clients where methods are accessed via reflection
are either 1) JRE classes, 2) when the method name is sent from the
server.
PSVM and methods declared in TypedRemapper.EXCLUDED_METHODS are never
removed.
Signed-off-by: Major <major@emulate.rs>
Fernflower fails to decompile any exception handler with an end_pc
(`to` in Fernflower nomenclature) equal to the length of the code array,
even though this is permitted in the class file spec. This transformer
inserts a NOP at the end of any code array that has such an exception
handler.
Signed-off-by: Major <major@emulate.rs>