Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
EpicPlayerA10 committed Sep 21, 2024
2 parents e61b0bd + 6d854e9 commit 2921d1b
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import uwu.narumi.deobfuscator.core.other.composed.ComposedZelixTransformer;
import uwu.narumi.deobfuscator.core.other.composed.general.ComposedGeneralFlowTransformer;
import uwu.narumi.deobfuscator.core.other.impl.clean.PeepholeCleanTransformer;
import uwu.narumi.deobfuscator.core.other.impl.clean.peephole.JsrInlinerTransformer;
import uwu.narumi.deobfuscator.core.other.impl.pool.InlineLocalVariablesTransformer;
import uwu.narumi.deobfuscator.core.other.impl.pool.InlineStaticFieldTransformer;
import uwu.narumi.deobfuscator.core.other.impl.universal.UniversalNumberTransformer;
Expand All @@ -29,6 +30,9 @@ protected void registerAll() {
// Test sandbox security (e.g. not allowing dangerous calls)
register("Sandbox security", InputType.JAVA_CODE, List.of(TestSandboxSecurityTransformer::new), Source.of("sandbox/TestSandboxSecurity", false));

// JSR Inlining
register("JSR Inlining", InputType.CUSTOM_CLASS, List.of(JsrInlinerTransformer::new), Source.of("JSR"));

// Samples
register("Some flow obf sample", InputType.CUSTOM_CLASS, List.of(ComposedGeneralFlowTransformer::new), Source.of("FlowObfSample"));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,17 @@ protected void transform(ClassWrapper scope, Context context) throws Exception {

if (isJsr) {
// Inline JSR instructions
methodNode.accept(new JSRInlinerAdapter(
final JSRInlinerAdapter adapter = new JSRInlinerAdapter(
methodNode,
methodNode.access,
methodNode.name,
methodNode.desc,
methodNode.signature,
methodNode.exceptions.toArray(new String[0])
));
);

methodNode.accept(adapter);
classWrapper.methods().set(i, adapter);

markChange();
}
Expand Down
Binary file added testData/compiled/custom-classes/JSR.class
Binary file not shown.
13 changes: 13 additions & 0 deletions testData/results/custom-classes/JSR.dec
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import java.io.PrintStream;

public class TestJSR {
public static void main(String[] var0) {
test(System.out);
}

public static void test(PrintStream var0) {
var0.println("In");
Object var1 = null;
var0.println("Out");
}
}

0 comments on commit 2921d1b

Please sign in to comment.