Search in sources :

Example 26 with RelocatedAddress

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

the class BreakpointSetParser method parseSuccess.

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

Example 27 with RelocatedAddress

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

the class EchoBreakpointRemovedParser method parseSuccess.

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

Example 28 with RelocatedAddress

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

the class EchoBreakpointSetParser method parseSuccess.

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

Example 29 with RelocatedAddress

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

the class MemoryModuleParser method parseModule.

/**
   * Parses a single module information message.
   *
   * @param node The xml node which contains the module item.
   * @return The memory module object created from the information in the message.
   * @throws MessageParserException Thrown if parsing the message failed.
   */
public static MemoryModule parseModule(final Node node) throws MessageParserException {
    try {
        final String name = getAttribute(node, "name");
        final String path = getAttribute(node, "path");
        final RelocatedAddress baseAddress = new RelocatedAddress(new CAddress(new BigInteger(getAttribute(node, "address"))));
        final long size = Long.valueOf(getAttribute(node, "size"));
        return new MemoryModule(name, path, baseAddress, size);
    } catch (final Exception exception) {
        throw new MessageParserException(exception.getLocalizedMessage());
    }
}
Also used : RelocatedAddress(com.google.security.zynamics.binnavi.disassembly.RelocatedAddress) BigInteger(java.math.BigInteger) MemoryModule(com.google.security.zynamics.binnavi.debug.models.processmanager.MemoryModule) CAddress(com.google.security.zynamics.zylib.disassembly.CAddress)

Example 30 with RelocatedAddress

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

the class TargetProcessThread method setCurrentAddress.

/**
   * Sets the current value of the instruction pointer of the thread. The parameter can be null to
   * imply that the thread resumed.
   *
   * @param address The new value of the instruction pointer or null.
   */
public void setCurrentAddress(final RelocatedAddress address) {
    Preconditions.checkNotNull(address, "IE00763: Address argument can not be null");
    final RelocatedAddress oldAddress = relocatedAddress;
    relocatedAddress = address;
    for (final ThreadListener listener : listeners) {
        try {
            listener.instructionPointerChanged(this, oldAddress);
        } catch (final Exception exception) {
            CUtilityFunctions.logException(exception);
        }
    }
}
Also used : ThreadListener(com.google.security.zynamics.binnavi.debug.models.processmanager.interfaces.ThreadListener) RelocatedAddress(com.google.security.zynamics.binnavi.disassembly.RelocatedAddress)

Aggregations

RelocatedAddress (com.google.security.zynamics.binnavi.disassembly.RelocatedAddress)59 Test (org.junit.Test)32 CAddress (com.google.security.zynamics.zylib.disassembly.CAddress)25 TargetProcessThread (com.google.security.zynamics.binnavi.debug.models.processmanager.TargetProcessThread)22 BigInteger (java.math.BigInteger)20 MemoryModule (com.google.security.zynamics.binnavi.debug.models.processmanager.MemoryModule)15 ArrayList (java.util.ArrayList)13 EchoBreakpointsRemovedReply (com.google.security.zynamics.binnavi.debug.connection.packets.replies.EchoBreakpointsRemovedReply)12 EchoBreakpointSetReply (com.google.security.zynamics.binnavi.debug.connection.packets.replies.EchoBreakpointSetReply)10 DebuggerOptions (com.google.security.zynamics.binnavi.debug.models.targetinformation.DebuggerOptions)10 ThreadRegisters (com.google.security.zynamics.binnavi.debug.models.targetinformation.ThreadRegisters)10 BreakpointsRemovedReply (com.google.security.zynamics.binnavi.debug.connection.packets.replies.BreakpointsRemovedReply)9 StepBreakpointSetReply (com.google.security.zynamics.binnavi.debug.connection.packets.replies.StepBreakpointSetReply)9 RegisterDescription (com.google.security.zynamics.binnavi.debug.models.targetinformation.RegisterDescription)9 RegisterValue (com.google.security.zynamics.binnavi.debug.models.targetinformation.RegisterValue)9 RegisterValues (com.google.security.zynamics.binnavi.debug.models.targetinformation.RegisterValues)9 TargetInformation (com.google.security.zynamics.binnavi.debug.models.targetinformation.TargetInformation)9 MockDebugger (com.google.security.zynamics.binnavi.Debug.Debugger.MockDebugger)8 ModuleTargetSettings (com.google.security.zynamics.binnavi.debug.debugger.ModuleTargetSettings)8 TargetInformationReply (com.google.security.zynamics.binnavi.debug.connection.packets.replies.TargetInformationReply)7