Skip to content

Commit

Permalink
fix: merge pure hash to independent transformer
Browse files Browse the repository at this point in the history
  • Loading branch information
terminalsin committed Dec 7, 2024
1 parent bf6ce5a commit 1208957
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
import dev.skidfuscator.obfuscator.transform.impl.flow.interprocedural.RandomInitTransformer;
import dev.skidfuscator.obfuscator.transform.impl.misc.AhegaoTransformer;
import dev.skidfuscator.obfuscator.transform.impl.number.NumberTransformer;
import dev.skidfuscator.obfuscator.transform.impl.pure.PureHashTransformer;
import dev.skidfuscator.obfuscator.transform.impl.string.StringEncryptionType;
import dev.skidfuscator.obfuscator.transform.impl.string.StringTransformerV2;
import dev.skidfuscator.obfuscator.util.ConsoleColors;
Expand Down Expand Up @@ -684,6 +685,7 @@ public List<Transformer> getTransformers() {
new BasicConditionTransformer(this),
new BasicExceptionTransformer(this),
new BasicRangeTransformer(this),
new PureHashTransformer(this),
/*
new FlatteningFlowTransformer(this),*/
new AhegaoTransformer(this)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public IntegerBlockPredicateRenderer(Skidfuscator skidfuscator, List<Transformer

public static boolean DEBUG = false;

@Listen
@Listen(EventPriority.HIGHEST)
void handle(final InitSkidTransformEvent event) {
final String factoryName = RandomUtil.randomAlphabeticalString(16) + "/" + RandomUtil.randomAlphabeticalString(16);
final SkidClassNode factory = new SkidClassNodeBuilder(skidfuscator)
Expand Down Expand Up @@ -97,13 +97,7 @@ void handle(final InitSkidTransformEvent event) {

skidfuscator.setLegacyHasher(new LegacyHashTransformer(skidfuscator));
skidfuscator.setBitwiseHasher(new BitwiseHashTransformer(skidfuscator));

try {
skidfuscator.setVmHasher(new VmHashTransformer(skidfuscator));
} catch (Exception e) {
e.printStackTrace();
System.exit(1);
}
skidfuscator.setVmHasher(new BitwiseHashTransformer(skidfuscator));
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package dev.skidfuscator.obfuscator.transform.impl.pure;

import dev.skidfuscator.obfuscator.Skidfuscator;
import dev.skidfuscator.obfuscator.event.EventPriority;
import dev.skidfuscator.obfuscator.event.annotation.Listen;
import dev.skidfuscator.obfuscator.event.impl.transform.skid.InitSkidTransformEvent;
import dev.skidfuscator.obfuscator.number.pure.VmHashTransformer;
import dev.skidfuscator.obfuscator.transform.AbstractTransformer;

public class PureHashTransformer extends AbstractTransformer {
public PureHashTransformer(Skidfuscator skidfuscator) {
super(skidfuscator, "Pure Encryption");
}

@Listen
void handle(final InitSkidTransformEvent event) {
skidfuscator.setVmHasher(new VmHashTransformer(skidfuscator));
}
}

0 comments on commit 1208957

Please sign in to comment.