Search in sources :

Example 61 with IOperandTreeNode

use of com.google.security.zynamics.zylib.disassembly.IOperandTreeNode in project binnavi by google.

the class BnllaTranslator method translate.

@Override
public void translate(final ITranslationEnvironment environment, final IInstruction instruction, final List<ReilInstruction> instructions) throws InternalTranslationException {
    TranslationHelpers.checkTranslationArguments(environment, instruction, instructions, "bnlla");
    final IOperandTreeNode addressOperand1 = instruction.getOperands().get(1).getRootNode().getChildren().get(0);
    final IOperandTreeNode BIOperand = instruction.getOperands().get(0).getRootNode().getChildren().get(0);
    BranchGenerator.generate(instruction.getAddress().toLong() * 0x100, environment, instruction, instructions, "bnlla", String.valueOf(Helpers.getCRRegisterIndex(BIOperand.getValue()) * 4), addressOperand1.getValue(), true, false, false, false, true, true);
}
Also used : IOperandTreeNode(com.google.security.zynamics.zylib.disassembly.IOperandTreeNode)

Example 62 with IOperandTreeNode

use of com.google.security.zynamics.zylib.disassembly.IOperandTreeNode in project binnavi by google.

the class BnllrTranslator method translate.

@Override
public void translate(final ITranslationEnvironment environment, final IInstruction instruction, final List<ReilInstruction> instructions) throws InternalTranslationException {
    TranslationHelpers.checkTranslationArguments(environment, instruction, instructions, "bnllr");
    final IOperandTreeNode BIOperand = instruction.getOperands().get(0).getRootNode().getChildren().get(0);
    BranchGenerator.generate(instruction.getAddress().toLong() * 0x100, environment, instruction, instructions, "bnllr", String.valueOf(Helpers.getCRRegisterIndex(BIOperand.getValue()) * 4), Helpers.LINK_REGISTER, false, false, false, false, true, true);
}
Also used : IOperandTreeNode(com.google.security.zynamics.zylib.disassembly.IOperandTreeNode)

Example 63 with IOperandTreeNode

use of com.google.security.zynamics.zylib.disassembly.IOperandTreeNode in project binnavi by google.

the class BnllrlTranslator method translate.

@Override
public void translate(final ITranslationEnvironment environment, final IInstruction instruction, final List<ReilInstruction> instructions) throws InternalTranslationException {
    TranslationHelpers.checkTranslationArguments(environment, instruction, instructions, "bnllrl");
    final IOperandTreeNode BIOperand = instruction.getOperands().get(0).getRootNode().getChildren().get(0);
    BranchGenerator.generate(instruction.getAddress().toLong() * 0x100, environment, instruction, instructions, "bnllrl", String.valueOf(Helpers.getCRRegisterIndex(BIOperand.getValue()) * 4), Helpers.LINK_REGISTER, true, false, false, false, true, true);
}
Also used : IOperandTreeNode(com.google.security.zynamics.zylib.disassembly.IOperandTreeNode)

Example 64 with IOperandTreeNode

use of com.google.security.zynamics.zylib.disassembly.IOperandTreeNode in project binnavi by google.

the class BnsctrlTranslator method translate.

@Override
public void translate(final ITranslationEnvironment environment, final IInstruction instruction, final List<ReilInstruction> instructions) throws InternalTranslationException {
    TranslationHelpers.checkTranslationArguments(environment, instruction, instructions, "bnsctrl");
    final IOperandTreeNode BIOperand = instruction.getOperands().get(0).getRootNode().getChildren().get(0);
    BranchGenerator.generate(instruction.getAddress().toLong() * 0x100, environment, instruction, instructions, "bnsctrl", String.valueOf((Helpers.getCRRegisterIndex(BIOperand.getValue()) * 4) + 3), Helpers.COUNT_REGISTER, true, false, false, false, true, true);
}
Also used : IOperandTreeNode(com.google.security.zynamics.zylib.disassembly.IOperandTreeNode)

Example 65 with IOperandTreeNode

use of com.google.security.zynamics.zylib.disassembly.IOperandTreeNode in project binnavi by google.

the class BgelaTranslator method translate.

@Override
public void translate(final ITranslationEnvironment environment, final IInstruction instruction, final List<ReilInstruction> instructions) throws InternalTranslationException {
    TranslationHelpers.checkTranslationArguments(environment, instruction, instructions, "bgela");
    Long baseOffset = instruction.getAddress().toLong() * 0x100;
    final String jumpOperand = environment.getNextVariableString();
    final IOperandTreeNode addressOperand1 = instruction.getOperands().get(1).getRootNode().getChildren().get(0);
    final IOperandTreeNode BIOperand = instruction.getOperands().get(0).getRootNode().getChildren().get(0);
    instructions.add(ReilHelpers.createOr(baseOffset++, OperandSize.BYTE, String.valueOf((Helpers.getCRRegisterIndex(BIOperand.getValue()) * 4) + 2), OperandSize.BYTE, String.valueOf((Helpers.getCRRegisterIndex(BIOperand.getValue()) * 4) + 1), OperandSize.BYTE, jumpOperand));
    BranchGenerator.generate(baseOffset, environment, instruction, instructions, "bgela", jumpOperand, addressOperand1.getValue(), true, false, false, false, false, false);
}
Also used : IOperandTreeNode(com.google.security.zynamics.zylib.disassembly.IOperandTreeNode)

Aggregations

IOperandTreeNode (com.google.security.zynamics.zylib.disassembly.IOperandTreeNode)518 OperandSize (com.google.security.zynamics.reil.OperandSize)257 BigInteger (java.math.BigInteger)5 INaviFunction (com.google.security.zynamics.binnavi.disassembly.INaviFunction)3 InternalTranslationException (com.google.security.zynamics.reil.translators.InternalTranslationException)2 IAddress (com.google.security.zynamics.zylib.disassembly.IAddress)2 IReference (com.google.security.zynamics.zylib.disassembly.IReference)2 INaviInstruction (com.google.security.zynamics.binnavi.disassembly.INaviInstruction)1 INaviModule (com.google.security.zynamics.binnavi.disassembly.INaviModule)1 ExpensiveBaseTest (com.google.security.zynamics.binnavi.disassembly.types.ExpensiveBaseTest)1 INaviView (com.google.security.zynamics.binnavi.disassembly.views.INaviView)1 ReilOperandNode (com.google.security.zynamics.reil.ReilOperandNode)1 TranslationResult (com.google.security.zynamics.reil.translators.TranslationResult)1 IInstruction (com.google.security.zynamics.zylib.disassembly.IInstruction)1 ArrayList (java.util.ArrayList)1 Test (org.junit.Test)1