当前位置: 首页>>代码示例>>C++>>正文


C++ netnode类代码示例

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


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

示例1: getLastUpdate

//Load the last update id from our netnode
uint64_t getLastUpdate() {
   uint64_t val = 0;
   cnn.supval(LASTUPDATE_SUPVAL, &val, sizeof(val));
#ifdef DEBUG
   msg(PLUGIN_NAME": lastupdate supval is 0x%s\n", formatLongLong(val));
#endif
   return val;
}
开发者ID:cseagle,项目名称:collabREate,代码行数:9,代码来源:collabreate.cpp

示例2: write_hash

void SuperFamicomCartridge::write_hash(netnode & node) const
{
  node.hashset("rom_size", rom_size);
  node.hashset("ram_size", ram_size);
  node.hashset("firmware_appended", firmware_appended ? 1 : 0);

  node.hashset("header_offset", header_offset);

  node.hashset("type", type_string());
  node.hashset("region", region_string());
  node.hashset("mapper", mapper_string());
  node.hashset("dsp1_mapper", dsp1_mapper_string());

  node.hashset("has_bsx_slot", has_bsx_slot ? 1 : 0);
  node.hashset("has_superfx", has_superfx ? 1 : 0);
  node.hashset("has_sa1", has_sa1 ? 1 : 0);
  node.hashset("has_sharprtc", has_sharprtc ? 1 : 0);
  node.hashset("has_epsonrtc", has_epsonrtc ? 1 : 0);
  node.hashset("has_sdd1", has_sdd1 ? 1 : 0);
  node.hashset("has_spc7110", has_spc7110 ? 1 : 0);
  node.hashset("has_cx4", has_cx4 ? 1 : 0);
  node.hashset("has_dsp1", has_dsp1 ? 1 : 0);
  node.hashset("has_dsp2", has_dsp2 ? 1 : 0);
  node.hashset("has_dsp3", has_dsp3 ? 1 : 0);
  node.hashset("has_dsp4", has_dsp4 ? 1 : 0);
  node.hashset("has_obc1", has_obc1 ? 1 : 0);
  node.hashset("has_st010", has_st010 ? 1 : 0);
  node.hashset("has_st011", has_st011 ? 1 : 0);
  node.hashset("has_st018", has_st018 ? 1 : 0);
}
开发者ID:Aliandrana,项目名称:ida-snes-ldr,代码行数:30,代码来源:super-famicom.hpp

示例3:

// create the netnode helper and fetch idpflags value
inline static uint32 refresh_idpflags(void) {
    helper.create("$ m32r");
    idpflags = (uint32)helper.altval(-1);
    return idpflags;
}
开发者ID:Artorios,项目名称:IDAplugins-1,代码行数:6,代码来源:reg.cpp

示例4: term

void idaapi term(void) {
   msg(PLUGIN_NAME": collabREate is being unloaded\n");
   authenticated = false;
   if (is_connected()) {
      msg(PLUGIN_NAME": calling cleanup\n");
      cleanup();
      msg(PLUGIN_NAME": back from cleanup\n");
   }
   msg(PLUGIN_NAME": closing status form\n");
   close_chooser("Collab form:1");
   msg(PLUGIN_NAME": status form closed\n");
   if (msgHistory.size() > 0) {
      qstring temp;
      for (unsigned int i = 0; i < msgHistory.size(); i++) {
         temp += msgHistory[i];
         temp += '\n';
      }
      cnn.setblob(temp.c_str(), temp.length() + 1, 1, COLLABREATE_MSGHISTORY_TAG);
      msgHistory.clear();
   }
   if (changeCache != NULL && changeCache->length() > 0) {
      cnn.setblob(changeCache->c_str(), changeCache->length() + 1, 1, COLLABREATE_CACHE_TAG);
      delete changeCache;
      changeCache = NULL;
   }
   unhookAll();
}
开发者ID:cseagle,项目名称:collabREate,代码行数:27,代码来源:collabreate.cpp

示例5: notify

//--------------------------------------------------------------------------
static int notify(processor_t::idp_notify msgid, ...) { // Various messages:
  va_list va;
  va_start(va, msgid);
  int code = invoke_callbacks(HT_IDP, msgid, va);
  if ( code ) return code;
  switch ( msgid ) {
    case processor_t::newfile:
    case processor_t::oldfile:
      tnode.create("$ tms node");
    default:
      break;

    case processor_t::move_segm:// A segment is moved
                                // Fix processor dependent address sensitive information
                                // args: ea_t from - old segment address
                                //       segment_t - moved segment
      {
        ea_t from    = va_arg(va, ea_t);
        segment_t *s = va_arg(va, segment_t *);
        asize_t size = s->size();
        tnode.altshift(from, s->startEA, size);
        tnode.altadjust(from, s->startEA, size, skip_12);
      }
      break;

  }
  return(1);
}
开发者ID:Artorios,项目名称:IDAplugins-1,代码行数:29,代码来源:reg.cpp

