Search in sources :

Example 1 with CDefaultModifier

use of com.google.security.zynamics.binnavi.ZyGraph.Builders.Modifiers.CDefaultModifier in project binnavi by google.

the class CLineGrayer method grayLine.

/**
   * Grays or ungrays a line in a code node.
   *
   * @param model The model of the graph the node belongs to.
   * @param node The node where the user clicked.
   * @param codeNode The node that provides the raw data for the node.
   * @param y The y location where the user clicked.
   */
private void grayLine(final CGraphModel model, final NaviNode node, final INaviCodeNode codeNode, final double y) {
    final double yPos = y - node.getY();
    final int row = node.positionToRow(yPos);
    final INaviInstruction instruction = CCodeNodeHelpers.lineToInstruction(codeNode, row);
    if (instruction == null) {
        return;
    }
    if (m_grayedInstructions.contains(instruction)) {
        final Pair<String, List<CStyleRunData>> content = ZyInstructionBuilder.buildInstructionLine(instruction, model.getGraph().getSettings(), new CDefaultModifier(model.getGraph().getSettings(), model.getDebuggerProvider()));
        for (final CStyleRunData style : content.second()) {
            node.setColor(row, style.getStart(), style.getLength(), style.getColor());
        }
        m_grayedInstructions.remove(instruction);
    } else {
        node.setColor(row, Color.LIGHT_GRAY);
        m_grayedInstructions.add(instruction);
    }
}
Also used : CStyleRunData(com.google.security.zynamics.zylib.gui.zygraph.realizers.CStyleRunData) List(java.util.List) CDefaultModifier(com.google.security.zynamics.binnavi.ZyGraph.Builders.Modifiers.CDefaultModifier) INaviInstruction(com.google.security.zynamics.binnavi.disassembly.INaviInstruction)

Example 2 with CDefaultModifier

use of com.google.security.zynamics.binnavi.ZyGraph.Builders.Modifiers.CDefaultModifier in project binnavi by google.

the class InstructionNode method toString.

@Override
public String toString() {
    final ZyGraphViewSettings settings = new ZyGraphViewSettings(new GraphSettingsConfigItem());
    final DebuggerProvider provider = new DebuggerProvider(new ModuleTargetSettings(instruction.getModule()));
    return ZyInstructionBuilder.buildInstructionLine(instruction, settings, new CDefaultModifier(settings, provider)).first();
}
Also used : GraphSettingsConfigItem(com.google.security.zynamics.binnavi.config.GraphSettingsConfigItem) ZyGraphViewSettings(com.google.security.zynamics.binnavi.ZyGraph.ZyGraphViewSettings) DebuggerProvider(com.google.security.zynamics.binnavi.debug.debugger.DebuggerProvider) ModuleTargetSettings(com.google.security.zynamics.binnavi.debug.debugger.ModuleTargetSettings) CDefaultModifier(com.google.security.zynamics.binnavi.ZyGraph.Builders.Modifiers.CDefaultModifier)

Example 3 with CDefaultModifier

use of com.google.security.zynamics.binnavi.ZyGraph.Builders.Modifiers.CDefaultModifier in project binnavi by google.

the class CCommentUtilities method createInstructionLine.

/**
   * TODO (timkornau): either comment function or find a nicer way to generate a pretty printed
   * instruction line which does not depend on the graph model.
   */
public static String createInstructionLine(final INaviInstruction instruction, final CGraphModel graphModel) {
    final ZyGraphViewSettings graphSettings = graphModel.getGraph().getSettings();
    final BackEndDebuggerProvider provider = graphModel.getDebuggerProvider();
    final INodeModifier modifier = new CDefaultModifier(graphSettings, provider);
    return ZyInstructionBuilder.buildInstructionLine(instruction, graphSettings, modifier).first();
}
Also used : INodeModifier(com.google.security.zynamics.binnavi.ZyGraph.Builders.Modifiers.INodeModifier) ZyGraphViewSettings(com.google.security.zynamics.binnavi.ZyGraph.ZyGraphViewSettings) BackEndDebuggerProvider(com.google.security.zynamics.binnavi.debug.debugger.BackEndDebuggerProvider) CDefaultModifier(com.google.security.zynamics.binnavi.ZyGraph.Builders.Modifiers.CDefaultModifier)

Aggregations

CDefaultModifier (com.google.security.zynamics.binnavi.ZyGraph.Builders.Modifiers.CDefaultModifier)3 ZyGraphViewSettings (com.google.security.zynamics.binnavi.ZyGraph.ZyGraphViewSettings)2 INodeModifier (com.google.security.zynamics.binnavi.ZyGraph.Builders.Modifiers.INodeModifier)1 GraphSettingsConfigItem (com.google.security.zynamics.binnavi.config.GraphSettingsConfigItem)1 BackEndDebuggerProvider (com.google.security.zynamics.binnavi.debug.debugger.BackEndDebuggerProvider)1 DebuggerProvider (com.google.security.zynamics.binnavi.debug.debugger.DebuggerProvider)1 ModuleTargetSettings (com.google.security.zynamics.binnavi.debug.debugger.ModuleTargetSettings)1 INaviInstruction (com.google.security.zynamics.binnavi.disassembly.INaviInstruction)1 CStyleRunData (com.google.security.zynamics.zylib.gui.zygraph.realizers.CStyleRunData)1 List (java.util.List)1