diff --git a/jode/ChangeLog b/jode/ChangeLog index e135202..0bd7efc 100644 --- a/jode/ChangeLog +++ b/jode/ChangeLog @@ -1,3 +1,15 @@ +2001-06-01 Jochen Hoenicke + + * jode/obfuscator/modules/ConstantAnalyzer.java.in: + (analyzeCode): set field listener of RuntimeEnvironment. + (replaceWith): Fixed the invoke_xxx case. + + * jode/obfuscator/ConstantRuntimeEnvironment.java.in: + (getField): add current field listener to field if constant value + was used. + (currentFieldAnalyzer): New field. + (setFieldAnalyzer): New method. + 2001-05-27 Jochen Hoenicke * configure.in: Set version to 1.1. diff --git a/jode/doc/Makefile.am b/jode/doc/Makefile.am index a9a8e7b..fb8aae1 100644 --- a/jode/doc/Makefile.am +++ b/jode/doc/Makefile.am @@ -16,6 +16,9 @@ HTML_FILES = $(PHP_FILES:%.php=$(srcdir)/%.html) noinst_DATA = $(HTML_FILES) EXTRA_DIST = $(PHP_FILES) $(notdir $(HTML_FILES)) \ +header.inc \ +menu.inc \ +footer.inc \ a-logo.gif \ myproject.jos \ dasm_to_java.perl \ diff --git a/jode/jode/obfuscator/ConstantRuntimeEnvironment.java.in b/jode/jode/obfuscator/ConstantRuntimeEnvironment.java.in index fc5346c..59dcb3c 100644 --- a/jode/jode/obfuscator/ConstantRuntimeEnvironment.java.in +++ b/jode/jode/obfuscator/ConstantRuntimeEnvironment.java.in @@ -215,11 +215,16 @@ public class ConstantRuntimeEnvironment extends SimpleRuntimeEnvironment { } private Interpreter interpreter; + private Identifier currentFieldListener; public ConstantRuntimeEnvironment() { interpreter = new Interpreter(this); } + public void setFieldListener(Identifier fl) { + currentFieldListener = fl; + } + public static Object getDefaultValue(String typeSig) { switch(typeSig.charAt(0)) { case 'Z': @@ -247,6 +252,8 @@ public class ConstantRuntimeEnvironment extends SimpleRuntimeEnvironment { = (FieldIdentifier) Main.getClassBundle().getIdentifier(ref); if (fi != null && !fi.isNotConstant()) { Object result = fi.getConstant(); + if (currentFieldListener != null) + fi.addFieldListener(currentFieldListener); if (result == null) result = getDefaultValue(ref.getType()); return result; diff --git a/jode/jode/obfuscator/modules/ConstantAnalyzer.java.in b/jode/jode/obfuscator/modules/ConstantAnalyzer.java.in index 595d1b3..1fa83c6 100644 --- a/jode/jode/obfuscator/modules/ConstantAnalyzer.java.in +++ b/jode/jode/obfuscator/modules/ConstantAnalyzer.java.in @@ -602,7 +602,7 @@ public class ConstantAnalyzer implements Opcodes, CodeAnalyzer { public void handleOpcode(StackLocalInfo info, Identifier fieldListener) { Instruction instr = info.instr; info.constInfo = unknownConstInfo; - + int opcode = instr.getOpcode(); Handler[] handlers = bytecode.getExceptionHandlers(); for (int i=0; i< handlers.length; i++) { @@ -1470,12 +1470,14 @@ public class ConstantAnalyzer implements Opcodes, CodeAnalyzer { firstInfo.instr = (Instruction) bytecode.getInstructions().get(0); firstInfo.instr.setTmpInfo(firstInfo); firstInfo.enqueue(); + runtime.setFieldListener(methodIdent); while (modifiedQueue.first != null) { StackLocalInfo info = modifiedQueue.first; modifiedQueue.first = info.nextOnQueue; info.nextOnQueue = null; handleOpcode(info, methodIdent); } + runtime.setFieldListener(null); Handler[] handlers = bytecode.getExceptionHandlers(); for (int i=0; i< handlers.length; i++) { @@ -1577,12 +1579,17 @@ public class ConstantAnalyzer implements Opcodes, CodeAnalyzer { String[] pt = TypeSignature.getParameterTypes(ref.getType()); int len = pt.length; - if (len > 0) + if (len > 0) { iter.set(new Instruction(TypeSignature.getTypeSize(pt[--len]) + opc_pop - 1)); - else if (instr.getOpcode() != opc_invokestatic) + for (int i = len - 1; i >= 0; i--) + iter.add(new Instruction(TypeSignature.getTypeSize(pt[i]) + + opc_pop - 1)); + if (instr.getOpcode() != opc_invokestatic) + iter.add(new Instruction(opc_pop)); + } else if (instr.getOpcode() != opc_invokestatic) { iter.set(new Instruction(opc_pop)); - else { + } else { if (replacement == null) iter.remove(); else @@ -1590,9 +1597,6 @@ public class ConstantAnalyzer implements Opcodes, CodeAnalyzer { return; } - for (int i = len - 1; i >= 0; i++) - iter.add(new Instruction(TypeSignature.getTypeSize(pt[i]) - + opc_pop - 1)); } } if (replacement != null)