• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ qnumber函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中qnumber函数的典型用法代码示例。如果您正苦于以下问题:C++ qnumber函数的具体用法?C++ qnumber怎么用?C++ qnumber使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了qnumber函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: cwstr

//--------------------------------------------------------------------------
bool win32_debmod_t::create_process(const char *path,
                    const char *args,
                    const char * /*startdir*/,
                    bool is_gui,
                    PROCESS_INFORMATION *ProcessInformation)
{
  wchar_t wpath[MAXSTR];
  wchar_t wargs_buffer[MAXSTR];
  wchar_t *wargs = NULL;
  if ( args != NULL )
  {
    cwstr(wargs_buffer, args, qnumber(wargs_buffer));
    wargs = wargs_buffer;
  }
  cwstr(wpath, path, qnumber(wpath));
  return CreateProcess(
          wpath,                               // pointer to name of executable module
          wargs,                               // pointer to command line string
          NULL,                                // pointer to process security attributes
          NULL,                                // pointer to thread security attributes
          false,                               // handle inheritance flag
           (is_gui ? 0 : CREATE_NEW_CONSOLE)   // creation flags
          |DEBUG_ONLY_THIS_PROCESS
          |DEBUG_PROCESS,
          NULL,                                // pointer to new environment block
          NULL,                                // pointer to current directory name
          NULL,                                // pointer to STARTUPINFO
          ProcessInformation);                 // pointer to PROCESS_INFORMATION
}
开发者ID:Artorios,项目名称:IDAplugins-1,代码行数:30,代码来源:wince_debmod_impl.cpp


示例2: special_name

//--------------------------------------------------------------------------
// The assembler and the compiler generate lots of meaningless symbols.
// We will ignore them.
static bool special_name(const char *name)
{
  int i;
  if ( name[0] == '\0' ) return true;
  if ( name[0] == '$' ) return true;
  const char *ptr = strchr(name,'$');
  if ( ptr != NULL && ptr[1] == '$' ) return true;

  static const char *const ex[] =
  {
    "_etext",
    "_edata",
    "_end",
    "!!!"
  };
  for ( i=0; i < qnumber(ex); i++ )
    if ( strcmp(ex[i],name) == 0 ) return true;

  static const char *const data_names[] = { "x$constdata", "x$litpool" };
  for ( i=0; i < qnumber(data_names); i++ )
    if ( strncmp(name,data_names[i],strlen(data_names[i])) == 0 )
      return true;

  return false;
}
开发者ID:Artorios,项目名称:IDAplugins-1,代码行数:28,代码来源:aif.cpp


示例3: segstart

//--------------------------------------------------------------------------
void segstart(ea_t ea)
{
  segment_t *Sarea = getseg(ea);
  if ( is_spec_segm(Sarea->type) ) return;

  char sname[MAXNAMELEN];
  char sclas[MAXNAMELEN];
  get_true_segm_name(Sarea, sname, sizeof(sname));
  get_segm_class(Sarea, sclas, sizeof(sclas));

  if ( ash.uflag & UAS_GNU )
  {
    const char *const predefined[] =
    {
      ".text",    // Text section
      ".data",    // Data sections
      ".rdata",
      ".comm",
    };

    int i;
    for ( i=0; i < qnumber(predefined); i++ )
      if ( strcmp(sname, predefined[i]) == 0 )
        break;
    if ( i != qnumber(predefined) )
      printf_line(inf.indent, COLSTR("%s", SCOLOR_ASMDIR), sname);
    else
      printf_line(inf.indent, COLSTR(".section %s", SCOLOR_ASMDIR) " " COLSTR("%s %s", SCOLOR_AUTOCMT),
                   sname,
                   ash.cmnt,
                   sclas);
  }
  else
  {
    if ( strcmp(sname, "XMEM") == 0 )
    {
      char buf[MAX_NUMBUF];
      btoa(buf, sizeof(buf), ea-get_segm_base(Sarea));
      printf_line(inf.indent, COLSTR("%s %c:%s", SCOLOR_ASMDIR),
                  ash.origin,
                  tolower(sname[0]),
                  buf);
    }
    else
    {
      printf_line(inf.indent, COLSTR("section %s", SCOLOR_ASMDIR) " "
                              COLSTR("%s %s", SCOLOR_AUTOCMT),
                  sname,
                  ash.cmnt,
                  sclas);
    }
  }
}
开发者ID:nealey,项目名称:vera,代码行数:54,代码来源:out.cpp


