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

C++ netnode类代码示例

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

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



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


示例16: is_basic_block_end

// The kernel event notifications
// Here you may take desired actions upon some kernel events
static int idaapi 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;

	case processor_t::is_basic_block_end:
		return is_basic_block_end() ? 2 : 0;


#ifdef FR_TYPEINFO_SUPPORT
		// +++ TYPE CALLBACKS
	case processor_t::max_ptr_size:
		return 4+1;

	case processor_t::get_default_enum_size: // get default enum size
		// args:  cm_t cm
		// returns: sizeof(enum)
		{
			//        cm_t cm        =  va_argi(va, cm_t);
			return 1; // inf.cc.size_e;
		}

	case processor_t::based_ptr:
		{
			uint ptrt      = va_arg(va, unsigned int); qnotused(ptrt);
			char **ptrname = va_arg(va, char **);
			*ptrname = NULL;
			return 0;                       // returns: size of type
		}

	case processor_t::get_stkarg_offset2:
		// get offset from SP to the first stack argument
		// args: none
		// returns: the offset+2
		return 0x00 + 2;

	case processor_t::calc_cdecl_purged_bytes2:
		// calculate number of purged bytes after call
		{
			//ea_t ea = va_arg(va, ea_t);
			return 0x00 + 2;
		}

