use of com.google.security.zynamics.binnavi.disassembly.UnrelocatedAddress in project binnavi by google.
the class PostgreSQLProviderTest method testGetViewsWithAddress.
@Test
public void testGetViewsWithAddress() throws CouldntLoadDataException, LoadCancelledException {
final INaviModule module = getProvider().loadModules().get(0);
module.load();
assertNotNull(getProvider().getViewsWithAddresses(module, Lists.newArrayList(new UnrelocatedAddress(new CAddress(0x01002B69))), true).size());
}
use of com.google.security.zynamics.binnavi.disassembly.UnrelocatedAddress in project binnavi by google.
the class BreakpointHelpers method getBreakpoints.
/**
* Returns the addresses of a code node where breakpoints of a given type are set.
*
* @param debugger The debugger that set the breakpoints.
* @param node The code node to check.
* @param type The type of the breakpoints to search for.
*
* @return The addresses of the code node where breakpoints are set.
*/
private static List<Address> getBreakpoints(final Debugger debugger, final CodeNode node, final BreakpointType type) {
Preconditions.checkNotNull(debugger, "Error: Debugger argument can not be null");
Preconditions.checkNotNull(node, "Error: Node argument can not be null");
final BreakpointManager manager = debugger.getBreakpointManager();
final List<Address> breakpoints = new ArrayList<Address>();
for (final Instruction instruction : node.getInstructions()) {
final BreakpointAddress address = new BreakpointAddress(instruction.getNative().getModule(), new UnrelocatedAddress(new CAddress(instruction.getAddress().toLong())));
if (manager.getNative().hasBreakpoint(type, address)) {
breakpoints.add(new Address(address.getAddress().getAddress().toBigInteger()));
}
}
return breakpoints;
}
use of com.google.security.zynamics.binnavi.disassembly.UnrelocatedAddress in project binnavi by google.
the class BreakpointManager method getEchoBreakpoint.
// ! Returns an echo breakpoint from a given address.
/**
* Returns the echo breakpoint at the given address.
*
* @param module The module the echo breakpoint belongs to.
* @param address The address of the breakpoint to return.
*
* @return The breakpoint at the given address.
*/
public Breakpoint getEchoBreakpoint(final Module module, final Address address) {
Preconditions.checkNotNull(address, "Error: Address argument can not be null");
final com.google.security.zynamics.binnavi.debug.models.breakpoints.Breakpoint internalBreakpoint = breakpointManager.getBreakpoint(BreakpointType.ECHO, new BreakpointAddress(module == null ? null : module.getNative(), new UnrelocatedAddress(new CAddress(address.toLong()))));
return echoBreakpointMap.get(internalBreakpoint);
}
use of com.google.security.zynamics.binnavi.disassembly.UnrelocatedAddress in project binnavi by google.
the class BreakpointManager method setBreakpoint.
// ! Sets a regular breakpoint.
/**
* Sets a regular breakpoint at the given address.
*
* @param module The module the breakpoint is tied to. This argument can be null.
* @param address The address of the breakpoint.
*
* @return The set breakpoint. Null is returned if no breakpoint was set.
*/
public Breakpoint setBreakpoint(final Module module, final Address address) {
Preconditions.checkNotNull(address, "Error: Address argument can not be null");
final INaviModule realModule = module == null ? null : module.getNative();
final BreakpointAddress breakpointAddress = new BreakpointAddress(realModule, new UnrelocatedAddress(new CAddress(address.toLong())));
final Set<BreakpointAddress> breakpoints = Sets.newHashSet(breakpointAddress);
breakpointManager.addBreakpoints(BreakpointType.REGULAR, breakpoints);
return echoBreakpointMap.get(breakpointManager.getBreakpoint(BreakpointType.REGULAR, breakpointAddress));
}
use of com.google.security.zynamics.binnavi.disassembly.UnrelocatedAddress in project binnavi by google.
the class BreakpointManager method removeEchoBreakpoint.
// ! Removes an echo breakpoint.
/**
* Removes an echo breakpoint from a given address.
*
* @param module The module the breakpoint is tied to. This argument can be null.
* @param address The address of the breakpoint.
*/
public void removeEchoBreakpoint(final Module module, final Address address) {
Preconditions.checkNotNull(address, "Error: Address argument can not be null");
breakpointManager.removeBreakpoints(BreakpointType.ECHO, Sets.newHashSet(new BreakpointAddress(module == null ? null : module.getNative(), new UnrelocatedAddress(new CAddress(address.toLong())))));
}
Aggregations