IDEA's test runner doesn't work very well with multi-module projects,
particularly where there are different versions of jars in the
classpath.
Signed-off-by: Graham <gpe@openrs2.dev>
We only need to check for the ACC_FINAL flag once at the start of
transformCode(), given the insn.owner == clazz.name condition. This
change also removes the redundant getNode() call - we already have a
reference to the ClassNode.
Signed-off-by: Graham <gpe@openrs2.dev>
As I'm splitting it up into smaller modules (e.g. compress and crypto) I
think util is a more appropriate name for the remainder.
Signed-off-by: Graham <gpe@openrs2.dev>
This is useful for checking the CRC-32 checksum of files used by the
loader. It outputs the checksum in signed decimal format, which is the
format used in the file name suffixes in the loader (e.g.
unpackclass_-1911426584.pack).
Signed-off-by: Graham <gpe@openrs2.dev>
These are useful for manipulating the files used by the loader, some of
which are compressed with DEFLATE or headerless gzip.
Signed-off-by: Graham <gpe@openrs2.dev>
The non-HD client appears to have been compiled with javac 1.1 or 1.2,
which compiles synchronized blocks differently to modern versions of
Java. For example, it uses a single try/catch block (modern versions use
two, the latter of which is recursive), subroutines (modern versions do
not) and the range of the try block is narrower.
Fernflower doesn't understand this old style of bytecode, and produces
empty synchronized blocks that do not cover the correct range.
The MONITORENTER sequence is also slightly different: it uses
ASTORE ALOAD MONITORENTER after pushing the monitor variable, rather
than DUP ASTORE MONITORENTER. This doesn't break Fernflower, but does
make it introduce a pointless assignment to a variable only used in the
synchronized() statement, rather than inlining the expression.
This commit introduces a transformer which fixes up Java 1.1-style
synchronized blocks just enough for Fernflower to be able to decompile
them cleanly. (It doesn't add a recursive try/catch, as Fernflower
ignores them.)
Signed-off-by: Graham <gpe@openrs2.dev>
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>