Skip to content

Commit

Permalink
feat(obf): working v2 string obfuscation
Browse files Browse the repository at this point in the history
  • Loading branch information
terminalsin committed Apr 17, 2024
1 parent e6c2815 commit 919386f
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,7 @@ private void _verify() {
+ "/!\\ Skidfuscator failed to compute some libraries!\n"
+ "It it advised to read https://github.com/terminalsin/skidfuscator-java-obfuscator/wiki/Libraries\n"
+ "\n"
+ "The following class was NOT found. This can be a dependency of a dependency."
+ "Error: " + e.getMessage() + "\n" +
(e.getCause() == null
? "\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import dev.skidfuscator.obfuscator.transform.impl.string.generator.EncryptionGeneratorV3;
import dev.skidfuscator.obfuscator.transform.impl.string.generator.v3.ByteBufferClinitV3EncryptionGenerator;
import dev.skidfuscator.obfuscator.transform.impl.string.generator.v3.BytesClinitV3EncryptionGenerator;
import dev.skidfuscator.obfuscator.transform.impl.string.generator.v3.BytesV3EncryptionGenerator;
import dev.skidfuscator.obfuscator.util.RandomUtil;
import org.mapleir.asm.ClassNode;
import org.mapleir.ir.cfg.ControlFlowGraph;
Expand Down Expand Up @@ -62,15 +63,28 @@ void handle(final RunMethodTransformEvent event) {
EncryptionGeneratorV3 generator = keyMap.get(parentNode);

if (generator == null) {
switch (RandomUtil.nextInt(1)) {
default: {
switch (RandomUtil.nextInt(3)) {
case 0: {
final int size = RandomUtil.nextInt(127) + 1;
final byte[] keys = new byte[size];

for (int i = 0; i < size; i++) {
keys[i] = (byte) (RandomUtil.nextInt(127) + 1);
}
keyMap.put(parentNode, (generator = new BytesV3EncryptionGenerator(keys)));
break;
}
case 1: {
final int size = RandomUtil.nextInt(127) + 1;
final byte[] keys = new byte[size];

for (int i = 0; i < size; i++) {
keys[i] = (byte) (RandomUtil.nextInt(127) + 1);
}
keyMap.put(parentNode, (generator = new BytesClinitV3EncryptionGenerator(keys)));
break;
}
default: {
keyMap.put(parentNode, (generator = new ByteBufferClinitV3EncryptionGenerator()));
break;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package dev.skidfuscator.obfuscator.util;

/**
* Creates and reads a small database of common dependencies.
* This is used to
*/
public class DependencyUtil {
//public
}

0 comments on commit 919386f

Please sign in to comment.