Java Code Examples for org.jf.dexlib2.analysis.AnalyzedInstruction#getPostInstructionRegisterType()

The following examples show how to use org.jf.dexlib2.analysis.AnalyzedInstruction#getPostInstructionRegisterType() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PreInstructionRegisterInfoMethodItem.java    From ZjDroid with Apache License 2.0 6 votes vote down vote up
private void addMergeRegs(BitSet registers, int registerCount) {
    if (analyzedInstruction.getPredecessorCount() <= 1) {
        //in the common case of an instruction that only has a single predecessor which is the previous
        //instruction, the pre-instruction registers will always match the previous instruction's
        //post-instruction registers
        return;
    }

    for (int registerNum=0; registerNum<registerCount; registerNum++) {
        RegisterType mergedRegisterType = analyzedInstruction.getPreInstructionRegisterType(registerNum);

        for (AnalyzedInstruction predecessor: analyzedInstruction.getPredecessors()) {
            RegisterType predecessorRegisterType = predecessor.getPostInstructionRegisterType(registerNum);
            if (predecessorRegisterType.category != RegisterType.UNKNOWN &&
                    !predecessorRegisterType.equals(mergedRegisterType)) {
                registers.set(registerNum);
            }
        }
    }
}
 
Example 2
Source File: PreInstructionRegisterInfoMethodItem.java    From atlas with Apache License 2.0 6 votes vote down vote up
private void addMergeRegs(BitSet registers, int registerCount) {
    if (analyzedInstruction.getPredecessorCount() <= 1) {
        //in the common case of an instruction that only has a single predecessor which is the previous
        //instruction, the pre-instruction registers will always match the previous instruction's
        //post-instruction registers
        return;
    }

    for (int registerNum=0; registerNum<registerCount; registerNum++) {
        RegisterType mergedRegisterType = analyzedInstruction.getPreInstructionRegisterType(registerNum);

        for (AnalyzedInstruction predecessor: analyzedInstruction.getPredecessors()) {
            RegisterType predecessorRegisterType = predecessor.getPostInstructionRegisterType(registerNum);
            if (predecessorRegisterType.category != RegisterType.UNKNOWN &&
                    !predecessorRegisterType.equals(mergedRegisterType)) {
                registers.set(registerNum);
            }
        }
    }
}
 
Example 3
Source File: PreInstructionRegisterInfoMethodItem.java    From zjdroid with Apache License 2.0 6 votes vote down vote up
private void addMergeRegs(BitSet registers, int registerCount) {
    if (analyzedInstruction.getPredecessorCount() <= 1) {
        //in the common case of an instruction that only has a single predecessor which is the previous
        //instruction, the pre-instruction registers will always match the previous instruction's
        //post-instruction registers
        return;
    }

    for (int registerNum=0; registerNum<registerCount; registerNum++) {
        RegisterType mergedRegisterType = analyzedInstruction.getPreInstructionRegisterType(registerNum);

        for (AnalyzedInstruction predecessor: analyzedInstruction.getPredecessors()) {
            RegisterType predecessorRegisterType = predecessor.getPostInstructionRegisterType(registerNum);
            if (predecessorRegisterType.category != RegisterType.UNKNOWN &&
                    !predecessorRegisterType.equals(mergedRegisterType)) {
                registers.set(registerNum);
            }
        }
    }
}
 
Example 4
Source File: PreInstructionRegisterInfoMethodItem.java    From HeyGirl with Apache License 2.0 6 votes vote down vote up
private void addMergeRegs(BitSet registers, int registerCount) {
    if (analyzedInstruction.getPredecessorCount() <= 1) {
        //in the common case of an instruction that only has a single predecessor which is the previous
        //instruction, the pre-instruction registers will always match the previous instruction's
        //post-instruction registers
        return;
    }

    for (int registerNum=0; registerNum<registerCount; registerNum++) {
        RegisterType mergedRegisterType = analyzedInstruction.getPreInstructionRegisterType(registerNum);

        for (AnalyzedInstruction predecessor: analyzedInstruction.getPredecessors()) {
            RegisterType predecessorRegisterType = predecessor.getPostInstructionRegisterType(registerNum);
            if (predecessorRegisterType.category != RegisterType.UNKNOWN &&
                    !predecessorRegisterType.equals(mergedRegisterType)) {
                registers.set(registerNum);
            }
        }
    }
}
 
Example 5
Source File: PreInstructionRegisterInfoMethodItem.java    From ZjDroid with Apache License 2.0 6 votes vote down vote up
private void addMergeRegs(BitSet registers, int registerCount) {
    if (analyzedInstruction.getPredecessorCount() <= 1) {
        //in the common case of an instruction that only has a single predecessor which is the previous
        //instruction, the pre-instruction registers will always match the previous instruction's
        //post-instruction registers
        return;
    }

    for (int registerNum=0; registerNum<registerCount; registerNum++) {
        RegisterType mergedRegisterType = analyzedInstruction.getPreInstructionRegisterType(registerNum);

        for (AnalyzedInstruction predecessor: analyzedInstruction.getPredecessors()) {
            RegisterType predecessorRegisterType = predecessor.getPostInstructionRegisterType(registerNum);
            if (predecessorRegisterType.category != RegisterType.UNKNOWN &&
                    !predecessorRegisterType.equals(mergedRegisterType)) {
                registers.set(registerNum);
            }
        }
    }
}
 
