Java Code Examples for org.jf.dexlib2.Opcode#INVOKE_DIRECT_RANGE

The following examples show how to use org.jf.dexlib2.Opcode#INVOKE_DIRECT_RANGE . 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: MethodAnalyzer.java    From ZjDroid with Apache License 2.0 6 votes vote down vote up
private void analyzeExecuteInlineRange(@Nonnull AnalyzedInstruction analyzedInstruction) {
    if (inlineResolver == null) {
        throw new AnalysisException("Cannot analyze an odexed instruction unless we are deodexing");
    }

    Instruction3rmi instruction = (Instruction3rmi)analyzedInstruction.instruction;
    Method resolvedMethod = inlineResolver.resolveExecuteInline(analyzedInstruction);

    Opcode deodexedOpcode;
    int acccessFlags = resolvedMethod.getAccessFlags();
    if (AccessFlags.STATIC.isSet(acccessFlags)) {
        deodexedOpcode = Opcode.INVOKE_STATIC_RANGE;
    } else if (AccessFlags.PRIVATE.isSet(acccessFlags)) {
        deodexedOpcode = Opcode.INVOKE_DIRECT_RANGE;
    } else {
        deodexedOpcode = Opcode.INVOKE_VIRTUAL_RANGE;
    }

    Instruction3rc deodexedInstruction = new ImmutableInstruction3rc(deodexedOpcode, instruction.getStartRegister(),
            instruction.getRegisterCount(), resolvedMethod);

    analyzedInstruction.setDeodexedInstruction(deodexedInstruction);
    analyzeInstruction(analyzedInstruction);
}
 
Example 2
Source File: MethodAnalyzer.java    From ZjDroid with Apache License 2.0 6 votes vote down vote up
private void analyzeInvokeObjectInitRange(@Nonnull AnalyzedInstruction analyzedInstruction, boolean analyzeResult) {
    Instruction3rc instruction = (Instruction3rc)analyzedInstruction.instruction;

    Instruction deodexedInstruction;

    int startRegister = instruction.getStartRegister();
    // hack: we should be using instruction.getRegisterCount, but some tweaked versions of dalvik appear
    // to generate invoke-object-init/range instructions with an invalid register count. We know it should
    // always be 1, so just use that.
    int registerCount = 1;
    if (startRegister < 16) {
        deodexedInstruction = new ImmutableInstruction35c(Opcode.INVOKE_DIRECT,
                registerCount, startRegister, 0, 0, 0, 0, instruction.getReference());
    } else {
        deodexedInstruction = new ImmutableInstruction3rc(Opcode.INVOKE_DIRECT_RANGE,
                startRegister, registerCount, instruction.getReference());
    }

    analyzedInstruction.setDeodexedInstruction(deodexedInstruction);

    if (analyzeResult) {
        analyzeInstruction(analyzedInstruction);
    }
}
 
Example 3
Source File: MethodAnalyzer.java    From zjdroid with Apache License 2.0 6 votes vote down vote up
private void analyzeExecuteInlineRange(@Nonnull AnalyzedInstruction analyzedInstruction) {
    if (inlineResolver == null) {
        throw new AnalysisException("Cannot analyze an odexed instruction unless we are deodexing");
    }

    Instruction3rmi instruction = (Instruction3rmi)analyzedInstruction.instruction;
    Method resolvedMethod = inlineResolver.resolveExecuteInline(analyzedInstruction);

    Opcode deodexedOpcode;
    int acccessFlags = resolvedMethod.getAccessFlags();
    if (AccessFlags.STATIC.isSet(acccessFlags)) {
        deodexedOpcode = Opcode.INVOKE_STATIC_RANGE;
    } else if (AccessFlags.PRIVATE.isSet(acccessFlags)) {
        deodexedOpcode = Opcode.INVOKE_DIRECT_RANGE;
    } else {
        deodexedOpcode = Opcode.INVOKE_VIRTUAL_RANGE;
    }

    Instruction3rc deodexedInstruction = new ImmutableInstruction3rc(deodexedOpcode, instruction.getStartRegister(),
            instruction.getRegisterCount(), resolvedMethod);

    analyzedInstruction.setDeodexedInstruction(deodexedInstruction);
    analyzeInstruction(analyzedInstruction);
}
 
Example 4
Source File: MethodAnalyzer.java    From zjdroid with Apache License 2.0 6 votes vote down vote up
private void analyzeInvokeObjectInitRange(@Nonnull AnalyzedInstruction analyzedInstruction, boolean analyzeResult) {
    Instruction3rc instruction = (Instruction3rc)analyzedInstruction.instruction;

    Instruction deodexedInstruction;

    int startRegister = instruction.getStartRegister();
    // hack: we should be using instruction.getRegisterCount, but some tweaked versions of dalvik appear
    // to generate invoke-object-init/range instructions with an invalid register count. We know it should
    // always be 1, so just use that.
    int registerCount = 1;
    if (startRegister < 16) {
        deodexedInstruction = new ImmutableInstruction35c(Opcode.INVOKE_DIRECT,
                registerCount, startRegister, 0, 0, 0, 0, instruction.getReference());
    } else {
        deodexedInstruction = new ImmutableInstruction3rc(Opcode.INVOKE_DIRECT_RANGE,
                startRegister, registerCount, instruction.getReference());
    }

    analyzedInstruction.setDeodexedInstruction(deodexedInstruction);

    if (analyzeResult) {
        analyzeInstruction(analyzedInstruction);
    }
}
 
