use of com.google.security.zynamics.zylib.disassembly.IOperandTreeNode in project binnavi by google.
the class BgelrTranslator method translate.
@Override
public void translate(final ITranslationEnvironment environment, final IInstruction instruction, final List<ReilInstruction> instructions) throws InternalTranslationException {
TranslationHelpers.checkTranslationArguments(environment, instruction, instructions, "bgelr");
Long baseOffset = instruction.getAddress().toLong() * 0x100;
final String jumpOperand = environment.getNextVariableString();
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, "bgelr", jumpOperand, Helpers.LINK_REGISTER, false, false, false, false, false, false);
}
use of com.google.security.zynamics.zylib.disassembly.IOperandTreeNode in project binnavi by google.
the class BgelrlTranslator method translate.
@Override
public void translate(final ITranslationEnvironment environment, final IInstruction instruction, final List<ReilInstruction> instructions) throws InternalTranslationException {
TranslationHelpers.checkTranslationArguments(environment, instruction, instructions, "bgelrl");
Long baseOffset = instruction.getAddress().toLong() * 0x100;
final String jumpOperand = environment.getNextVariableString();
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, "bgelrl", jumpOperand, Helpers.LINK_REGISTER, true, false, false, false, false, false);
}
use of com.google.security.zynamics.zylib.disassembly.IOperandTreeNode in project binnavi by google.
the class BgtctrlTranslator method translate.
@Override
public void translate(final ITranslationEnvironment environment, final IInstruction instruction, final List<ReilInstruction> instructions) throws InternalTranslationException {
TranslationHelpers.checkTranslationArguments(environment, instruction, instructions, "bgtctrl");
final IOperandTreeNode BIOperand = instruction.getOperands().get(0).getRootNode().getChildren().get(0);
BranchGenerator.generate(instruction.getAddress().toLong() * 0x100, environment, instruction, instructions, "bgtctrl", String.valueOf((Helpers.getCRRegisterIndex(BIOperand.getValue()) * 4) + 1), Helpers.COUNT_REGISTER, false, false, false, false, true, false);
}
use of com.google.security.zynamics.zylib.disassembly.IOperandTreeNode in project binnavi by google.
the class BgtlrTranslator method translate.
@Override
public void translate(final ITranslationEnvironment environment, final IInstruction instruction, final List<ReilInstruction> instructions) throws InternalTranslationException {
TranslationHelpers.checkTranslationArguments(environment, instruction, instructions, "bgtlr");
final IOperandTreeNode BIOperand = instruction.getOperands().get(0).getRootNode().getChildren().get(0);
BranchGenerator.generate(instruction.getAddress().toLong() * 0x100, environment, instruction, instructions, "bgtlr", String.valueOf((Helpers.getCRRegisterIndex(BIOperand.getValue()) * 4) + 1), Helpers.LINK_REGISTER, false, false, false, false, true, false);
}
use of com.google.security.zynamics.zylib.disassembly.IOperandTreeNode in project binnavi by google.
the class BnectrlTranslator method translate.
@Override
public void translate(final ITranslationEnvironment environment, final IInstruction instruction, final List<ReilInstruction> instructions) throws InternalTranslationException {
TranslationHelpers.checkTranslationArguments(environment, instruction, instructions, "bnectrl");
final IOperandTreeNode BIOperand = instruction.getOperands().get(0).getRootNode().getChildren().get(0);
BranchGenerator.generate(instruction.getAddress().toLong() * 0x100, environment, instruction, instructions, "bnectrl", String.valueOf((Helpers.getCRRegisterIndex(BIOperand.getValue()) * 4) + 2), Helpers.COUNT_REGISTER, true, false, false, false, true, true);
}
Aggregations