#endif // FR_TYPEINFO_SUPPORT 
#ifdef FR_TINFO_SUPPORT
	case processor_t::decorate_name3:
		{
			qstring *outbuf  = va_arg(va, qstring *);
			const char *name = va_arg(va, const char *);
			bool mangle      = va_argi(va, bool);
			cm_t cc          = va_argi(va, cm_t);
			return gen_decorate_name3(outbuf, name, mangle, cc) ? 2 : 0;
		}

	case processor_t::calc_retloc3:
		//msg("calc_retloc3\n");
		{
			const tinfo_t *type = va_arg(va, const tinfo_t *);
			cm_t cc             = va_argi(va, cm_t);
			argloc_t *retloc    = va_arg(va, argloc_t *);
//.........这里部分代码省略.........
开发者ID:Junky228,项目名称:nikon-firmware-tools,代码行数:101,代码来源:reg.cpp


示例17: gen_decorate_name

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:
//      __emit__(0xCC);   // debugger trap
      helper.create("$ h8");
      helper.supval(0, device, sizeof(device));
      inf.mf = 1;
    default:
      break;

    /* +++ START TYPEINFO CALLBACKS +++ */
    // see module/{i960,hppa}/reg.cpp starting on line 253
    // Decorate/undecorate a C symbol name
    // Arguments:
    // const til_t *ti    - pointer to til
    // const char *name   - name of symbol
    // const type_t *type - type of symbol. If NULL then it will try to guess.
    // char *outbuf       - output buffer
    // size_t bufsize     - size of the output buffer
    // bool mangle        - true-mangle, false-unmangle
    // cm_t cc            - real calling convention for VOIDARG functions
    // returns: true if success
    case processor_t::decorate_name:
      {
        const til_t *ti    = va_arg(va, const til_t *);
        const char *name   = va_arg(va, const char *);
        const type_t *type = va_arg(va, const type_t *);
        char *outbuf       = va_arg(va, char *);
        size_t bufsize     = va_arg(va, size_t);
        bool mangle        = va_argi(va, bool);
        cm_t real_cc       = va_argi(va, cm_t);
        return gen_decorate_name(ti, name, type, outbuf, bufsize, mangle, real_cc);
      }

    // Setup default type libraries (called after loading a new file into the database)
    // The processor module may load tils, setup memory model and perform other actions
    // required to set up the type system.
    // args:    none
    // returns: nothing
    case processor_t::setup_til:
      {
      }

    // Purpose: get prefix and size of 'segment based' ptr type (something like
    // char _ss *ptr). See description in typeinf.hpp.
    // Other modules simply set the pointer to NULL and return 0
    // Ilfak confirmed that this approach is correct for the H8.
    // Used only for BTMT_CLOSURE types, doubtful you will encounter them for H8.
    // Arguments:
    // unsigned int ptrt    - ...
    // const char **ptrname - output arg
    // returns: size of type
    case processor_t::based_ptr:
      {
        /*unsigned int ptrt =*/ va_arg(va, unsigned int);
        char **ptrname    = va_arg(va, char **);
        *ptrname = NULL;
        return 0;
      }

    // The H8 supports normal (64KB addressing, 16 bits) and advanced mode
    // (16MB addressing, 24 bits).  However, according to the Renesas technical
    // documentation, certain instructions accept 32-bit pointer values where
    // the upper 8 bits are "reserved".  Ilfak confirms that "4+1" is fine.
    // Used only for BTMT_CLOSURE types, doubtful you will encounter them for H8.
    case processor_t::max_ptr_size:
      {
        return 4+1;
      }

    // get default enum size
    // args:  cm_t cm
    // returns: sizeof(enum)
    case processor_t::get_default_enum_size:
      {
        // cm_t cm        =  va_argi(va, cm_t);
        return inf.cc.size_e;
      }

    case processor_t::use_stkarg_type:
      {
        ea_t ea            = va_arg(va, ea_t);
        const type_t *type = va_arg(va, const type_t *);
        const char *name   = va_arg(va, const char *);
        return h8_use_stkvar_type(ea, type, name);
      }

//.........这里部分代码省略.........
开发者ID:IDA-RE-things,项目名称:ida-H8,代码行数:101,代码来源:reg.cpp


示例18: notify

static int 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:
      helper.create("$ pic");
      helper.supval(0, device, sizeof(device));
    default:
      break;

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

    case processor_t::newfile:   // new file loaded
      {
        segment_t *s0 = get_first_seg();
        if ( s0 != NULL )
        {
          set_segm_name(s0, "CODE");
          dataseg = AdditionalSegment(0x200, 0, "DATA");
          segment_t *s1 = get_next_seg(s0->startEA);
          SetDefaultRegisterValue(s0, BANK, 0);
          SetDefaultRegisterValue(s1, BANK, 0);
          SetDefaultRegisterValue(s0, PCLATH, 0);
          SetDefaultRegisterValue(s1, PCLATH, 0);
          SetDefaultRegisterValue(s0, PCLATU, 0);
          SetDefaultRegisterValue(s1, PCLATU, 0);
          setup_device(IORESP_INT);
          apply_symbols();
        }
      }
      break;

    case processor_t::oldfile:   // old file loaded
      idpflags = (ushort)helper.altval(-1);
      dataseg  = helper.altval(0);
      create_mappings();
      for ( segment_t *s=get_first_seg(); s != NULL; s=get_next_seg(s->startEA) )
      {
        if ( s->defsr[PCLATH-ph.regFirstSreg] == BADSEL )
          s->defsr[PCLATH-ph.regFirstSreg] = 0;
      }
      break;

    case processor_t::closebase:
    case processor_t::savebase:
      helper.altset(0,  dataseg);
      helper.altset(-1, idpflags);
      helper.supset(0,  device);
      break;

    case processor_t::newprc:    // new processor type
      {
        int n = va_arg(va, int);
        static bool set = false;
        if ( set )
          return 0;
        set = true;
        if ( ptypes[n] != ptype )
        {
          ptype = ptypes[n];
          ph.cnbits = 12 + 2*n;
        }
        switch ( ptype )
        {
          case PIC12:
            register_names[PCLATH] = "status";
            cfgname = "pic12.cfg";
            break;
          case PIC14:
            cfgname = "pic14.cfg";
            break;
          case PIC16:
            register_names[BANK] = "bsr";
            cfgname = "pic16.cfg";
            idpflags = 0;
            ph.cnbits = 8;
            ph.regLastSreg = PCLATU;
            break;
          default:
            error("interr in setprc");
            break;
        }
      }
      break;

    case processor_t::newasm:    // new assembler type
//.........这里部分代码省略.........
开发者ID:nealey,项目名称:vera,代码行数:101,代码来源:reg.cpp


示例19: 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::newfile:
            helper.create("$ m7700");
            if ( choose_device() )
                set_device_name(device, IORESP_ALL);
            //  Set the default segment register values :
            //      -1 (badsel) for DR
            //      0 for fM and fX
            for ( segment_t *s=get_first_seg(); s != NULL; s=get_next_seg(s->startEA) )
            {
                SetDefaultRegisterValue(s, rDR, BADSEL);
                SetDefaultRegisterValue(s, rfM, 0);
                SetDefaultRegisterValue(s, rfX, 0);
            }
            info(m7700_help_message);
            break;

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

        case processor_t::newprc:
            ptype = processor_subtype_t(va_arg(va, int));
            break;

        case processor_t::setsgr:
          {
            ea_t ea1 = va_arg(va, ea_t);
            ea_t ea2 = va_arg(va, ea_t);
            int reg  = va_arg(va, int);
            sel_t v  = va_arg(va, sel_t);
            sel_t ov = va_arg(va, sel_t);
            if ( (reg == rfM || reg == rfX) && v != ov )
              set_sreg_at_next_code(ea1, ea2, reg, ov);
          }
          break;

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

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

    va_end(va);

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


示例20: notify

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

// A well behaved 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;

  int retcode = 1;
  switch ( msgid )
  {
    case processor_t::init:
      helper.create("$ spc700");
      break;
    case processor_t::term:
      free_ioports(ports, numports);
      break;
    case processor_t::oldfile:
    case processor_t::newfile:
      {
        char buf[MAXSTR];
        const char *device_ptr = buf;
        ssize_t len = helper.hashstr("device", buf, sizeof(buf));
        if ( len <= 0 )
          device_ptr = "spc700";

        if ( msgid == processor_t::newfile )
        {
          set_device_name(device_ptr, IORESP_ALL);
          set_dsp_regs_enum();

          set_default_segreg_value(NULL, rDs, 0);
          set_default_segreg_value(NULL, rFp, 0);
        }
      }
      break;

    case processor_t::may_be_func:
      retcode = 0;
      ea_t cref_addr;
      for( cref_addr = get_first_cref_to(cmd.ea);
           cref_addr != BADADDR;
           cref_addr = get_next_cref_to(cmd.ea, cref_addr) )
      {
        uint8 opcode = get_byte(cref_addr);
        const struct opcode_info_t &opinfo = get_opcode_info(opcode);
        if ( opinfo.itype == SPC_call
          || opinfo.itype == SPC_jmp )
        {
          retcode = 100;
          break;
        }
      }
      break;

    case processor_t::is_call_insn:
      {
        const struct opcode_info_t &opinfo = get_opcode_info(get_byte(va_arg(va, ea_t)));
        if ( opinfo.itype == SPC_call )
          retcode = 2;
        else
          retcode = 0;
      }
      break;

    case processor_t::is_ret_insn:
      {
        const struct opcode_info_t &opinfo = get_opcode_info(get_byte(va_arg(va, ea_t)));
        if ( opinfo.itype == SPC_ret
          || opinfo.itype == SPC_reti )
          retcode = 2;
        else
          retcode = 0;
      }
      break;

    case processor_t::is_indirect_jump:
      {
        const struct opcode_info_t &opinfo = get_opcode_info(get_byte(va_arg(va, ea_t)));
        if ( opinfo.itype == SPC_jmp )
        {
          if ( opinfo.addr == ABS_IX_INDIR )
            retcode = 3;
          else
            retcode = 2;
        }
        else
          retcode = 1;
      }
      break;

    default:
      break;
  }
//.........这里部分代码省略.........
开发者ID:gocha,项目名称:ida-spc700-module,代码行数:101,代码来源:reg.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ network类代码示例发布时间:2022-05-31
下一篇:
C++ namespacet类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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