Skip to content

Commit c3b1ceb

Browse files
committed
Auto stash before merge of "master" and "origin/master"
1 parent a3c1248 commit c3b1ceb

File tree

11 files changed

+49
-3
lines changed

11 files changed

+49
-3
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,5 @@ org.mapleir.main/dot/
3030
*.DS_Store
3131

3232
obfuscator/src/test/resources/test-out.jar
33+
34+
obfuscator/src/test/resources/test-bozar.jar

maple-ir/org.mapleir.ir/src/main/java/org/mapleir/ir/code/CodeUnit.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ private Stmt getRootParent0() {
347347
}
348348
}
349349

350-
protected Set<Expr> _enumerate() {
350+
public Set<Expr> _enumerate() {
351351
Set<Expr> set = new HashSet<>();
352352

353353
if(opcode == Opcode.PHI) {

maple-ir/org.mapleir.ir/src/main/java/org/mapleir/ir/code/expr/invoke/InvocationExpr.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
import org.objectweb.asm.MethodVisitor;
99
import org.objectweb.asm.Type;
1010

11+
import java.util.HashSet;
12+
import java.util.Set;
13+
1114
public abstract class InvocationExpr extends Invocation implements IUsesJavaDesc {
1215
public enum CallType {
1316
STATIC, SPECIAL, VIRTUAL, INTERFACE, DYNAMIC
@@ -185,6 +188,17 @@ public boolean equivalent(CodeUnit s) {
185188
return false;
186189
}
187190

191+
@Override
192+
public Set<Expr> _enumerate() {
193+
Set<Expr> set = new HashSet<>();
194+
195+
for (Expr arg : args) {
196+
set.add(arg);
197+
set.addAll(arg._enumerate());
198+
}
199+
return set;
200+
}
201+
188202
@Override
189203
public Expr getPhysicalReceiver() {
190204
if(isStatic()) {

obfuscator/src/main/java/dev/skidfuscator/obfuscator/Skidfuscator.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public Skidfuscator(SkidfuscatorSession session) {
105105
* Runs the execution of the obfuscator.
106106
*/
107107
public void run() {
108-
LOGGER.post("Beginning Skidfuscator Enterprise...");
108+
LOGGER.post("Beginning Skidfuscator Community...");
109109

110110
/*
111111
* Initializes a null skid directory. This skid directory is used as a
@@ -428,6 +428,21 @@ public void run() {
428428
EventBus.register(o);
429429
}
430430
LOGGER.log("Finished loading transformers...");
431+
432+
LOGGER.post("Hot-loading exempt cache...");
433+
int exempt = 0;
434+
try (ProgressBar progressBar = ProgressUtil.progress(hierarchy.getClasses().size())) {
435+
for (ClassNode ccls : hierarchy.getClasses()) {
436+
final SkidClassNode classNode = (SkidClassNode) ccls;
437+
438+
if (exemptAnalysis.isExempt(classNode)) {
439+
exempt++;
440+
}
441+
progressBar.step();
442+
}
443+
}
444+
LOGGER.log("Finished caching " + exempt + " exempted classes...");
445+
431446
LOGGER.post("Executing transformers...");
432447

433448
init();

obfuscator/src/main/java/dev/skidfuscator/obfuscator/SkidfuscatorSession.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ public class SkidfuscatorSession {
2424
* @return the input
2525
*/
2626
public File getInput() {
27-
2827
return input;
2928
}
3029

obfuscator/src/main/java/dev/skidfuscator/obfuscator/exempt/ExclusionHelper.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ public boolean test(ClassNode var) {
8686
&& regex.matcher(var.getName()).find();
8787
}
8888
});
89+
8990
break;
9091
}
9192

obfuscator/src/main/java/dev/skidfuscator/obfuscator/phantom/jghost/Ghost.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ public class Ghost {
1313
private static final Gson GSON = new GsonBuilder()
1414
.setPrettyPrinting()
1515
.disableHtmlEscaping()
16+
.serializeSpecialFloatingPointValues()
1617
.registerTypeAdapter(Type.class, new TypeSerializer())
1718
.create();
1819

obfuscator/src/main/java/dev/skidfuscator/obfuscator/skidasm/expr/SkidConstantExpr.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,9 @@ public SkidConstantExpr(Object cst, Type type, boolean check) {
1515
public SkidConstantExpr(Object cst, Type type) {
1616
super(cst, type);
1717
}
18+
19+
@Override
20+
public ConstantExpr copy() {
21+
return new SkidConstantExpr(this.getConstant(), this.getType(), false);
22+
}
1823
}

obfuscator/src/main/java/dev/skidfuscator/obfuscator/transform/AbstractTransformer.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ public AbstractTransformer(Skidfuscator skidfuscator, String name) {
1414
this(skidfuscator, name, Collections.emptyList());
1515
}
1616

17+
1718
public AbstractTransformer(Skidfuscator skidfuscator, String name, List<Transformer> children) {
1819
this.skidfuscator = skidfuscator;
1920
this.name = name;

obfuscator/src/main/java/dev/skidfuscator/obfuscator/transform/impl/string/StringTransformer.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,17 @@ void handle(final RunMethodTransformEvent event) {
6969
}
7070

7171
cfg.allExprStream()
72+
/*
73+
*
74+
*/
7275
.filter(SkidConstantExpr.class::isInstance)
7376
.map(ConstantExpr.class::cast)
7477
.filter(constantExpr -> constantExpr.getConstant() instanceof String)
78+
/*
79+
* We collect since we're modifying the expression stream
80+
* we kinda need to just not cause any concurrency issue.
81+
* ¯\_(ツ)_/¯
82+
*/
7583
.collect(Collectors.toList())
7684
.forEach(unit -> {
7785
final CodeUnit parent = unit.getParent();

0 commit comments

Comments
 (0)