示例6: notify

//----------------------------------------------------------------------
static int idaapi notify(processor_t::idp_notify msgid, ...)
{
  va_list va;

  va_start(va, msgid);

  // A well behaving processor module should call invoke_callbacks()
  // in his notify() function. If this function returns 0, then
  // the processor module should process the notification itself
  // Otherwise the code should be returned to the caller:

  int code = invoke_callbacks(HT_IDP, msgid, va);

  if (code)
    return code;

  switch (msgid)
  {
    case processor_t::init:
      inf.mf = 0;
      inf.s_genflags |= INFFL_LZERO;
      helper.create("$ CR16");
    default:
      break;

    case processor_t::term:
      free_ioports(ports, numports);
      break;

    case processor_t::newfile:
      // ask for a  processor from the config file
      // use it to handle ports and registers
      {
        char cfgfile[QMAXFILE];

        get_cfg_filename(cfgfile, sizeof(cfgfile));
        if ( choose_ioport_device(cfgfile, device, sizeof(device), parse_area_line0) )
          set_device_name(device, IORESP_ALL);
      }
      break;

    case processor_t::newprc:
      {
        char buf[MAXSTR];
        if (helper.supval(-1, buf, sizeof(buf)) > 0)
          set_device_name(buf, IORESP_PORT);
      }
      break;

    case processor_t::newseg:
      {
        segment_t *s = va_arg(va, segment_t *);
        // Set default value of DS register for all segments
        set_default_dataseg(s->sel);
      }
      break;
  }
  va_end(va);
  return 1;
}
开发者ID:nihilus,项目名称:ida_objectivec_plugins,代码行数:61,代码来源:reg.cpp

示例7: get_first_class_idx

uval_t get_first_class_idx(void)
{
	if (classes_indexes.altval(0))	  
		return 0;
	else
		return -1;
}
开发者ID:IDA-RE-things,项目名称:hexrays_tools,代码行数:7,代码来源:classes.cpp

示例8: memcpy

const char *set_idp_options(const char *keyword,int value_type,const void *value)
{
  ushort trans;
  if ( keyword == NULL )
  {
    trans = macro11.XlatAsciiOutput != NULL;
    if ( !AskUsingForm_c(form, &trans) ) return IDPOPT_OK;
  }
  else
  {
    if ( strcmp(keyword, "XlatAsciiOutput") == 0 )
    {
      if ( value_type != IDPOPT_STR ) return IDPOPT_BADTYPE;
      memcpy(trans_dec_pc1, value, 256);
      return IDPOPT_OK;
    }
    if ( strcmp(keyword, "PDP_XLAT_ASCII") != 0 ) return IDPOPT_BADKEY;
    if ( value_type != IDPOPT_BIT ) return IDPOPT_BADTYPE;
    trans = *(ushort*)value;
  }
  ovrtrans.altset(n_asciiX, !trans); // it is strange but it is like this
  ash.XlatAsciiOutput = macro11.XlatAsciiOutput = trans ? trans_dec_pc1 : NULL;
  msg("Character Translation is %s\n", trans ? "enabled" : "disabled");
  return IDPOPT_OK;
}
开发者ID:nealey,项目名称:vera,代码行数:25,代码来源:reg.cpp

示例9: notify

// The kernel event notifications
// Here you may take desired actions upon some kernel events
static int notify(processor_t::idp_notify msgid, ...)
{
    va_list va;
    va_start(va, msgid);

    // A well behavior processor module should call invoke_callbacks()
    // in his notify() function. If this function returns 0, then
    // the processor module should process the notification itself
    // Otherwise the code should be returned to the caller:

    int code = invoke_callbacks(HT_IDP, msgid, va);
    if ( code ) return code;

    switch ( msgid ) {
        case processor_t::init:
            inf.mf = 1;
            helper.create("$ fr");
        default:
            break;

        case processor_t::term:
            free_ioports(ports, numports);
            break;

        case processor_t::newfile:
            choose_device();
            set_device_name(device, IORESP_ALL);
            break;

        case processor_t::oldfile:
            {
              char buf[MAXSTR];
              if ( helper.supval(-1, buf, sizeof(buf)) > 0 )
                set_device_name(buf, IORESP_NONE);
            }
            break;

        case processor_t::closebase:
        case processor_t::savebase:
            helper.supset(-1, device);
            break;
    }

    va_end(va);

    return(1);
}
开发者ID:nealey,项目名称:vera,代码行数:49,代码来源:reg.cpp

示例10: init