示例4: ana_special

// detect special instructions, whose we can't detect using the table and the
// get_opcode() routine
static bool ana_special(int byte) {
    bool special = false;

    const struct {
        uint16 insn;                  // instruction ID
        uchar  val;                   // (20i + val)
        m740_addr_mode_t addr;        // which addressing mode ?
    }
    specials[] = {
        { m740_bbc,        0x13,    A_ACCBREL   },
        { m740_bbc,        0x17,    A_ZPBREL    },
        { m740_bbs,        0x03,    A_ACCBREL   },
        { m740_bbs,        0x07,    A_ZPBREL    },
        { m740_clb,        0x1B,    A_ACCB      },
        { m740_clb,        0x1F,    A_ZPB       },
        { m740_seb,        0x0B,    A_ACCB      },
        { m740_seb,        0x0F,    A_ZPB       }
    };

    for (int i = 0; i < qnumber(specials); i++) {
        int t = (uchar) byte - specials[i].val;
        if ( (t % 0x20) != 0 )
            continue;

        cmd.itype = specials[i].insn;

        set_op_imm(cmd.Op1, t / 0x20);
        cmd.Op1.specflag1 |= OP_IMM_BIT;
        fill_cmd(specials[i].addr, get_opcode_flags(specials[i].insn));
        special = true;
        break;
    }

    return special;
}
开发者ID:nealey,项目名称:vera,代码行数:37,代码来源:ana.cpp


示例5: find_reg

//----------------------------------------------------------------------
int jump_pattern_t::find_reg(int reg)
{
  for ( int i=0; i < qnumber(r); i++ )
    if ( r[i] == reg )
      return i;
  return -1;
}
开发者ID:nealey,项目名称:vera,代码行数:8,代码来源:jptcmn.cpp


示例6: qsnprintf

static const char *tdb_event_name(int ev)
{
  static const char *const names[] =
  {
    "READY",       //  1
    "SLEEP",       //  2
    "SWITCHTO",    //  3
    "SWITCHFROM",  //  4
    "LOCK_TRY",    //  5
    "CATCHSIG",    //  6
    "IDLE",        //  7
    "CREATE",      //  8
    "DEATH",       //  9
    "PREEMPT",     // 10
    "PRI_INHERIT", // 11
    "REAP",        // 12
    "CONCURRENCY", // 13
    "TIMEOUT",     // 14
  };
  if ( ev > 0 && ev <= qnumber(names) )
    return names[ev-1];

  static char buf[16];
  qsnprintf(buf, sizeof(buf), "%u", ev);
  return buf;
}
开发者ID:nealey,项目名称:vera,代码行数:26,代码来源:linux_threads.cpp


示例7: display_matched

static void display_matched(deng_t * eng)
{
	choose2(CH_ATTRS,
		-1, -1, -1, -1,       // position is determined by Windows
		eng,                  // pass the created function list to the window
		qnumber(header_match),// number of columns
		widths_match,		  // widths of columns
		sizer_match,          // function that returns number of lines
		desc_match,           // function that generates a line
		title_match,	      // window title
		-1,                   // use the default icon for the window
		1,                    // position the cursor on the first line
		NULL,                 // "kill" callback
		NULL,                 // "new" callback
		NULL,                 // "update" callback
		graph_match,          // "edit" callback
		enter_match,          // function to call when the user pressed Enter
		close_window,         // function to call when the window is closed
		popup_match,          // use default popup menu items
		NULL);  

	eng->wnum++;
	
	add_chooser_command(title_match, "Unmatch", res_munmatch, 0, -1, CHOOSER_POPUP_MENU | CHOOSER_MENU_EDIT);
	add_chooser_command(title_match, "Set as identical", res_mtoi, 0, -1, CHOOSER_POPUP_MENU | CHOOSER_MENU_EDIT);
	add_chooser_command(title_match, "Flag/unflag", res_flagged, 0, -1, CHOOSER_POPUP_MENU | CHOOSER_MENU_EDIT);
	add_chooser_command(title_match, "Import Symbol", transfer_sym_match, 0, -1, CHOOSER_POPUP_MENU | CHOOSER_MENU_EDIT);
}
开发者ID:filcab,项目名称:patchdiff2,代码行数:28,代码来源:display.cpp


