Example #1
0
//-----------------------------------------------------------------------
// temporary solution for v4.7
static ea_t idaapi h8_extract_address(ea_t screen_ea, const char *string, int x)
{
  size_t len = strlen(string);
  if ( len == 0 || x > len ) return BADADDR;
  if ( x == len ) x--;
  const char *ptr = string + x;
  while ( ptr > string && qisxdigit(ptr[-1]) ) ptr--;
  const char *start = ptr;
  while ( qisxdigit(ptr[0]) ) ptr++;
  len = ptr - start;
  char buf[MAXSTR];
  memcpy(buf, start, len);
  buf[len] = '\0';
  ea_t ea = BADADDR;
  str2ea(buf, &ea, screen_ea);
  return ea;
}
Example #2
0
/*
#<pydoc>
def str2ea(addr):
    """
    Converts a string express to EA. The expression evaluator may be called as well.

    @return: BADADDR or address value
    """
    pass
#</pydoc>
*/
ea_t py_str2ea(const char *str, ea_t screenEA = BADADDR)
{
  ea_t ea;
  bool ok = str2ea(str, &ea, screenEA);
  return ok ? ea : BADADDR;
}