Example 6
Source File: PreInstructionRegisterInfoMethodItem.java    From ZjDroid with Apache License 2.0 5 votes vote down vote up
private void writeFullMerge(IndentingWriter writer, int registerNum) throws IOException {
    registerFormatter.writeTo(writer, registerNum);
    writer.write('=');
    analyzedInstruction.getPreInstructionRegisterType(registerNum).writeTo(writer);
    writer.write(":merge{");

    boolean first = true;

    for (AnalyzedInstruction predecessor: analyzedInstruction.getPredecessors()) {
        RegisterType predecessorRegisterType = predecessor.getPostInstructionRegisterType(registerNum);

        if (!first) {
            writer.write(',');
        }

        if (predecessor.getInstructionIndex() == -1) {
            //the fake "StartOfMethod" instruction
            writer.write("Start:");
        } else {
            writer.write("0x");
            writer.printUnsignedLongAsHex(methodAnalyzer.getInstructionAddress(predecessor));
            writer.write(':');
        }
        predecessorRegisterType.writeTo(writer);

        first = false;
    }
    writer.write('}');
}
 
Example 7
Source File: PreInstructionRegisterInfoMethodItem.java    From atlas with Apache License 2.0 5 votes vote down vote up
private void writeFullMerge(IndentingWriter writer, int registerNum) throws IOException {
    registerFormatter.writeTo(writer, registerNum);
    writer.write('=');
    analyzedInstruction.getPreInstructionRegisterType(registerNum).writeTo(writer);
    writer.write(":merge{");

    boolean first = true;

    for (AnalyzedInstruction predecessor: analyzedInstruction.getPredecessors()) {
        RegisterType predecessorRegisterType = predecessor.getPostInstructionRegisterType(registerNum);

        if (!first) {
            writer.write(',');
        }

        if (predecessor.getInstructionIndex() == -1) {
            //the fake "StartOfMethod" instruction
            writer.write("Start:");
        } else {
            writer.write("0x");
            writer.printUnsignedLongAsHex(methodAnalyzer.getInstructionAddress(predecessor));
            writer.write(':');
        }
        predecessorRegisterType.writeTo(writer);

        first = false;
    }
    writer.write('}');
}
 
Example 8
Source File: PreInstructionRegisterInfoMethodItem.java    From zjdroid with Apache License 2.0 5 votes vote down vote up
private void writeFullMerge(IndentingWriter writer, int registerNum) throws IOException {
    registerFormatter.writeTo(writer, registerNum);
    writer.write('=');
    analyzedInstruction.getPreInstructionRegisterType(registerNum).writeTo(writer);
    writer.write(":merge{");

    boolean first = true;

    for (AnalyzedInstruction predecessor: analyzedInstruction.getPredecessors()) {
        RegisterType predecessorRegisterType = predecessor.getPostInstructionRegisterType(registerNum);

        if (!first) {
            writer.write(',');
        }

        if (predecessor.getInstructionIndex() == -1) {
            //the fake "StartOfMethod" instruction
            writer.write("Start:");
        } else {
            writer.write("0x");
            writer.printUnsignedLongAsHex(methodAnalyzer.getInstructionAddress(predecessor));
            writer.write(':');
        }
        predecessorRegisterType.writeTo(writer);

        first = false;
    }
    writer.write('}');
}
 
Example 9
Source File: PreInstructionRegisterInfoMethodItem.java    From HeyGirl with Apache License 2.0 5 votes vote down vote up
private void writeFullMerge(IndentingWriter writer, int registerNum) throws IOException {
    registerFormatter.writeTo(writer, registerNum);
    writer.write('=');
    analyzedInstruction.getPreInstructionRegisterType(registerNum).writeTo(writer);
    writer.write(":merge{");

    boolean first = true;

    for (AnalyzedInstruction predecessor: analyzedInstruction.getPredecessors()) {
        RegisterType predecessorRegisterType = predecessor.getPostInstructionRegisterType(registerNum);

        if (!first) {
            writer.write(',');
        }

        if (predecessor.getInstructionIndex() == -1) {
            //the fake "StartOfMethod" instruction
            writer.write("Start:");
        } else {
            writer.write("0x");
            writer.printUnsignedLongAsHex(methodAnalyzer.getInstructionAddress(predecessor));
            writer.write(':');
        }
        predecessorRegisterType.writeTo(writer);

        first = false;
    }
    writer.write('}');
}
 
Example 10
Source File: PreInstructionRegisterInfoMethodItem.java    From ZjDroid with Apache License 2.0 5 votes vote down vote up
private void writeFullMerge(IndentingWriter writer, int registerNum) throws IOException {
    registerFormatter.writeTo(writer, registerNum);
    writer.write('=');
    analyzedInstruction.getPreInstructionRegisterType(registerNum).writeTo(writer);
    writer.write(":merge{");

    boolean first = true;

    for (AnalyzedInstruction predecessor: analyzedInstruction.getPredecessors()) {
        RegisterType predecessorRegisterType = predecessor.getPostInstructionRegisterType(registerNum);

        if (!first) {
            writer.write(',');
        }

        if (predecessor.getInstructionIndex() == -1) {
            //the fake "StartOfMethod" instruction
            writer.write("Start:");
        } else {
            writer.write("0x");
            writer.printUnsignedLongAsHex(methodAnalyzer.getInstructionAddress(predecessor));
            writer.write(':');
        }
        predecessorRegisterType.writeTo(writer);

        first = false;
    }
    writer.write('}');
}