Пример #1
0
  /**
   * Checks whether an echo breakpoint exists at a given address.
   *
   * @param module The module the breakpoint is tied to. This argument can be null.
   * @param address The address to check.
   * @return True, if an echo breakpoint exists at the given address. False, otherwise.
   */
  public boolean hasEchoBreakpoint(final Module module, final Address address) {
    Preconditions.checkNotNull(address, "Error: Address argument can not be null");

    return breakpointManager.hasBreakpoint(
        BreakpointType.ECHO,
        new BreakpointAddress(
            module == null ? null : module.getNative(),
            new UnrelocatedAddress(new CAddress(address.toLong()))));
  }
Пример #2
0
 /**
  * Sets an echo 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 setEchoBreakpoint(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.ECHO, breakpoints);
   return echoBreakpointMap.get(
       breakpointManager.getBreakpoint(BreakpointType.ECHO, breakpointAddress));
 }
Пример #3
0
  /**
   * 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())))));
  }
Пример #4
0
  /**
   * 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);
  }
Пример #5
0
  /**
   * Removes a regular 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 removeBreakpoint(final Module module, final Address address) {
    Preconditions.checkNotNull(address, "Error: Address argument can not be null");

    final BreakpointStatus currentStatus =
        com.google.security.zynamics.binnavi.debug.models.breakpoints.enums.BreakpointStatus
            .BREAKPOINT_DELETING;
    final BreakpointAddress breakpointAddress =
        new BreakpointAddress(
            module == null ? null : module.getNative(),
            new UnrelocatedAddress(new CAddress(address.toLong())));

    breakpointManager.setBreakpointStatus(
        Sets.newHashSet(breakpointAddress), BreakpointType.REGULAR, currentStatus);
  }