Graham
0395224000
Simplify removeDeadCode()
...
I think relying on just the isBodyEmpty() check is more correct too, as
the end label of a try/catch is exclusive. Furthermore, we don't want to
delete try/catch nodes where the middle of the body is not dead (even if
the start and end are dead).
Signed-off-by: Graham <gpe@openrs2.dev>
5 years ago
Graham
5c1e630cb8
Add extension method for copying a MethodNode
...
Signed-off-by: Graham <gpe@openrs2.dev>
5 years ago
Graham
95c5ad0ffe
Remove redundant generic type parameter
...
It can be figured out by type inference.
Signed-off-by: Graham <gpe@openrs2.dev>
5 years ago
Graham
81bbc71e29
Allow prePass and postPass to force another pass
5 years ago
Graham
465078256f
Rename common module to util again
...
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>
5 years ago
Graham
177326221f
Move cryptographic code to a separate module
...
Signed-off-by: Graham <gpe@openrs2.dev>
5 years ago
Graham
892d21df10
Add headerless bzip2 and gzip library
...
Signed-off-by: Graham <gpe@openrs2.dev>
5 years ago
Graham
1552b53ace
Update to ASM 8.0
...
Signed-off-by: Graham <gpe@openrs2.dev>
5 years ago
Graham
8e0b480cfb
Replace jarsigner with the jdk.security.jarsigner API
...
Signed-off-by: Graham <gpe@openrs2.dev>
5 years ago
Major
dc36c7835c
Throw exception on invalid try-catch nodes
...
Signed-off-by: Major <major@emulate.rs>
5 years ago
Graham
e7c3afab19
Prevent non-static fields from overriding other fields
...
I think we have the correct behaviour in all cases now: fields will
never override fields. Only non-static methods may override other
methods.
Signed-off-by: Graham <gpe@openrs2.dev>
5 years ago
Graham
e6461176b7
De-duplicate inherited member set creation
...
Signed-off-by: Graham <gpe@openrs2.dev>
5 years ago
Graham
d57cf15bd3
Add superClassAndInterfaces method to reduce duplication
...
Signed-off-by: Graham <gpe@openrs2.dev>
5 years ago
Graham
5103eb15a4
Fix static member overrides in populateInherited{Field,Method}Sets
...
A static member should not override an equivalent member in a superclass
or superinterface. This commit makes us skip the union() calls for
static methods, such that the two disjoint sets are not incorrectly
joined together.
Signed-off-by: Graham <gpe@openrs2.dev>
5 years ago
Graham
8cac7a48b5
Add getFieldAccess
...
Signed-off-by: Graham <gpe@openrs2.dev>
5 years ago
Graham
8b5f3402e2
Rename getAccess to getMethodAccess
...
Signed-off-by: Graham <gpe@openrs2.dev>
5 years ago
Major
a9312f3cd2
Remove empty try-catch blocks in DCE
...
Signed-off-by: Major <major@emulate.rs>
5 years ago
Major
5fa9e9a621
Remove spurious toCollection calls
...
Signed-off-by: Major <major@emulate.rs>
5 years ago
Graham
3a29f61d7c
Remove existing FrameNode manipulation support
...
This code is no longer used. Remove it to avoid bit rot.
Signed-off-by: Graham <gpe@openrs2.dev>
5 years ago
Graham
e6402d52c2
Add StackFrameClassWriter
...
This allows us to avoid needing to worry about manipulating stack frames
in individual transformers, which adds lots of complexity. It's much
easier to just make ASM generate them for us.
Signed-off-by: Graham <gpe@openrs2.dev>
5 years ago
Major
097b334646
Propagate null frame types when remapping
...
Signed-off-by: Major <major@emulate.rs>
5 years ago
Graham
077fda4bab
Remove blank line for consistency
...
Signed-off-by: Graham <gpe@openrs2.dev>
5 years ago
Graham
8ca3f428d2
Remove field.value null check
...
The mapValue() method already accepts and returns nulls.
Signed-off-by: Graham <gpe@openrs2.dev>
5 years ago
Graham
00f0279e15
Use safe call operator
...
Signed-off-by: Graham <gpe@openrs2.dev>
5 years ago
Major
5e32296905
Fix NPE for FrameNodes that aren't NEW/FULL
...
All of the other types have a value of null for their list of
locals/stack elements.
Signed-off-by: Major <major@emulate.rs>
5 years ago
Major
b391191b75
Add error messages to AsmClassMetadata
...
Signed-off-by: Major <major@emulate.rs>
5 years ago
Graham
be14ffdc2d
Add custom Attribute for tracking original instruction indexes
5 years ago
Graham
6464f8dc77
Remap ClassNodes directly
...
This is necessary for a future commit that will track the original
indexes of AbstractInsnNodes throughout the deobfuscator, with the aim
of using this information to track local variables in the decompiled
code.
I suspect this will also improve performance, as we don't need to
re-allocate all of the tree objects.
5 years ago
Major
45bf24c51d
Remove copies in InsnMatcher
...
Signed-off-by: Major <major@emulate.rs>
5 years ago
Graham
70d46e7f64
Sort imports
5 years ago
Graham
bfcb373ade
Add ClassVersionUtils
5 years ago
Graham
fda857963b
Make ClassPath::get() return null if a class is not found
5 years ago
Graham
59ac765ef8
Add method for finding classes loaded with Class.forName()
5 years ago
Graham
34ef4f9a5e
Rename ClassForNameRemapper to ClassForNameUtils
...
A future commit will add functionality beyond remapping.
5 years ago
Graham
cad451d3e1
Make ClassForNameRemapper compatible with packaged classes
5 years ago
Graham
3c7989455b
Add ClassNameExtensions
5 years ago
Graham
c7f5b0b6b3
Replace isNative() with more generic getAccess() method
5 years ago
Graham
7bb1218b42
Add sequential property to AbstractInsnNode
5 years ago
Graham
54aec42f90
Format .kts files
5 years ago
Graham
3f2335859d
Add support for impure expressions to InsnListUtils
5 years ago
Graham
c0da020649
Fix handling of argumentsAndReturnSizes for static methods
5 years ago
Graham
713009470f
Fix NEW StackMetadata
5 years ago
Graham
a0d6a48922
Fix StackMetadata for MethodInsnNodes
5 years ago
Graham
64a9ae33cb
Fix StackMetadata for FieldInsnNodes
5 years ago
Graham
e0d6390f87
Add getSimpleExpression method
5 years ago
Graham
ccbbf873af
Switch from Maven to Gradle
5 years ago
Graham
abf803f017
Replace contains() calls with the in operator
...
These are artifacts of the Java port.
5 years ago
Graham
701b162dec
Remove redundant public modifier
5 years ago
Graham
64abe46971
Replace forEach calls with for loops
...
These are artifacts of the Java port.
5 years ago
Graham
8f3591670b
Use elvis operator in readJar()
5 years ago