Example 5
Source File: MethodAnalyzer.java    From HeyGirl with Apache License 2.0 6 votes vote down vote up
private void analyzeExecuteInlineRange(@Nonnull AnalyzedInstruction analyzedInstruction) {
    if (inlineResolver == null) {
        throw new AnalysisException("Cannot analyze an odexed instruction unless we are deodexing");
    }

    Instruction3rmi instruction = (Instruction3rmi)analyzedInstruction.instruction;
    Method resolvedMethod = inlineResolver.resolveExecuteInline(analyzedInstruction);

    Opcode deodexedOpcode;
    int acccessFlags = resolvedMethod.getAccessFlags();
    if (AccessFlags.STATIC.isSet(acccessFlags)) {
        deodexedOpcode = Opcode.INVOKE_STATIC_RANGE;
    } else if (AccessFlags.PRIVATE.isSet(acccessFlags)) {
        deodexedOpcode = Opcode.INVOKE_DIRECT_RANGE;
    } else {
        deodexedOpcode = Opcode.INVOKE_VIRTUAL_RANGE;
    }

    Instruction3rc deodexedInstruction = new ImmutableInstruction3rc(deodexedOpcode, instruction.getStartRegister(),
            instruction.getRegisterCount(), resolvedMethod);

    analyzedInstruction.setDeodexedInstruction(deodexedInstruction);
    analyzeInstruction(analyzedInstruction);
}
 
Example 6
Source File: MethodAnalyzer.java    From HeyGirl with Apache License 2.0 6 votes vote down vote up
private void analyzeInvokeObjectInitRange(@Nonnull AnalyzedInstruction analyzedInstruction, boolean analyzeResult) {
    Instruction3rc instruction = (Instruction3rc)analyzedInstruction.instruction;

    Instruction deodexedInstruction;

    int startRegister = instruction.getStartRegister();
    // hack: we should be using instruction.getRegisterCount, but some tweaked versions of dalvik appear
    // to generate invoke-object-init/range instructions with an invalid register count. We know it should
    // always be 1, so just use that.
    int registerCount = 1;
    if (startRegister < 16) {
        deodexedInstruction = new ImmutableInstruction35c(Opcode.INVOKE_DIRECT,
                registerCount, startRegister, 0, 0, 0, 0, instruction.getReference());
    } else {
        deodexedInstruction = new ImmutableInstruction3rc(Opcode.INVOKE_DIRECT_RANGE,
                startRegister, registerCount, instruction.getReference());
    }

    analyzedInstruction.setDeodexedInstruction(deodexedInstruction);

    if (analyzeResult) {
        analyzeInstruction(analyzedInstruction);
    }
}
 
Example 7
Source File: MethodAnalyzer.java    From ZjDroid with Apache License 2.0 6 votes vote down vote up
private void analyzeExecuteInlineRange(@Nonnull AnalyzedInstruction analyzedInstruction) {
    if (inlineResolver == null) {
        throw new AnalysisException("Cannot analyze an odexed instruction unless we are deodexing");
    }

    Instruction3rmi instruction = (Instruction3rmi)analyzedInstruction.instruction;
    Method resolvedMethod = inlineResolver.resolveExecuteInline(analyzedInstruction);

    Opcode deodexedOpcode;
    int acccessFlags = resolvedMethod.getAccessFlags();
    if (AccessFlags.STATIC.isSet(acccessFlags)) {
        deodexedOpcode = Opcode.INVOKE_STATIC_RANGE;
    } else if (AccessFlags.PRIVATE.isSet(acccessFlags)) {
        deodexedOpcode = Opcode.INVOKE_DIRECT_RANGE;
    } else {
        deodexedOpcode = Opcode.INVOKE_VIRTUAL_RANGE;
    }

    Instruction3rc deodexedInstruction = new ImmutableInstruction3rc(deodexedOpcode, instruction.getStartRegister(),
            instruction.getRegisterCount(), resolvedMethod);

    analyzedInstruction.setDeodexedInstruction(deodexedInstruction);
    analyzeInstruction(analyzedInstruction);
}
 
Example 8
Source File: MethodAnalyzer.java    From ZjDroid with Apache License 2.0 6 votes vote down vote up
private void analyzeInvokeObjectInitRange(@Nonnull AnalyzedInstruction analyzedInstruction, boolean analyzeResult) {
    Instruction3rc instruction = (Instruction3rc)analyzedInstruction.instruction;

    Instruction deodexedInstruction;

    int startRegister = instruction.getStartRegister();
    // hack: we should be using instruction.getRegisterCount, but some tweaked versions of dalvik appear
    // to generate invoke-object-init/range instructions with an invalid register count. We know it should
    // always be 1, so just use that.
    int registerCount = 1;
    if (startRegister < 16) {
        deodexedInstruction = new ImmutableInstruction35c(Opcode.INVOKE_DIRECT,
                registerCount, startRegister, 0, 0, 0, 0, instruction.getReference());
    } else {
        deodexedInstruction = new ImmutableInstruction3rc(Opcode.INVOKE_DIRECT_RANGE,
                startRegister, registerCount, instruction.getReference());
    }

    analyzedInstruction.setDeodexedInstruction(deodexedInstruction);

    if (analyzeResult) {
        analyzeInstruction(analyzedInstruction);
    }
}