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


C++ netnode::create方法代码示例

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


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

示例1: 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

示例2: 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

示例3: 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

示例4: is_jump_func

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

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

    case processor_t::newfile:  // new file loaded
    case processor_t::oldfile:  // old file loaded
      load_symbols();
      break;

    case processor_t::savebase:
    case processor_t::closebase:
      helper.supset(0, device);
      break;

    case processor_t::newprc:   // new processor type
      procnum = va_arg(va, int);
      if ( isc4() ) ph.retcodes = retcodes4;
      break;

    case processor_t::is_jump_func:
      {
        const func_t *pfn = va_arg(va, const func_t *);
        ea_t *jump_target = va_arg(va, ea_t *);
        return is_jump_func(pfn, jump_target);
      }

    case processor_t::is_sane_insn:
      return is_sane_insn(va_arg(va, int));

    case processor_t::may_be_func:
                                // can a function start here?
                                // arg: none, the instruction is in 'cmd'
                                // returns: probability 0..100
                                // 'cmd' structure is filled upon the entrace
                                // the idp module is allowed to modify 'cmd'
      return may_be_func();

  }
  va_end(va);
  return 1;
}
开发者ID:nihilus,项目名称:ida_objectivec_plugins,代码行数:62,代码来源:reg.cpp

示例5: 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:
//      __emit__(0xCC);   // debugger trap
      helper.create("$ hppa");
      inf.mf = 1;         // always big endian
      syscalls = read_ioports(&nsyscalls, "hpux.cfg", NULL, 0, NULL);
      break;

    case processor_t::term:
      free_ioports(syscalls, nsyscalls);
      break;

    case processor_t::newfile:      // new file loaded
      handle_new_flags();
      setup_got();
      break;

    case processor_t::oldfile:      // old file loaded
      idpflags = helper.altval(-1);
      handle_new_flags();
      setup_got();
      break;

    case processor_t::newprc:    // new processor type
      break;

    case processor_t::newasm:    // new assembler type
      break;

    case processor_t::newseg:    // new segment
      {
        segment_t *sptr = va_arg(va, segment_t *);
        sptr->defsr[ rVds-ph.regFirstSreg] = find_selector(sptr->sel);
        sptr->defsr[DPSEG-ph.regFirstSreg] = 0;
      }
      break;

    case processor_t::is_sane_insn:
      return is_sane_insn(va_arg(va, int));

    case processor_t::may_be_func:
                                // can a function start here?
                                // arg: none, the instruction is in 'cmd'
                                // returns: probability 0..100
                                // 'cmd' structure is filled upon the entrace
                                // the idp module is allowed to modify 'cmd'
      return may_be_func();

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

// +++ TYPE CALLBACKS (only 32-bit programs for the moment)
    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);
      }

    case processor_t::max_ptr_size:
      return 4+1;

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

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

    case processor_t::calc_arglocs:
      {
        const type_t **type = va_arg(va, const type_t **);
//.........这里部分代码省略.........
开发者ID:trietptm,项目名称:usefulres,代码行数:101,代码来源:reg.cpp

示例6: 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("$ tms320c3x");
      inf.mf = 1; // MSB first
      inf.wide_high_byte_first = 1;
      init_analyzer();
      break;

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

    case processor_t::newfile:   // new file loaded
      inf.wide_high_byte_first = 0;
      {
        segment_t *s0 = get_first_seg();
        if ( s0 != NULL )
        {
          set_segm_name(s0, "CODE");
          segment_t *s1 = get_next_seg(s0->startEA);
          for (int i = dp; i <= rVds; i++)
          {
            SetDefaultRegisterValue(s0, i, BADSEL);
            SetDefaultRegisterValue(s1, i, BADSEL);
          }
        }
      }
      select_device(IORESP_ALL);
      break;

    case processor_t::oldfile:   // old file loaded
      inf.wide_high_byte_first = 0;
      idpflags = (ushort)helper.altval(-1);
      {
        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.altset(-1, idpflags);
      break;

    case processor_t::is_basic_block_end:
      return is_basic_block_end() ? 2 : 0;
  }
  va_end(va);
  return 1;
}
开发者ID:nealey,项目名称:vera,代码行数:66,代码来源:reg.cpp

示例7: 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

示例8: 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:
//      __emit__(0xCC);   // debugger trap
      helper.create("$ f2mc");
      {
        char buf[MAXSTR];
        if ( helper.supval(0, buf, sizeof(buf)) > 0 )
          f2mc_set_device_name(buf, IORESP_NONE);
      }
      inf.wide_high_byte_first = 1;
      break;

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

    case processor_t::newfile:   // new file loaded
      set_segm_name(get_first_seg(), "CODE");
      if ( choose_ioport_device(cfgname, device, sizeof(device), parse_area_line0) )
        f2mc_set_device_name(device, IORESP_ALL);
      for ( int i = DTB; i <= rVds; i++ )
      {
        for ( segment_t *s=get_first_seg(); s != NULL; s=get_next_seg(s->startEA) )
          SetDefaultRegisterValue(s, i, 0);
      }
      break;

    case processor_t::oldfile:   // old file loaded
      idpflags = (ushort)helper.altval(-1);
      break;

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

    case processor_t::newprc:    // new processor type
      {
        ptype = ptypes[va_arg(va, int)];
        switch ( ptype )
        {
          case F2MC16L:
            cfgname = "f2mc16l.cfg";
            break;
          case F2MC16LX:
            cfgname = "f2mc16lx.cfg";
            break;
          default:
            error("interr: setprc");
            break;
        }
        device[0] = '\0';
        if ( get_first_seg() != NULL )
          choose_device(NULL, 0);
      }
      break;

    case processor_t::newasm:    // new assembler type
      break;

    case processor_t::newseg:    // new segment
      break;

  }
  va_end(va);
  return 1;
}
开发者ID:awesome-security,项目名称:vera,代码行数:82,代码来源:reg.cpp

示例9: 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

示例10: 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

示例11:

// 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

示例12: 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

示例13: switch

//----------------------------------------------------------------------
static int idaapi nec850_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;
    prog_pointers.create("$ prog pointers");
    break;

  case processor_t::is_sane_insn:
    {
      int no_crefs = va_arg(va, int);
      return nec850_is_sane_insn(no_crefs);
    }

  case processor_t::newprc:
    {
      int procnum = va_arg(va, int);
      is_v850e = procnum == 0;
      break;
    }
  case processor_t::term:
    break;

  // save database
  case processor_t::closebase:
  case processor_t::savebase:
    prog_pointers.altset(GP_EA_IDX, g_gp_ea);
    break;

  // old file loaded
  case processor_t::oldfile:
    g_gp_ea = prog_pointers.altval(GP_EA_IDX);
    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);
    }
  // A segment is moved
  //case processor_t::move_segm:
  //  // 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 *);
  //    // adjust gp_ea
  //  }
  //  break;
  default:
    break;
  }
  va_end(va);
  return 1;
}
开发者ID:nealey,项目名称:vera,代码行数:71,代码来源:reg.cpp


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