/*
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
* Copyright (c) 2002-2007 Eric Lafortune (eric@graphics.cornell.edu)
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package proguard.optimize.peephole;
import proguard.classfile.constant.*;
import proguard.classfile.instruction.*;
import proguard.classfile.util.InstructionSequenceMatcher;
/**
* This class contains a set of instruction sequences and their suggested
* replacements.
*
* @see InstructionSequencesReplacer
* @author Eric Lafortune
*/
public class InstructionSequenceConstants
{
public static final int X = InstructionSequenceMatcher.X;
public static final int Y = InstructionSequenceMatcher.Y;
public static final int Z = InstructionSequenceMatcher.Z;
public static final int A = InstructionSequenceMatcher.A;
public static final int B = InstructionSequenceMatcher.B;
public static final int C = InstructionSequenceMatcher.C;
public static final int D = InstructionSequenceMatcher.D;
private static final int I_32768 = 0;
private static final int I_65536 = 1;
private static final int I_16777216 = 2;
// private static final int I_0x000000ff
private static final int I_0x0000ff00 = 3;
private static final int I_0x00ff0000 = 4;
private static final int I_0xff000000 = 5;
private static final int I_0x0000ffff = 6;
private static final int I_0xffff0000 = 7;
private static final int L_M1 = 8;
private static final int L_2 = 9;
private static final int L_4 = 10;
private static final int L_8 = 11;
private static final int L_16 = 12;
private static final int L_32 = 13;
private static final int L_64 = 14;
private static final int L_128 = 15;
private static final int L_256 = 16;
private static final int L_512 = 17;
private static final int L_1024 = 18;
private static final int L_2048 = 19;
private static final int L_4096 = 20;
private static final int L_8192 = 21;
private static final int L_16384 = 22;
private static final int L_32768 = 23;
private static final int L_65536 = 24;
private static final int L_16777216 = 25;
private static final int L_4294967296 = 26;
private static final int L_0x00000000ffffffff = 27;
private static final int L_0xffffffff00000000 = 28;
private static final int F_M1 = 29;
private static final int D_M1 = 30;
private static final int FIELD_I = 31;
private static final int FIELD_L = 32;
private static final int FIELD_F = 33;
private static final int FIELD_D = 34;
private static final int NAME_AND_TYPE_I = 35;
private static final int NAME_AND_TYPE_L = 36;
private static final int NAME_AND_TYPE_F = 37;
private static final int NAME_AND_TYPE_D = 38;
private static final int TYPE_I = 39;
private static final int TYPE_L = 40;
private static final int TYPE_F = 41;
private static final int TYPE_D = 42;
public static final Constant[] PATTERN_CONSTANTS = new Constant[]
{
new IntegerConstant(32768),
new IntegerConstant(65536),
new IntegerConstant(16777216),
new IntegerConstant(0x0000ff00),
new IntegerConstant(0x00ff0000),
new IntegerConstant(0xff000000),
new IntegerConstant(0x0000ffff),
new IntegerConstant(0xffff0000),
new LongConstant(-1L),
new LongConstant(2L),
new LongConstant(4L),
new LongConstant(8L),
new LongConstant(16L),
new LongConstant(32L),
new LongConstant(64L),
new LongConstant(128L),
new LongConstant(256L),
new LongConstant(512L),
new LongConstant(1024L),
new LongConstant(2048L),
new LongConstant(4096L),
new LongConstant(8192L),
new LongConstant(16384L),
new LongConstant(32768L),
new LongConstant(65536L),
new LongConstant(16777216L),
new LongConstant(4294967296L),
new LongConstant(0x00000000ffffffffL),
new LongConstant(0xffffffff00000000L),
new FloatConstant(-1f),
new DoubleConstant(-1d),
new FieldrefConstant(X, NAME_AND_TYPE_I, null, null),
new FieldrefConstant(X, NAME_AND_TYPE_L, null, null),
new FieldrefConstant(X, NAME_AND_TYPE_F, null, null),
new FieldrefConstant(X, NAME_AND_TYPE_D, null, null),
new NameAndTypeConstant(Y, TYPE_I),
new NameAndTypeConstant(Y, TYPE_L),
new NameAndTypeConstant(Y, TYPE_F),
new NameAndTypeConstant(Y, TYPE_D),
new Utf8Constant("I"),
new Utf8Constant("J"),
new Utf8Constant("F"),
new Utf8Constant("D"),
};
public static final Instruction[][][] INSTRUCTION_SEQUENCES =
new Instruction[][][]
{
{ // nop = nothing
{
new SimpleInstruction(InstructionConstants.OP_NOP),
},{
// Nothing.
},
},
{ // i = i = nothing
{
new VariableInstruction(InstructionConstants.OP_ILOAD, X),
new VariableInstruction(InstructionConstants.OP_ISTORE, X),
},{
// Nothing.
},
},
{ // l = l = nothing
{
new VariableInstruction(InstructionConstants.OP_LLOAD, X),
new VariableInstruction(InstructionConstants.OP_LSTORE, X),
},{
// Nothing.
},
},
{ // f = f = nothing
{
new VariableInstruction(InstructionConstants.OP_FLOAD, X),
new VariableInstruction(InstructionConstants.OP_FSTORE, X),
},{
// Nothing.
},
},
{ // d = d = nothing
{
new VariableInstruction(InstructionConstants.OP_DLOAD, X),
new VariableInstruction(InstructionConstants.OP_DSTORE, X),
},{
// Nothing.
},
},
{ // a = a = nothing
{
new VariableInstruction(InstructionConstants.OP_ALOAD, X),
new VariableInstruction(InstructionConstants.OP_ASTORE, X),
},{
// Nothing.
},
},
{ // istore/istore = pop/istore
{
new VariableInstruction(InstructionConstants.OP_ISTORE, X),
new VariableInstruction(InstructionConstants.OP_ISTORE, X),
},{
new SimpleInstruction(InstructionConstants.OP_POP),
new VariableInstruction(InstructionConstants.OP_ISTORE, X),
},
},
{ // lstore/lstore = pop2/lstore
{
new
代码混淆工具proguard4.2.rar
需积分: 9 19 浏览量
2008-12-17
22:17:23
上传
评论
收藏 2.07MB RAR 举报
xhf1234
- 粉丝: 6
- 资源: 1
最新资源
- Screenshot_20240427_031602.jpg
- 网页PDF_2024年04月26日 23-46-14_QQ浏览器网页保存_QQ浏览器转格式(6).docx
- 直接插入排序,冒泡排序,直接选择排序.zip
- 在排序2的基础上,再次对快排进行优化,其次增加快排非递归,归并排序,归并排序非递归版.zip
- 实现了7种排序算法.三种复杂度排序.三种nlogn复杂度排序(堆排序,归并排序,快速排序)一种线性复杂度的排序.zip
- 冒泡排序 直接选择排序 直接插入排序 随机快速排序 归并排序 堆排序.zip
- 课设-内部排序算法比较 包括冒泡排序、直接插入排序、简单选择排序、快速排序、希尔排序、归并排序和堆排序.zip
- Python排序算法.zip
- C语言实现直接插入排序、希尔排序、选择排序、冒泡排序、堆排序、快速排序、归并排序、计数排序,并带图详解.zip
- 常用工具集参考用于图像等数据处理
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