Search in sources :

Example 51 with Pair

use of com.google.security.zynamics.zylib.general.Pair in project binnavi by google.

the class StepBreakpointSetParser method parseSuccess.

@Override
public StepBreakpointSetReply parseSuccess(final int packetId, final int argumentCount) throws IOException {
    final List<Pair<RelocatedAddress, Integer>> addresses = new ArrayList<>();
    final int numberOfAddresses = parseInteger();
    for (int i = 0; i < numberOfAddresses; i++) {
        final RelocatedAddress address = new RelocatedAddress(parseAddress());
        addresses.add(new Pair<RelocatedAddress, Integer>(address, parseInteger()));
    }
    return new StepBreakpointSetReply(packetId, 0, addresses);
}
Also used : StepBreakpointSetReply(com.google.security.zynamics.binnavi.debug.connection.packets.replies.StepBreakpointSetReply) RelocatedAddress(com.google.security.zynamics.binnavi.disassembly.RelocatedAddress) ArrayList(java.util.ArrayList) Pair(com.google.security.zynamics.zylib.general.Pair)

Example 52 with Pair

use of com.google.security.zynamics.zylib.general.Pair in project binnavi by google.

the class AddressingModeTwoGenerator method generate.

public static Pair<String, String> generate(final long baseOffset, final ITranslationEnvironment environment, final IInstruction instruction, final List<ReilInstruction> instructions, final IOperandTreeNode rootNode) throws InternalTranslationException {
    Preconditions.checkNotNull(environment, "Error: Argument environment can't be null");
    Preconditions.checkNotNull(instruction, "Error: Argument instruction can't be null");
    Preconditions.checkNotNull(instructions, "Error: Argument instructions can't be null");
    /**
     * parse the OperandTree to see what type of operand we received
     *
     *  This code is very verbose right now and due to this fact if a Bug is found in one type of
     * the functions be sure to check both other functions if they are OK
     *
     */
    if (rootNode.getChildren().get(0).getValue().equals("!")) {
        // matched pre- indexed
        if ((rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(0).getChildren().get(0).getType() == ExpressionType.REGISTER) && (rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(0).getChildren().get(1).getType() == ExpressionType.IMMEDIATE_INTEGER)) {
            // matched [ Rn , #imm ]!
            return preIndexedImm(baseOffset, environment, instructions, rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(0).getChildren().get(0).getValue(), rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(0).getChildren().get(1).getValue());
        } else if ((rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(0).getChildren().get(0).getType() == ExpressionType.REGISTER) && (rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(0).getChildren().get(1).getType() == ExpressionType.REGISTER)) {
            // matched [ Rn, Rm ]!
            return preIndexedReg(baseOffset, environment, instructions, (rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(0).getChildren().get(0).getValue()), (rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(0).getChildren().get(1).getValue()));
        } else {
            // matched [ Rn, Rm, <shift>, #imm ]!
            if (rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(0).getChildren().get(1).getValue().equals("LSL")) {
                return preIndexedLSL(baseOffset, environment, instructions, (rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(0).getChildren().get(0).getValue()), (rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(0).getChildren().get(1).getChildren().get(0).getValue()), (rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(0).getChildren().get(1).getChildren().get(1).getValue()));
            } else if (rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(0).getChildren().get(1).getValue().equals("LSR")) {
                return preIndexedLSR(baseOffset, environment, instructions, (rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(0).getChildren().get(0).getValue()), (rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(0).getChildren().get(1).getChildren().get(0).getValue()), (rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(0).getChildren().get(1).getChildren().get(1).getValue()));
            } else if (rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(0).getChildren().get(1).getValue().equals("ASR")) {
                return preIndexedASR(baseOffset, environment, instructions, (rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(0).getChildren().get(0).getValue()), (rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(0).getChildren().get(1).getChildren().get(0).getValue()), (rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(0).getChildren().get(1).getChildren().get(1).getValue()));
            } else if (rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(0).getChildren().get(1).getValue().equals("ROR")) {
                return preIndexedROR(baseOffset, environment, instructions, (rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(0).getChildren().get(0).getValue()), (rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(0).getChildren().get(1).getChildren().get(0).getValue()), (rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(0).getChildren().get(1).getChildren().get(1).getValue()));
            } else if (rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(0).getChildren().get(1).getValue().equals("RRX")) {
                return preIndexedRRX(baseOffset, environment, instructions, (rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(0).getChildren().get(0).getValue()), (rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(0).getChildren().get(1).getChildren().get(0).getValue()));
            } else {
                throw new InternalTranslationException("Error: AddressOperandTypeTwo preIndexed shifter is not valid");
            }
        }
    } else if (rootNode.getChildren().get(0).getValue().equals(",")) {
        // matched post- indexed
        if ((rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(0).getType() == ExpressionType.REGISTER) && (rootNode.getChildren().get(0).getChildren().get(1).getType() == ExpressionType.IMMEDIATE_INTEGER)) {
            // matched [ Rn ], #imm
            return postIndexedImm(baseOffset, environment, instructions, (rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(0).getValue()), (rootNode.getChildren().get(0).getChildren().get(1).getValue()));
        } else if ((rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(0).getType() == ExpressionType.REGISTER) && (rootNode.getChildren().get(0).getChildren().get(1).getType() == ExpressionType.REGISTER)) {
            // matched [ Rn ], Rm
            return postIndexedReg(baseOffset, environment, instructions, (rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(0).getValue()), (rootNode.getChildren().get(0).getChildren().get(1).getValue()));
        } else {
            // matched [ Rn ], Rm, <shift>, #imm
            if (rootNode.getChildren().get(0).getChildren().get(1).getValue().equals("LSL")) {
                return postIndexedLSL(baseOffset, environment, instructions, (rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(0).getValue()), (rootNode.getChildren().get(0).getChildren().get(1).getChildren().get(0).getValue()), (rootNode.getChildren().get(0).getChildren().get(1).getChildren().get(1).getValue()));
            } else if (rootNode.getChildren().get(0).getChildren().get(1).getValue().equals("LSR")) {
                return postIndexedLSR(baseOffset, environment, instructions, (rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(0).getValue()), (rootNode.getChildren().get(0).getChildren().get(1).getChildren().get(0).getValue()), (rootNode.getChildren().get(0).getChildren().get(1).getChildren().get(1).getValue()));
            } else if (rootNode.getChildren().get(0).getChildren().get(1).getValue().equals("ASR")) {
                return postIndexedASR(baseOffset, environment, instructions, (rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(0).getValue()), (rootNode.getChildren().get(0).getChildren().get(1).getChildren().get(0).getValue()), (rootNode.getChildren().get(0).getChildren().get(1).getChildren().get(1).getValue()));
            } else if (rootNode.getChildren().get(0).getChildren().get(1).getValue().equals("ROR")) {
                return postIndexedROR(baseOffset, environment, instructions, (rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(0).getValue()), (rootNode.getChildren().get(0).getChildren().get(1).getChildren().get(0).getValue()), (rootNode.getChildren().get(0).getChildren().get(1).getChildren().get(1).getValue()));
            } else if (rootNode.getChildren().get(0).getChildren().get(1).getValue().equals("RRX")) {
                return postIndexedRRX(baseOffset, environment, instructions, (rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(0).getValue()), (rootNode.getChildren().get(0).getChildren().get(1).getChildren().get(0).getValue()));
            } else {
                throw new InternalTranslationException("Error: AddressOperandTypeTwo postIndexed shifter is not valid");
            }
        }
    } else if (rootNode.getChildren().get(0).getValue().equals("[")) {
        // matched offset
        if (rootNode.getChildren().get(0).getChildren().get(0).getType() == ExpressionType.IMMEDIATE_INTEGER) {
            return new Pair<String, String>(rootNode.getChildren().get(0).getChildren().get(0).getValue(), "");
        } else if (rootNode.getChildren().get(0).getChildren().get(0).getType() == ExpressionType.REGISTER) {
            return new Pair<String, String>((rootNode.getChildren().get(0).getChildren().get(0).getValue()), "");
        } else if ((rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(0).getType() == ExpressionType.REGISTER) && (rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(1).getType() == ExpressionType.IMMEDIATE_INTEGER)) {
            // matched [ Rn , #imm ]
            return offsetImm(baseOffset, environment, instructions, (rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(0).getValue()), (rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(1).getValue()));
        } else if ((rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(0).getType() == ExpressionType.REGISTER) && (rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(1).getType() == ExpressionType.REGISTER)) {
            // matched [ Rn , Rm ]
            return offsetReg(baseOffset, environment, instructions, (rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(0).getValue()), (rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(1).getValue()));
        } else {
            // matched [ Rn , Rm, <shift>, #imm ]
            if (rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(1).getValue().equals("LSL")) {
                return offsetLSL(baseOffset, environment, instructions, (rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(0).getValue()), (rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(1).getChildren().get(0).getValue()), (rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(1).getChildren().get(1).getValue()));
            } else if (rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(1).getValue().equals("LSR")) {
                return offsetLSR(baseOffset, environment, instructions, (rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(0).getValue()), (rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(1).getChildren().get(0).getValue()), (rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(1).getChildren().get(1).getValue()));
            } else if (rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(1).getValue().equals("ASR")) {
                return offsetASR(baseOffset, environment, instructions, (rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(0).getValue()), (rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(1).getChildren().get(0).getValue()), (rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(1).getChildren().get(1).getValue()));
            } else if (rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(1).getValue().equals("ROR")) {
                return offsetROR(baseOffset, environment, instructions, (rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(0).getValue()), (rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(1).getChildren().get(0).getValue()), (rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(1).getChildren().get(1).getValue()));
            } else if (rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(1).getValue().equals("RRX")) {
                return offsetRRX(baseOffset, environment, instructions, (rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(0).getValue()), (rootNode.getChildren().get(0).getChildren().get(0).getChildren().get(1).getChildren().get(0).getValue()));
            } else {
                throw new InternalTranslationException("Error: AddressOperandTypeTwo offset shifter is not valid");
            }
        }
    } else {
        throw new InternalTranslationException("Error: AddressOperandTypeTwo rootNodeValue is not valid " + rootNode.getChildren().get(0).getValue() + " " + instruction.getMnemonic());
    }
}
Also used : InternalTranslationException(com.google.security.zynamics.reil.translators.InternalTranslationException) Pair(com.google.security.zynamics.zylib.general.Pair)

