diff options
| author | 2015-03-07 16:00:44 -0500 | |
|---|---|---|
| committer | 2015-03-07 16:00:44 -0500 | |
| commit | 59ba32f0285aa6d6b367e6283cae9268e8947fed (patch) | |
| tree | 10bc21f028a2ddd80a761c0e666be20b6e7e45bc /src/cuchaz/enigma/bytecode | |
| parent | added simple renamer for local variable table (diff) | |
| download | enigma-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.java | 7 |
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; | |||
| 3 | import javassist.CtBehavior; | 3 | import javassist.CtBehavior; |
| 4 | import javassist.CtClass; | 4 | import javassist.CtClass; |
| 5 | import javassist.bytecode.ByteArray; | 5 | import javassist.bytecode.ByteArray; |
| 6 | import javassist.bytecode.CodeAttribute; | ||
| 6 | import javassist.bytecode.ConstPool; | 7 | import javassist.bytecode.ConstPool; |
| 7 | import javassist.bytecode.LocalVariableAttribute; | 8 | import 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 | } |