예제 #1
0
파일: out.cpp 프로젝트: trietptm/usefulres
//--------------------------------------------------------------------------
// конец текста
void N78K_footer(void)
{
  char buf[MAXSTR];
  char *const end = buf + sizeof(buf);
  if (ash.end != NULL){
    MakeNull();
#if IDP_INTERFACE_VERSION > 37
    char *ptr = tag_addstr(buf, end, COLOR_ASMDIR, ash.end);
    char name[MAXSTR];
    if (get_colored_name(BADADDR, inf.beginEA, name, sizeof(name)) != NULL){
		register int i = strlen(ash.end);
		do APPCHAR(ptr, end, ' '); while(++i < 8);
		APPEND(ptr, end, name);
    }
    MakeLine(buf,inf.indent);
#else
    register char *p = tag_addstr(buf, COLOR_ASMDIR, ash.end);
    const char *start = get_colored_name(inf.beginEA);
    if(start != NULL) {
      *p++ = ' ';
      strcpy(p, start);
    }
    MakeLine(buf);
#endif
  } else gen_cmt_line("end of file");
}
예제 #2
0
파일: out.cpp 프로젝트: trietptm/usefulres
static void do_out_equ(const char *name, const char *equ, uchar off)
{
  char buf[MAXSTR];
  char *ptr = buf;
  char *const end = buf + sizeof(buf);
  gl_name = 0;
  if (ash.uflag & UAS_PSAM)
  {
    ptr = tag_addstr(ptr, end, COLOR_KEYWORD, equ);
    APPCHAR(ptr, end, ' ');
    APPEND(ptr, end, name);
    ptr = tag_addchr(ptr, end, COLOR_SYMBOL, ',');
  }
  else
  {
    APPEND(ptr, end, name);
    if(ash.uflag & UAS_EQCLN)
      ptr = tag_addchr(ptr, end, COLOR_SYMBOL, ':');
    APPCHAR(ptr, end, ' ');
    ptr = tag_addstr(ptr, end, COLOR_KEYWORD, equ);
    APPCHAR(ptr, end, ' ');
  }
  ptr = tag_on(ptr, end, COLOR_NUMBER);
  ptr += btoa32(ptr, end-ptr, off);
  tag_off(ptr, end, COLOR_NUMBER);
  MakeLine(buf, 0);
}
예제 #3
0
//--------------------------------------------------------------------------
static void out_equ(const char *name, const char *equ, uchar off)
{
  char buf[MAXSTR];
  char *const end = buf + sizeof(buf);

  char *p = tag_addstr(buf, end, COLOR_DNAME, name);
  APPCHAR(p, end, ' ');
  p = tag_addstr(p, end, COLOR_KEYWORD, equ);
  APPCHAR(p, end, ' ');
  p = tag_on(p, end, COLOR_NUMBER);
  p += btoa(p, end-p, off);
  tag_off(p, end, COLOR_NUMBER);
  MakeLine(buf, 0);
}
예제 #4
0
파일: out.cpp 프로젝트: nealey/vera
// --------------------------------------------------------------------------
// generate end of the disassembly
void idaapi footer(void) {
  char buf[MAXSTR];

  // if assembler supplies end statement, output it
  if (ash.end != NULL) {
    MakeNull();
    tag_addstr(buf, buf+sizeof(buf), COLOR_ASMDIR, ash.end);
    MakeLine(buf, inf.indent);
  }
}
예제 #5
0
//--------------------------------------------------------------------------
void idaapi footer(void)
{
  char buf[MAXSTR];

  MakeNull();

  tag_addstr(buf, buf+sizeof(buf), COLOR_ASMDIR, ash.end);
  MakeLine(buf, inf.indent);

  gen_cmt_line("end of file");
}
예제 #6
0
파일: out.cpp 프로젝트: trietptm/usefulres
static int out_equ(ea_t ea)
{
  char buf[MAXSTR];
  char *const end = buf + sizeof(buf);
  segment_t *s = getseg(ea);
  if ( s != NULL && s->type == SEG_IMEM && ash.a_equ != NULL)
  {
    char nbuf[MAXSTR];
    char *name = get_name(BADADDR, ea, nbuf, sizeof(nbuf));
    if ( name != NULL
      && ((ash.uflag & UAS_PBYTNODEF) == 0 || !IsPredefined(name)) )
    {
      get_colored_name(BADADDR, ea, buf, sizeof(buf));
      uchar off = uchar(ea - get_segm_base(s));
      do_out_equ(buf, ash.a_equ, off);
      if ( (ash.uflag & UAS_AUBIT) == 0 && (off & 0xF8) == off )
      {
        char *ptr = tag_on(tail(buf), end, COLOR_SYMBOL);
        APPCHAR(ptr, end, ash.uflag & UAS_NOBIT ? '_' : '.');
        APPCHAR(ptr, end, '0');
        tag_off(ptr, end, COLOR_SYMBOL);
        for ( int i=0; i < 8; i++ )
        {
          const ioport_bit_t *b = find_bit(off, i);
          char *p2 = ptr;
          if ( b == NULL || b->name == NULL )
            ptr[-1] = '0' + i;
          else
            p2 = tag_addstr(ptr-1, end, COLOR_HIDNAME, b->name);
          tag_off(p2, end, COLOR_SYMBOL);
          do_out_equ(buf, ash.a_equ, off+i);
        }
        MakeNull();
      }
    }
    else
    {
      gl_name = 0;
      MakeLine("");
    }
    return 1;
  }
  if ( ash.uflag & UAS_NODS )
  {
    if ( !isLoaded(ea) && s->type == SEG_CODE )
    {
      adiff_t org = ea - get_segm_base(s) + get_item_size(ea);
      btoa(buf, sizeof(buf), org);
      printf_line(inf.indent, COLSTR("%s %s", SCOLOR_ASMDIR), ash.origin, buf);
      return 1;
    }
  }
  return 0;
}
예제 #7
0
파일: out.cpp 프로젝트: nealey/vera
// Generate disassembly footer
void footer(void) {
    char buf[MAXSTR];
    char *const end = buf + sizeof(buf);
    if ( ash.end != NULL ) {
        MakeNull();
        register char *p = tag_addstr(buf, end, COLOR_ASMDIR, ash.end);
        char name[MAXSTR];
        if ( get_colored_name(BADADDR, inf.beginEA, name, sizeof(name)) != NULL ) {
            APPCHAR(p, end, ' ');
            APPEND(p, end, name);
        }
        MakeLine(buf, inf.indent);
    }
    else {
        gen_cmt_line("end of file");
    }
}