//--------------------------------------------------------------------------
//
//      Initialize.
//
//      IDA will call this function only once.
//      If this function returns PLGUIN_SKIP, IDA will never load it again.
//      If this function returns PLUGIN_OK, IDA will unload the plugin but
//      remember that the plugin agreed to work with the database.
//      The plugin will be loaded again if the user invokes it by
//      pressing the hotkey or selecting it from the menu.
//      After the second load the plugin will stay on memory.
//      If this function returns PLUGIN_KEEP, IDA will keep the plugin
//      in the memory. In this case the initialization function can hook
//      into the processor module and user interface notification points.
//      See the hook_to_notification_point() function.
//
//      In this example we check the input file format and make the decision.
//      You may or may not check any other conditions to decide what you do:
//      whether you agree to work with the database or not.
//
int idaapi init(void) {
   unsigned char md5[MD5_LEN];
   msg(PLUGIN_NAME": collabREate has been loaded\n");
   //while the md5 is not used here, it has the side effect of ensuring
   //that the md5 is taken at the earliest opportunity for storage in
   //the database in the event that the original binary is deleted
   getFileMd5(md5, sizeof(md5));
   unsigned char gpid[GPID_SIZE];
   ssize_t sz = getGpid(gpid, sizeof(gpid));
   if (sz > 0) {
      msg(PLUGIN_NAME": Operating in caching mode until connected.\n");
      if (changeCache == NULL) {
         size_t sz = 0;
         void *tcache = cnn.getblob(NULL, &sz, 1, COLLABREATE_CACHE_TAG);
         if (tcache != NULL && sz > 0) {
            changeCache = new qstring((char*)tcache);
         }
         else {
            changeCache = new qstring();
         }
         qfree(tcache);
         hookAll();
      }
   }
   if (msgHistory.size() == 0) {
      size_t sz = 0;
      void *thist = cnn.getblob(NULL, &sz, 1, COLLABREATE_MSGHISTORY_TAG);
      if (thist != NULL && sz > 1) {
         char *sptr, *endp;
         sptr = (char*)thist;
         while ((endp = strchr(sptr, '\n')) != NULL) {
            msgHistory.push_back(qstring(sptr, endp - sptr));
            sptr = endp + 1;
         }
      }
      qfree(thist);
   }
   build_handler_map();
   if (init_network()) {
      return PLUGIN_KEEP;
   }
   else {
      return PLUGIN_SKIP;
   }
}
开发者ID:cseagle,项目名称:collabREate,代码行数:65,代码来源:collabreate.cpp

示例11: load_offset

//-----------------------------------------------------------------------
static ea_t load_offset(ea_t base, adiff_t value)
{
  if(base == m.ovrtbl_base && value >= m.ovrcallbeg && value <= m.ovrcallend)
  {
    ea_t trans = ovrtrans.altval(value);
    if(trans != 0) return(trans);
  }
  return(base + value);
}
开发者ID:nealey,项目名称:vera,代码行数:10,代码来源:reg.cpp

示例12: get_class_by_idx

tid_t  get_class_by_idx(uval_t idx)   // get class id by class number
{
	tid_t result;
	if ( idx == -1 )
		result = -1;
	else
		result =  classes_indexes.altval(idx)-1;
	return result;
}
开发者ID:IDA-RE-things,项目名称:hexrays_tools,代码行数:9,代码来源:classes.cpp

示例13: strcmp

const char *set_idp_options(
    const char *keyword,
    int /*value_type*/,
    const void * /*value*/ )
{
    if ( keyword != NULL )
        return IDPOPT_BADKEY;

    if ( !choose_ioport_device(cfgname, device, sizeof(device), NULL)
      && strcmp(device, NONEPROC) == 0 )
    {
      warning("No devices are defined in the configuration file %s", cfgname);
    }
    else
    {
      char buf[MAXSTR];
      if ( helper.supval(-1, buf, sizeof(buf)) > 0 )
        set_device_name(buf, IORESP_ALL);
    }
    return IDPOPT_OK;
}
开发者ID:nealey,项目名称:vera,代码行数:21,代码来源:reg.cpp

示例14: process_symbol_class

//----------------------------------------------------------------------
static void process_symbol_class(uint32 ea, uchar sclass, const char *name)
{
  switch ( sclass )
  {
    case kPEFCodeSymbol :
    case kPEFGlueSymbol :
      add_entry(ea, ea, name, 1);
      break;
    case kPEFTVectSymbol:
      process_vector(ea, name);
      break;
    case kPEFTOCSymbol  :
      if ( segtype(ea) == SEG_DATA && ea < toc_ea )
      {
        toc_ea = ea;
        ph.notify(processor_t::idp_notify(ph.loader+1), toc_ea);
      }
      toc.charset(ea, XMC_TD+1, 1);
      /* fall thru */
    case kPEFDataSymbol :
      set_name(ea, name);
      break;
  }
}
开发者ID:awesome-security,项目名称:vera,代码行数:25,代码来源:pef.cpp

示例15: get_class_qty

size_t get_class_qty(void)
{
	return classes_indexes.altval(-1);
}
开发者ID:IDA-RE-things,项目名称:hexrays_tools,代码行数:4,代码来源:classes.cpp


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