示例8: DEBUG_REGVALS

static void DEBUG_REGVALS(regval_t *values)
{
  for (int i = 0; i < qnumber(registers); i++)
  {
    msg("%s = ", registers[i].name);
    switch ( registers[i].dtyp )
    {
      case dt_qword: msg("%016LX\n", values[i].ival); break;
      case dt_dword: msg("%08X\n", values[i].ival); break;
      case dt_word:  msg("%04X\n", values[i].ival); break;
      case dt_tbyte:
      {
        for (int j = 0; j < sizeof(regval_t); j++)
        {
          if ( j == 10) msg(" - " ); // higher bytes are not used by x86 floats
          msg("%02X ", ((unsigned char*)&values[i])[j]);
        }
          // msg("%02X ", (unsigned short)values[i].fval[j]);
        msg("\n");
        break;
      }
    }
  }
  msg("\n");
}
开发者ID:nihilus,项目名称:ida_objectivec_plugins,代码行数:25,代码来源:pc_local_impl.cpp


示例9: display_unmatched

static void display_unmatched(deng_t * eng)
{
	choose2(0,
		-1, -1, -1, -1,       // position is determined by Windows
		eng,                  // pass the created function list to the window
		qnumber(header_unmatch),// number of columns
		widths_unmatch,		  // widths of columns
		sizer_unmatch,        // function that returns number of lines
		desc_unmatch,         // function that generates a line
		title_unmatch,	      // window title
		-1,                   // use the default icon for the window
		1,                    // position the cursor on the first line
		NULL,                 // "kill" callback
		NULL,                 // "new" callback
		NULL,                 // "update" callback
		graph_unmatch,        // "edit" callback
		enter_unmatch,        // function to call when the user pressed Enter
		close_window,         // function to call when the window is closed
		popup_unmatch,        // use default popup menu items
		NULL);                // use the same icon for all lines

	eng->wnum++;
	
	add_chooser_command(title_unmatch, "Set match", res_match, 0, -1, CHOOSER_POPUP_MENU | CHOOSER_MENU_EDIT);
}
开发者ID:filcab,项目名称:patchdiff2,代码行数:25,代码来源:display.cpp


示例10: get_line

void idaapi function_list::get_line(void *obj,uint32 n,char * const *arrptr)
{
  if ( n == 0 ) // generate the column headers
  {
    for ( int i=0; i < qnumber(header); i++ )
      qstrncpy(arrptr[i], header[i], MAXSTR);
    return;
  }
  function_list & ms = *(function_list*)obj;

  ea_t ea = ms.functions[n-1];
  qsnprintf(arrptr[0], MAXSTR, "%08a", ea);
  get_func_name(ea, arrptr[1], MAXSTR);
  //get_short_name(BADADDR, ea, arrptr[1], MAXSTR);
  //get_demangled_name(BADADDR, ea,  arrptr[1], MAXSTR, inf.long_demnames, DEMNAM_NAME, 0);
  func_t * f = get_func(ea);
  if(f)
  {
	  const char * cmt = get_func_cmt(f, true);
	  if(cmt)
	  {
		  qstrncpy(arrptr[2], cmt, MAXSTR);		
	  }
	
  }

}
开发者ID:caznova,项目名称:hexrays_tools,代码行数:27,代码来源:choosers.cpp


示例11: get_opcode_flags

