summaryrefslogtreecommitdiff
path: root/src/cuchaz/enigma/bytecode
diff options
context:
space:
mode:
authorGravatar jeff2015-03-07 16:00:44 -0500
committerGravatar jeff2015-03-07 16:00:44 -0500
commit59ba32f0285aa6d6b367e6283cae9268e8947fed (patch)
tree10bc21f028a2ddd80a761c0e666be20b6e7e45bc /src/cuchaz/enigma/bytecode
parentadded simple renamer for local variable table (diff)
downloadenigma-fork-59ba32f0285aa6d6b367e6283cae9268e8947fed.tar.gz
enigma-fork-59ba32f0285aa6d6b367e6283cae9268e8947fed.tar.xz
enigma-fork-59ba32f0285aa6d6b367e6283cae9268e8947fed.zip
match/unmatch button works
Diffstat (limited to 'src/cuchaz/enigma/bytecode')
-rw-r--r--src/cuchaz/enigma/bytecode/LocalVariableRenamer.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/cuchaz/enigma/bytecode/LocalVariableRenamer.java b/src/cuchaz/enigma/bytecode/LocalVariableRenamer.java
index 53f207c..c87c25b 100644
--- a/src/cuchaz/enigma/bytecode/LocalVariableRenamer.java
+++ b/src/cuchaz/enigma/bytecode/LocalVariableRenamer.java
@@ -3,6 +3,7 @@ package cuchaz.enigma.bytecode;
3import javassist.CtBehavior; 3import javassist.CtBehavior;
4import javassist.CtClass; 4import javassist.CtClass;
5import javassist.bytecode.ByteArray; 5import javassist.bytecode.ByteArray;
6import javassist.bytecode.CodeAttribute;
6import javassist.bytecode.ConstPool; 7import javassist.bytecode.ConstPool;
7import javassist.bytecode.LocalVariableAttribute; 8import javassist.bytecode.LocalVariableAttribute;
8 9
@@ -13,7 +14,11 @@ public class LocalVariableRenamer {
13 for (CtBehavior behavior : c.getDeclaredBehaviors()) { 14 for (CtBehavior behavior : c.getDeclaredBehaviors()) {
14 15
15 // if there's a local variable table, just rename everything to v1, v2, v3, ... for now 16 // if there's a local variable table, just rename everything to v1, v2, v3, ... for now
16 LocalVariableAttribute table = (LocalVariableAttribute)behavior.getMethodInfo().getCodeAttribute().getAttribute(LocalVariableAttribute.tag); 17 CodeAttribute codeAttribute = behavior.getMethodInfo().getCodeAttribute();
18 if (codeAttribute == null) {
19 continue;
20 }
21 LocalVariableAttribute table = (LocalVariableAttribute)codeAttribute.getAttribute(LocalVariableAttribute.tag);
17 if (table == null) { 22 if (table == null) {
18 continue; 23 continue;
19 } 24 }