Example 53 with Pair

use of com.google.security.zynamics.zylib.general.Pair in project binnavi by google.

the class DebuggerTest method testlisteners0.

@Test
public void testlisteners0() throws DebugExceptionWrapper, MaybeNullException, ParserConfigurationException, SAXException, IOException {
    mockDebugger.connect();
    mockDebugger.getProcessManager().addThread(new TargetProcessThread(0, ThreadState.RUNNING));
    mockDebugger.getProcessManager().setTargetInformation(new TargetInformation(5, Lists.newArrayList(new RegisterDescription("eax", 4, true), new RegisterDescription("ebx", 4, false)), new DebuggerOptions(false, false, false, false, false, false, false, false, false, false, 12, 0, new ArrayList<DebuggerException>(), false, false, false)));
    mockDebugger.connection.m_synchronizer.receivedEvent(DebuggerMessageBuilder.buildProcessStartReply(CommonTestObjects.MEMORY_MODULE));
    mockDebugger.getProcessManager().getThread(0).setCurrentAddress(new RelocatedAddress(new CAddress(0)));
    mockDebugger.getBreakpointManager().addBreakpoints(BreakpointType.ECHO, CommonTestObjects.BP_ADDRESS_123_SET);
    final ArrayList<Pair<RelocatedAddress, Integer>> list = new ArrayList<Pair<RelocatedAddress, Integer>>();
    mockDebugger.connection.m_synchronizer.receivedEvent(new EchoBreakpointSetReply(0, 0, list));
    mockDebugger.connection.m_synchronizer.receivedEvent(new EchoBreakpointSetReply(0, 0, list));
    mockDebugger.connection.m_synchronizer.receivedEvent(new EchoBreakpointsRemovedReply(0, 0, list));
    mockDebugger.connection.m_synchronizer.receivedEvent(new EchoBreakpointsRemovedReply(0, 0, list));
    mockDebugger.connection.m_synchronizer.receivedEvent(new ExceptionOccurredReply(0, 0, 0, 0, new RelocatedAddress(new CAddress(0)), "Test exception"));
    mockDebugger.connection.m_synchronizer.receivedEvent(new HaltReply(0, 0, 0));
    mockDebugger.connection.m_synchronizer.receivedEvent(new HaltReply(0, 0, 1));
    mockDebugger.connection.m_synchronizer.receivedEvent(new ListFilesReply(0, 0, RemoteFileSystem.parse("<foo></foo>".getBytes())));
    mockDebugger.connection.m_synchronizer.receivedEvent(new ListFilesReply(0, 1, null));
    mockDebugger.connection.m_synchronizer.receivedEvent(new ListProcessesReply(0, 0, ProcessList.parse("<foo></foo>".getBytes())));
    mockDebugger.connection.m_synchronizer.receivedEvent(new ListProcessesReply(0, 1, null));
    mockDebugger.connection.m_synchronizer.receivedEvent(new MemoryMapReply(0, 0, new MemoryMap(new ArrayList<MemorySection>())));
    mockDebugger.connection.m_synchronizer.receivedEvent(new MemoryMapReply(0, 1, null));
    mockDebugger.connection.m_synchronizer.receivedEvent(new ModuleLoadedReply(0, 0, new MemoryModule("XXX", "YYYXXX", new RelocatedAddress(new CAddress(0)), 0), new TargetProcessThread(123, ThreadState.SUSPENDED)));
    mockDebugger.connection.m_synchronizer.receivedEvent(new ModuleUnloadedReply(0, 0, new MemoryModule("XXX", "YYYXXX", new RelocatedAddress(new CAddress(0)), 0)));
    mockDebugger.connection.m_synchronizer.receivedEvent(new ProcessClosedReply(0, 0));
    mockDebugger.connection.m_synchronizer.receivedEvent(new ReadMemoryReply(0, 0, new CAddress(0), new byte[8]));
    mockDebugger.connection.m_synchronizer.receivedEvent(new ReadMemoryReply(0, 1, null, null));
    mockDebugger.connection.m_synchronizer.receivedEvent(new RegistersReply(0, 0, new RegisterValues(new FilledList<ThreadRegisters>())));
    mockDebugger.connection.m_synchronizer.receivedEvent(new RegistersReply(0, 1, null));
    mockDebugger.connection.m_synchronizer.receivedEvent(new RequestTargetReply(0, 0));
    mockDebugger.connection.m_synchronizer.receivedEvent(new RequestTargetReply(0, 1));
    mockDebugger.connection.m_synchronizer.receivedEvent(new ResumeReply(0, 0));
    mockDebugger.connection.m_synchronizer.receivedEvent(new ResumeReply(0, 1));
}
Also used : EchoBreakpointsRemovedReply(com.google.security.zynamics.binnavi.debug.connection.packets.replies.EchoBreakpointsRemovedReply) MemorySection(com.google.security.zynamics.binnavi.debug.models.processmanager.MemorySection) RelocatedAddress(com.google.security.zynamics.binnavi.disassembly.RelocatedAddress) ArrayList(java.util.ArrayList) MemoryModule(com.google.security.zynamics.binnavi.debug.models.processmanager.MemoryModule) CAddress(com.google.security.zynamics.zylib.disassembly.CAddress) ModuleUnloadedReply(com.google.security.zynamics.binnavi.debug.connection.packets.replies.ModuleUnloadedReply) TargetInformation(com.google.security.zynamics.binnavi.debug.models.targetinformation.TargetInformation) ListProcessesReply(com.google.security.zynamics.binnavi.debug.connection.packets.replies.ListProcessesReply) ProcessClosedReply(com.google.security.zynamics.binnavi.debug.connection.packets.replies.ProcessClosedReply) RequestTargetReply(com.google.security.zynamics.binnavi.debug.connection.packets.replies.RequestTargetReply) ReadMemoryReply(com.google.security.zynamics.binnavi.debug.connection.packets.replies.ReadMemoryReply) ThreadRegisters(com.google.security.zynamics.binnavi.debug.models.targetinformation.ThreadRegisters) HaltReply(com.google.security.zynamics.binnavi.debug.connection.packets.replies.HaltReply) Pair(com.google.security.zynamics.zylib.general.Pair) MemoryMap(com.google.security.zynamics.binnavi.debug.models.processmanager.MemoryMap) TargetProcessThread(com.google.security.zynamics.binnavi.debug.models.processmanager.TargetProcessThread) MemoryMapReply(com.google.security.zynamics.binnavi.debug.connection.packets.replies.MemoryMapReply) DebuggerException(com.google.security.zynamics.binnavi.debug.models.targetinformation.DebuggerException) DebuggerOptions(com.google.security.zynamics.binnavi.debug.models.targetinformation.DebuggerOptions) RegistersReply(com.google.security.zynamics.binnavi.debug.connection.packets.replies.RegistersReply) ResumeReply(com.google.security.zynamics.binnavi.debug.connection.packets.replies.ResumeReply) ModuleLoadedReply(com.google.security.zynamics.binnavi.debug.connection.packets.replies.ModuleLoadedReply) RegisterValues(com.google.security.zynamics.binnavi.debug.models.targetinformation.RegisterValues) BigInteger(java.math.BigInteger) RegisterDescription(com.google.security.zynamics.binnavi.debug.models.targetinformation.RegisterDescription) EchoBreakpointSetReply(com.google.security.zynamics.binnavi.debug.connection.packets.replies.EchoBreakpointSetReply) ExceptionOccurredReply(com.google.security.zynamics.binnavi.debug.connection.packets.replies.ExceptionOccurredReply) ListFilesReply(com.google.security.zynamics.binnavi.debug.connection.packets.replies.ListFilesReply) Test(org.junit.Test)

Example 54 with Pair

use of com.google.security.zynamics.zylib.general.Pair in project binnavi by google.

the class CPostgreSQLModuleContentTest method testCModuleContentConstructor.

@Test
public void testCModuleContentConstructor() throws LoadCancelledException, CouldntLoadDataException {
    final CModule module = (CModule) getDatabase().getContent().getModules().get(0);
    module.load();
    final ListenerProvider<IModuleListener> listeners = new ListenerProvider<IModuleListener>();
    final CCallgraph callgraph = module.getContent().getNativeCallgraph();
    final IFilledList<INaviFunction> functions = new FilledList<INaviFunction>();
    functions.add(module.getContent().getFunctionContainer().getFunctions().get(0));
    final ICallgraphView nativeCallgraph = module.getContent().getViewContainer().getNativeCallgraphView();
    final ImmutableList<IFlowgraphView> nativeFlowgraphs = module.getContent().getViewContainer().getNativeFlowgraphViews();
    final List<INaviView> customViews = new ArrayList<INaviView>();
    final ImmutableBiMap<INaviView, INaviFunction> viewFunctionMap = new ImmutableBiMap.Builder<INaviView, INaviFunction>().build();
    new Pair<HashMap<INaviView, INaviFunction>, HashMap<INaviFunction, INaviView>>(null, null);
    final IFilledList<TraceList> traces = new FilledList<TraceList>();
    final SectionContainer sections = new SectionContainer(new SectionContainerBackend(getProvider(), module));
    final TypeInstanceContainer instances = new TypeInstanceContainer(new TypeInstanceContainerBackend(getProvider(), module, module.getTypeManager(), sections), getProvider());
    final CModuleContent moduleContent1 = new CModuleContent(module, getProvider(), listeners, callgraph, functions, nativeCallgraph, nativeFlowgraphs, customViews, viewFunctionMap, traces, sections, instances);
    assertNotNull(moduleContent1);
    try {
        @SuppressWarnings("unused") final CModuleContent moduleContent = new CModuleContent(null, null, null, null, null, null, null, null, null, null, sections, instances);
        fail();
    } catch (final NullPointerException e) {
    }
    try {
        @SuppressWarnings("unused") final CModuleContent moduleContent = new CModuleContent(module, null, null, null, null, null, null, null, null, null, null, null);
        fail();
    } catch (final NullPointerException e) {
    }
    try {
        @SuppressWarnings("unused") final CModuleContent moduleContent = new CModuleContent(module, getProvider(), null, null, null, null, null, null, null, null, null, null);
        fail();
    } catch (final NullPointerException e) {
    }
    try {
        @SuppressWarnings("unused") final CModuleContent moduleContent = new CModuleContent(module, getProvider(), listeners, null, null, null, null, null, null, null, null, null);
        fail();
    } catch (final NullPointerException e) {
    }
    try {
        @SuppressWarnings("unused") final CModuleContent moduleContent = new CModuleContent(module, getProvider(), listeners, callgraph, null, null, null, null, null, null, null, null);
        fail();
    } catch (final NullPointerException e) {
    }
    try {
        @SuppressWarnings("unused") final CModuleContent moduleContent = new CModuleContent(module, getProvider(), listeners, callgraph, functions, null, null, null, null, null, null, null);
        fail();
    } catch (final NullPointerException e) {
    }
    try {
        @SuppressWarnings("unused") final CModuleContent moduleContent = new CModuleContent(module, getProvider(), listeners, callgraph, functions, nativeCallgraph, null, null, null, null, null, null);
        fail();
    } catch (final NullPointerException e) {
    }
    try {
        @SuppressWarnings("unused") final CModuleContent moduleContent = new CModuleContent(module, getProvider(), listeners, callgraph, functions, nativeCallgraph, nativeFlowgraphs, null, null, null, null, null);
        fail();
    } catch (final NullPointerException e) {
    }
    try {
        @SuppressWarnings("unused") final CModuleContent moduleContent = new CModuleContent(module, getProvider(), listeners, callgraph, functions, nativeCallgraph, nativeFlowgraphs, customViews, null, null, null, null);
        fail();
    } catch (final NullPointerException e) {
    }
    try {
        @SuppressWarnings("unused") final CModuleContent moduleContent = new CModuleContent(module, getProvider(), listeners, callgraph, functions, nativeCallgraph, nativeFlowgraphs, customViews, viewFunctionMap, null, null, null);
        fail();
    } catch (final NullPointerException e) {
    }
    try {
        @SuppressWarnings("unused") final CModuleContent moduleContent = new CModuleContent(module, getProvider(), listeners, callgraph, functions, nativeCallgraph, nativeFlowgraphs, customViews, viewFunctionMap, traces, null, null);
        fail();
    } catch (final NullPointerException e) {
    }
}
Also used : IFlowgraphView(com.google.security.zynamics.binnavi.disassembly.IFlowgraphView) FilledList(com.google.security.zynamics.zylib.types.lists.FilledList) IFilledList(com.google.security.zynamics.zylib.types.lists.IFilledList) ArrayList(java.util.ArrayList) TypeInstanceContainerBackend(com.google.security.zynamics.binnavi.disassembly.types.TypeInstanceContainerBackend) Pair(com.google.security.zynamics.zylib.general.Pair) SectionContainerBackend(com.google.security.zynamics.binnavi.disassembly.types.SectionContainerBackend) CCallgraph(com.google.security.zynamics.binnavi.disassembly.CCallgraph) ICallgraphView(com.google.security.zynamics.binnavi.disassembly.ICallgraphView) INaviView(com.google.security.zynamics.binnavi.disassembly.views.INaviView) ImmutableBiMap(com.google.common.collect.ImmutableBiMap) SectionContainer(com.google.security.zynamics.binnavi.disassembly.types.SectionContainer) TraceList(com.google.security.zynamics.binnavi.debug.models.trace.TraceList) ListenerProvider(com.google.security.zynamics.zylib.general.ListenerProvider) TypeInstanceContainer(com.google.security.zynamics.binnavi.disassembly.types.TypeInstanceContainer) INaviFunction(com.google.security.zynamics.binnavi.disassembly.INaviFunction) ExpensiveBaseTest(com.google.security.zynamics.binnavi.disassembly.types.ExpensiveBaseTest) Test(org.junit.Test)