static const uchar get_opcode_flags(const uint16 insn) {
    for (int i = 0; i < qnumber(opcodes_flags); i++) {
        if ( opcodes_flags[i].insn != insn )
            continue;

        return opcodes_flags[i].flags;
    }
    return 0;
}
开发者ID:nealey,项目名称:vera,代码行数:9,代码来源:ana.cpp


示例12: get_opcode

// try to find an opcode in our table from the fetched byte
static const struct opcode * get_opcode(int byte) {
    for (int i = 0; i < qnumber(opcodes); i++) {
        if ( opcodes[i].code != byte )
            continue;

        return &opcodes[i];
    }
    return NULL;
}
开发者ID:nealey,项目名称:vera,代码行数:10,代码来源:ana.cpp


示例13: segstart

//--------------------------------------------------------------------------
void segstart(ea_t ea)
{
  const char *predefined[] =
  {
    ".text",    // Text section
    ".rdata",   // Read-only data section
    ".data",    // Data sections
    ".lit8",    // Data sections
    ".lit4",    // Data sections
    ".sdata",   // Small data section, addressed through register $gp
    ".sbss",    // Small bss section, addressed through register $gp
    ".bss",     // bss (block started by storage) section, which loads zero-initialized data
  };

  segment_t *Sarea = getseg(ea);
  if ( is_spec_segm(Sarea->type) ) return;

  char sname[MAXNAMELEN];
  char sclas[MAXNAMELEN];
  get_true_segm_name(Sarea, sname, sizeof(sname));
  get_segm_class(Sarea, sclas, sizeof(sclas));

  int i;
  for ( i=0; i < qnumber(predefined); i++ )
    if ( strcmp(sname, predefined[i]) == 0 )
      break;
  if ( i != qnumber(predefined) )
    printf_line(inf.indent, COLSTR("%s", SCOLOR_ASMDIR), sname);
  else
    printf_line(inf.indent, COLSTR("%s", SCOLOR_ASMDIR) "" COLSTR("%s %s", SCOLOR_AUTOCMT),
                 strcmp(sclas,"CODE") == 0
                    ? ".text"
                    : strcmp(sclas,"BSS") == 0
                         ? ".bss"
                         : ".data",
                 ash.cmnt,
                 sname);
  if ( Sarea->orgbase != 0 )
  {
    char buf[MAX_NUMBUF];
    btoa(buf, sizeof(buf), Sarea->orgbase);
    printf_line(inf.indent, COLSTR("%s %s", SCOLOR_ASMDIR), ash.origin, buf);
  }
}
开发者ID:awesome-security,项目名称:vera,代码行数:45,代码来源:out.cpp


示例14: ignore_win32_api

//--------------------------------------------------------------------------
// Unpacker might use some Win32 functions to perform their function
// This function verifies whether we must switch to the trace mode
// or continue to wait for GetProcAddress() of some other interesting function
static bool ignore_win32_api(const char *name)
{
  static const char *const ignore_names[] = { "VirtualAlloc", "VirtualFree" };
  for ( size_t i=0; i<qnumber(ignore_names); i++ )
  {
    if ( strcmp(name, ignore_names[i]) == 0 )
      return true;
  }
  return false;
}
开发者ID:nihilus,项目名称:ida_objectivec_plugins,代码行数:14,代码来源:uunp.cpp


示例15: mark_switch_insns

void jump_pattern_t::mark_switch_insns(void)
{
  // we do not mark the indirect jmp as ignored
  // it will be used to recognize switch idioms
  for ( int i=1; i < qnumber(eas); i++ )
  {
    ea_t ea = eas[i];
    if ( ea != BADADDR && !remote_code.has(ea) )
      mark_switch_insn(ea);
  }
}
开发者ID:nealey,项目名称:vera,代码行数:11,代码来源:jptcmn.cpp


示例16: strlen

