use of com.google.security.zynamics.zylib.disassembly.IOperandTreeNode in project binnavi by google.
the class OrcDotTranslator method translate.
@Override
public void translate(final ITranslationEnvironment environment, final IInstruction instruction, final List<ReilInstruction> instructions) throws InternalTranslationException {
TranslationHelpers.checkTranslationArguments(environment, instruction, instructions, "orc.");
final IOperandTreeNode registerOperand1 = instruction.getOperands().get(1).getRootNode().getChildren().get(0);
final IOperandTreeNode registerOperand2 = instruction.getOperands().get(2).getRootNode().getChildren().get(0);
OrGenerator.generate(instruction.getAddress().toLong() * 0x100, environment, instruction, instructions, "orc.", registerOperand1.getValue(), registerOperand2.getValue(), true, false, true);
}
use of com.google.security.zynamics.zylib.disassembly.IOperandTreeNode in project binnavi by google.
the class OriTranslator method translate.
@Override
public void translate(final ITranslationEnvironment environment, final IInstruction instruction, final List<ReilInstruction> instructions) throws InternalTranslationException {
TranslationHelpers.checkTranslationArguments(environment, instruction, instructions, "ori");
final IOperandTreeNode registerOperand1 = instruction.getOperands().get(1).getRootNode().getChildren().get(0);
final IOperandTreeNode literalOperand1 = instruction.getOperands().get(2).getRootNode().getChildren().get(0);
OrGenerator.generate(instruction.getAddress().toLong() * 0x100, environment, instruction, instructions, "ori", registerOperand1.getValue(), literalOperand1.getValue(), false, false, false);
}
use of com.google.security.zynamics.zylib.disassembly.IOperandTreeNode in project binnavi by google.
the class OrisTranslator method translate.
@Override
public void translate(final ITranslationEnvironment environment, final IInstruction instruction, final List<ReilInstruction> instructions) throws InternalTranslationException {
TranslationHelpers.checkTranslationArguments(environment, instruction, instructions, "oris");
final IOperandTreeNode registerOperand1 = instruction.getOperands().get(1).getRootNode().getChildren().get(0);
final IOperandTreeNode literalOperand1 = instruction.getOperands().get(2).getRootNode().getChildren().get(0);
long baseOffset = instruction.getAddress().toLong() * 0x100;
final String tmpLiteralValue = environment.getNextVariableString();
instructions.add(ReilHelpers.createStr(baseOffset++, OperandSize.DWORD, String.valueOf(Long.valueOf(literalOperand1.getValue()) << 16), OperandSize.DWORD, tmpLiteralValue));
OrGenerator.generate(baseOffset, environment, instruction, instructions, "oris", registerOperand1.getValue(), tmpLiteralValue, false, false, false);
}
use of com.google.security.zynamics.zylib.disassembly.IOperandTreeNode in project binnavi by google.
the class CReferenceFinder method fetchReferenceMap.
/**
* Fetch for outgoing code references of a tree node and all of its children.
*
* @param node The start node of the search.
* @param instruction The instruction the operand tree belongs to.
* @param functions The map of code references.
*/
private static void fetchReferenceMap(final IOperandTreeNode node, final INaviInstruction instruction, final Map<INaviInstruction, INaviFunction> functions) {
final List<IReference> references = node.getReferences();
for (final IReference reference : references) {
if (ReferenceType.isCodeReference(reference.getType())) {
final IAddress target = reference.getTarget();
final INaviFunction function = instruction.getModule().getContent().getFunctionContainer().getFunction(target);
if (function != null) {
functions.put(instruction, function);
}
}
}
for (final IOperandTreeNode child : node.getChildren()) {
fetchReferenceMap(child, instruction, functions);
}
}
use of com.google.security.zynamics.zylib.disassembly.IOperandTreeNode in project binnavi by google.
the class BlelrlTranslator method translate.
@Override
public void translate(final ITranslationEnvironment environment, final IInstruction instruction, final List<ReilInstruction> instructions) throws InternalTranslationException {
TranslationHelpers.checkTranslationArguments(environment, instruction, instructions, "blelrl");
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) + 0), OperandSize.BYTE, jumpOperand));
BranchGenerator.generate(baseOffset, environment, instruction, instructions, "blelrl", jumpOperand, Helpers.LINK_REGISTER, true, false, false, false, false, false);
}
Aggregations