Example 55 with Pair

use of com.google.security.zynamics.zylib.general.Pair in project binnavi by google.

the class ZyGraphTest method createEdgeForAddedEdgeTests.

private Pair<CNaviViewEdge, com.google.security.zynamics.binnavi.yfileswrap.zygraph.NaviEdge> createEdgeForAddedEdgeTests() {
    final INaviViewNode source = m_view.getGraph().getNodes().get(0);
    final INaviViewNode target = m_view.getGraph().getNodes().get(1);
    final CNaviViewEdge edge = m_graph.getRawView().getContent().createEdge(source, target, EdgeType.ENTER_INLINED_FUNCTION);
    final com.google.security.zynamics.binnavi.yfileswrap.zygraph.NaviEdge cnn = searchEdge(getEdges(m_graph), edge);
    return new Pair<CNaviViewEdge, com.google.security.zynamics.binnavi.yfileswrap.zygraph.NaviEdge>(edge, cnn);
}
Also used : CNaviViewEdge(com.google.security.zynamics.binnavi.disassembly.CNaviViewEdge) INaviViewNode(com.google.security.zynamics.binnavi.disassembly.INaviViewNode) Pair(com.google.security.zynamics.zylib.general.Pair)

Aggregations

Pair (com.google.security.zynamics.zylib.general.Pair)55 ArrayList (java.util.ArrayList)26 IComment (com.google.security.zynamics.binnavi.Gui.GraphWindows.CommentDialogs.Interfaces.IComment)7 RelocatedAddress (com.google.security.zynamics.binnavi.disassembly.RelocatedAddress)7 INaviInstruction (com.google.security.zynamics.binnavi.disassembly.INaviInstruction)6 INaviModule (com.google.security.zynamics.binnavi.disassembly.INaviModule)6 CAddress (com.google.security.zynamics.zylib.disassembly.CAddress)6 IAddress (com.google.security.zynamics.zylib.disassembly.IAddress)6 IDebugger (com.google.security.zynamics.binnavi.debug.debugger.interfaces.IDebugger)4 INaviFunction (com.google.security.zynamics.binnavi.disassembly.INaviFunction)4 Test (org.junit.Test)4 CouldntLoadDataException (com.google.security.zynamics.binnavi.Database.Exceptions.CouldntLoadDataException)3 Breakpoint (com.google.security.zynamics.binnavi.debug.models.breakpoints.Breakpoint)3 BreakpointAddress (com.google.security.zynamics.binnavi.debug.models.breakpoints.BreakpointAddress)3 MemoryModule (com.google.security.zynamics.binnavi.debug.models.processmanager.MemoryModule)3 INaviCodeNode (com.google.security.zynamics.binnavi.disassembly.INaviCodeNode)3 ReilBlock (com.google.security.zynamics.reil.ReilBlock)3 ReilInstruction (com.google.security.zynamics.reil.ReilInstruction)3 BigInteger (java.math.BigInteger)3 HashSet (java.util.HashSet)3