//--------------------------------------------------------------------------
// get path+name from a mapped file in the debugged process
bool win32_debmod_t::get_mapped_filename(HANDLE process_handle,
                         ea_t imagebase,
                         char *buf,
                         size_t bufsize)
{
  if ( _GetMappedFileName != NULL )
  {
    TCHAR name[QMAXPATH];
    name[0] = '\0';
    if ( !can_access(imagebase) )
      imagebase += MEMORY_PAGE_SIZE;
    if ( _GetMappedFileName(process_handle, (LPVOID)imagebase, name, qnumber(name)) )
    {
      // translate path with device name to drive letters.
      //   based on http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/obtaining_a_file_name_from_a_file_handle.asp
      TCHAR szTemp[MAX_PATH];
      szTemp[0] = '\0';
      if ( GetLogicalDriveStrings(sizeof(szTemp), szTemp) )
      {
        char szName[MAX_PATH];
        char szDrive[3] = " :";
        bool bFound = FALSE;
        char *p = szTemp;
        do
        {
          // Copy the drive letter to the template string
          szDrive[0] = *p;
          // Look up each device name
          if ( QueryDosDevice(szDrive, szName, MAX_PATH) )
          {
            size_t uNameLen = strlen(szName);
            if ( uNameLen < MAX_PATH )
            {
              bFound = strnicmp(name, szName, uNameLen) == 0;
              if ( bFound )
              {
                // Reconstruct pszFilename using szTemp
                // Replace device path with DOS path
                qstrncpy(name, szDrive, sizeof(name));
                qstrncat(name, name+uNameLen, sizeof(name));
              }
            }
          }
          // Go to the next NULL character.
          while ( *p++ );
        } while ( !bFound && *p ); // end of string
      }
      wcstr(buf, name, bufsize);
      return true;
    }
  }
  return false;
}
开发者ID:nihilus,项目名称:ida_objectivec_plugins,代码行数:55,代码来源:win32_debmod_impl.cpp


示例17: is_true_text_symbol

static bool is_true_text_symbol(dsym_t *ds,const char *name)
{
  if ( ds->is_text() )
  {
    static const char *const data_names[] = { "x$constdata", "x$litpool" };
    for ( int i=0; i < qnumber(data_names); i++ )
      if ( strncmp(name,data_names[i],strlen(data_names[i])) == 0 )
        return false;
    return true;
  }
  return false;
}
开发者ID:Artorios,项目名称:IDAplugins-1,代码行数:12,代码来源:aif.cpp


示例18: switch

//---------------------------------------------------------------------------
static const char *pdberr(int code)
{
  switch ( code )
  {                         // tab in first pos is flag for replace warning to msg
    case E_INVALIDARG:      return "Invalid parameter.";
    case E_UNEXPECTED:      return "Data source has already been prepared.";
    default:
      if ( code >= E_PDB_OK && (code - E_PDB_OK) < qnumber(g_pdb_errors) )
        return g_pdb_errors[code - E_PDB_OK];
  }
  return winerr(code);
}
开发者ID:nealey,项目名称:vera,代码行数:13,代码来源:common.cpp


示例19: sizeof

//--------------------------------------------------------------------------
arm_debmod_t::arm_debmod_t()
{
  static const uchar bpt[] = ARM_BPT_CODE;
  bpt_code.append(bpt, sizeof(bpt));
  sp_idx = R_SP;
  pc_idx = R_PC;
  nregs = qnumber(arm_registers);

  is_xscale = false;
  databpts[0] = databpts[1] = BADADDR;
  codebpts[0] = codebpts[1] = BADADDR;
  dbcon = 0;
}
开发者ID:nealey,项目名称:vera,代码行数:14,代码来源:arm_debmod.cpp


示例20: mas_set_cpu

//-----------------------------------------------------------------------------
// set the current processor type according to "cpu_type".
static bool mas_set_cpu(uchar cpu_type) {
    for (int i = 0; i < qnumber(families); i++) {
        if (families[i].code != cpu_type)
            continue;

        set_processor_type(families[i].processor, SETPROC_ALL|SETPROC_FATAL);
#if defined(DEBUG)
        msg("MAS: detected processor %s\n", families[i].processor);
#endif
        return true;
    }
    return false;
}
开发者ID:trietptm,项目名称:usefulres,代码行数:15,代码来源:mas.cpp



注:本文中的qnumber函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ qobject_decref函数代码示例发布时间:2022-05-30
下一篇:
C++ qnotused函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap