ASM Resource Util

This commit is contained in:
Konloch 2021-07-06 20:41:49 -07:00
parent 33f524040b
commit 4af4764a71
3 changed files with 6 additions and 6 deletions

View file

@ -2,7 +2,7 @@ package the.bytecode.club.bytecodeviewer.obfuscators;
import org.objectweb.asm.tree.ClassNode; import org.objectweb.asm.tree.ClassNode;
import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.BytecodeViewer;
import the.bytecode.club.bytecodeviewer.api.ASMRenameUtil; import the.bytecode.club.bytecodeviewer.api.ASMResourceUtil;
/*************************************************************************** /***************************************************************************
* Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite *
@ -37,7 +37,7 @@ public class RenameClasses extends JavaObfuscator {
System.out.println("Obfuscating class names..."); System.out.println("Obfuscating class names...");
for (ClassNode c : BytecodeViewer.getLoadedClasses()) { for (ClassNode c : BytecodeViewer.getLoadedClasses()) {
String newName = generateUniqueName(stringLength); String newName = generateUniqueName(stringLength);
ASMRenameUtil.renameClassNode(c.name, newName); ASMResourceUtil.renameClassNode(c.name, newName);
c.name = newName; c.name = newName;
} }

View file

@ -3,7 +3,7 @@ package the.bytecode.club.bytecodeviewer.obfuscators;
import org.objectweb.asm.tree.ClassNode; import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.FieldNode; import org.objectweb.asm.tree.FieldNode;
import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.BytecodeViewer;
import the.bytecode.club.bytecodeviewer.api.ASMRenameUtil; import the.bytecode.club.bytecodeviewer.api.ASMResourceUtil;
/*************************************************************************** /***************************************************************************
* Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite *
@ -40,7 +40,7 @@ public class RenameFields extends JavaObfuscator {
for (Object o : c.fields.toArray()) { for (Object o : c.fields.toArray()) {
FieldNode f = (FieldNode) o; FieldNode f = (FieldNode) o;
String newName = generateUniqueName(stringLength); String newName = generateUniqueName(stringLength);
ASMRenameUtil.renameFieldNode(c.name, f.name, f.desc, null, ASMResourceUtil.renameFieldNode(c.name, f.name, f.desc, null,
newName, null); newName, null);
f.name = newName; f.name = newName;
} }

View file

@ -4,7 +4,7 @@ import org.objectweb.asm.Opcodes;
import org.objectweb.asm.tree.ClassNode; import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.MethodNode; import org.objectweb.asm.tree.MethodNode;
import the.bytecode.club.bytecodeviewer.BytecodeViewer; import the.bytecode.club.bytecodeviewer.BytecodeViewer;
import the.bytecode.club.bytecodeviewer.api.ASMRenameUtil; import the.bytecode.club.bytecodeviewer.api.ASMResourceUtil;
/*************************************************************************** /***************************************************************************
* Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite *
@ -58,7 +58,7 @@ public class RenameMethods extends JavaObfuscator {
if (!m.name.equals("main") && !m.name.equals("<init>") if (!m.name.equals("main") && !m.name.equals("<init>")
&& !m.name.equals("<clinit>")) { && !m.name.equals("<clinit>")) {
String newName = generateUniqueName(stringLength); String newName = generateUniqueName(stringLength);
ASMRenameUtil.renameMethodNode(c.name, m.name, m.desc, ASMResourceUtil.renameMethodNode(c.name, m.name, m.desc,
null, newName, null); null, newName, null);
} }
} }