//-------------------------------------------------------------------------- void header(void) { gen_cmt_line("Processor: %s [%s]", device[0] ? device : inf.procName, deviceparams); gen_cmt_line("Target assebler: %s", ash.name); if (ash.header != NULL ) for (const char **ptr=ash.header; *ptr != NULL; ptr++ ) MakeLine(*ptr, 0); }
//-------------------------------------------------------------------------- void header(void) { gen_cmt_line("Processor : %-8.8s [%s]", inf.procName, device); gen_cmt_line("Target assembler: %s", ash.name); gen_cmt_line("Byte sex : %s", inf.mf ? "Big endian" : "Little endian"); if ( ash.header != NULL ) for ( const char **ptr=ash.header; *ptr != NULL; ptr++ ) printf_line(0, COLSTR("%s",SCOLOR_ASMDIR),*ptr); }
// Generate disassembly header void header(void) { gen_cmt_line("Processor: %s", inf.procName); gen_cmt_line("Target assembler: %s", ash.name); if ( ash.header != NULL ) { for (const char **ptr = ash.header; *ptr != NULL; ptr++) { MakeLine(*ptr,0); } } }
//-------------------------------------------------------------------------- void N78K_header(void) { #if IDP_INTERFACE_VERSION > 37 gen_cmt_line("Processor: %s [%s]", device[0] ? device : inf.procName, deviceparams); #else gen_cmt_line("Processor: %s", inf.procName); #endif gen_cmt_line("Target assebler: %s", ash.name); // заголовок для конкретного ассемблера if (ash.header != NULL ) for (const char **ptr=ash.header; *ptr != NULL; ptr++ ) MakeLine(*ptr, 0); }
//-------------------------------------------------------------------------- void idaapi header(void) { gen_cmt_line("Processor : %-8.8s", inf.procName); gen_cmt_line("Target assembler: %s", ash.name); gen_cmt_line("Byte sex : %s, %s", inf.mf ? "big-endian" : "little-endian", inf.wide_high_byte_first ? "high_byte_first" : "high_byte_last"); if ( ash.header != NULL ) for ( const char **ptr=ash.header; *ptr != NULL; ptr++ ) printf_line(0,COLSTR("%s",SCOLOR_ASMDIR),*ptr); MakeNull(); }
//-------------------------------------------------------------------------- // generate start of the disassembly void idaapi header(void) { // generate standard header gen_cmt_line("Processor: %s", inf.procName); gen_cmt_line("Target assembler: %s", ash.name); // output assembler-specific header if (ash.header != NULL) { for (const char **ptr=ash.header; *ptr != NULL; ptr++) { MakeLine(*ptr, 0); } } }
//-------------------------------------------------------------------------- static void print_segment_register(int reg, sel_t value) { if ( reg == ph.regDataSreg ) return; if ( value != BADADDR ) { char buf[MAX_NUMBUF]; btoa(buf, sizeof(buf), value); gen_cmt_line("assume %s = %s", ph.regNames[reg], buf); } else { gen_cmt_line("drop %s", ph.regNames[reg]); } }
void segstart( ea_t ea ) { segment_t *Sarea = getseg( ea ); char name[MAXNAMELEN]; get_segm_name(Sarea, name, sizeof(name)); gen_cmt_line( COLSTR("segment %s", SCOLOR_AUTOCMT), name ); ea_t org = ea - get_segm_base( Sarea ); if ( org != 0 ) { char buf[MAX_NUMBUF]; btoa(buf, sizeof(buf), org); gen_cmt_line("%s %s", ash.origin, buf); } }
//-------------------------------------------------------------------------- void header(void) { gen_cmt_line("Processor : %-8.8s", inf.procName); gen_cmt_line("Target assembler: %s", ash.name); gen_cmt_line("Byte sex : %s, %s", inf.mf ? "big-endian" : "little-endian", inf.wide_high_byte_first ? "high_byte_first" : "high_byte_last"); if ( ash.header != NULL ) for ( const char **ptr=ash.header; *ptr != NULL; ptr++ ) printf_line(0,COLSTR("%s",SCOLOR_ASMDIR),*ptr); MakeNull(); printf_line(0,COLSTR("MY_BYTE .macro BYTE",SCOLOR_ASMDIR)); printf_line(0,COLSTR(" .emsg \"ERROR - Impossible to generate 8bit bytes on this processor. Please convert them to 16bit words.\"",SCOLOR_ASMDIR)); printf_line(0,COLSTR(" .endm",SCOLOR_ASMDIR)); MakeNull(); }
//-------------------------------------------------------------------------- // конец текста 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"); }
//-------------------------------------------------------------------------- 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"); }
// 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"); } }
void segstart(ea_t ea) { char buf[MAXSTR]; segment_t *Sarea = getseg(ea); char name[MAXNAMELEN]; get_segm_name(Sarea, name, sizeof(name)); if ( ash.uflag & UAS_SECT ) { if ( Sarea->type == SEG_IMEM ) { MakeLine(".RSECT", inf.indent); } else { printf_line(0, COLSTR("%s: .section", SCOLOR_ASMDIR), name); } } else { if(ash.uflag & UAS_NOSEG) printf_line(inf.indent, COLSTR("%s.segment %s", SCOLOR_AUTOCMT), ash.cmnt, name); else printf_line(inf.indent, COLSTR("segment %s",SCOLOR_ASMDIR), name); if(ash.uflag & UAS_SELSG) MakeLine(name, inf.indent); if(ash.uflag & UAS_CDSEG) MakeLine(Sarea->type == SEG_IMEM ? COLSTR("DSEG", SCOLOR_ASMDIR) : COLSTR("CSEG", SCOLOR_ASMDIR), inf.indent); // XSEG - eXternal memory } if ( inf.s_org ) { adiff_t org = ea - get_segm_base(Sarea); if ( org != 0 ) { btoa(buf, sizeof(buf), org); gen_cmt_line("%s %s", ash.origin, buf); } } }
//-------------------------------------------------------------------------- static void print_segment_register(int reg, sel_t value) { if ( reg == ph.regDataSreg ) return; char buf[MAX_NUMBUF]; btoa(buf, sizeof(buf), value); switch (reg) { case ARMS: if (value == -1) break; printf_line(inf.indent,COLSTR(".arms_%s",SCOLOR_ASMDIR), value ? "on":"off"); return; case CPL: if (value == -1) break; printf_line(inf.indent,COLSTR(".cpl_%s",SCOLOR_ASMDIR), value ? "on":"off"); return; case DP: if (value == -1) break; printf_line(inf.indent,COLSTR(".dp %s",SCOLOR_ASMDIR), buf); return; } gen_cmt_line("assume %s = %s", ph.regNames[reg], buf); }
// generate footer void idaapi footer(void) { gen_cmt_line("end of file"); }
//-------------------------------------------------------------------------- void idaapi segend(ea_t ea) { char sname[MAXNAMELEN]; get_segm_name(getseg(ea-1), sname, sizeof(sname)); gen_cmt_line("end of '%s'", sname); }
void __stdcall header( void ) { gen_cmt_line( "Processor: %s", inf.procName ); gen_cmt_line( "Target assembler: %s", ash.name ); gen_cmt_line( "Byte sex : %s", inf.mf ? "Big endian" : "Little endian"); }
void segend( ea_t ea ) { char name[MAXNAMELEN]; get_segm_name(getseg(ea-1), name, sizeof(name)); gen_cmt_line( "end of '%s'", name ); }
//-------------------------------------------------------------------------- void segstart(ea_t ea) { char buf[MAXSTR]; char *const end = buf + sizeof(buf); segment_t *Sarea = getseg(ea); if ( is_spec_segm(Sarea->type) ) return; const char *align; switch ( Sarea->align ) { case saAbs: align = "at: "; break; case saRelByte: align = "byte"; break; case saRelWord: align = "word"; break; case saRelPara: align = "para"; break; case saRelPage: align = "page"; break; case saRel4K: align = "4k"; break; case saRel64Bytes: align = "64"; break; default: align = NULL; break; } if ( align == NULL ) { gen_cmt_line("Segment alignment '%s' can not be represented in assembly", get_segment_alignment(Sarea->align)); align = ""; } char sname[MAXNAMELEN]; char sclas[MAXNAMELEN]; get_true_segm_name(Sarea, sname, sizeof(sname)); get_segm_class(Sarea, sclas, sizeof(sclas)); char *ptr = buf + qsnprintf(buf, sizeof(buf), SCOLOR_ON SCOLOR_ASMDIR "%-*s segment %s ", inf.indent-1, sname, align); if ( Sarea->align == saAbs ) { ea_t absbase = get_segm_base(Sarea); ptr += btoa(ptr, end-ptr, absbase); APPCHAR(ptr, end, ' '); } const char *comb; switch ( Sarea->comb ) { case scPub: case scPub2: case scPub3: comb = ""; break; case scCommon: comb = "common"; break; default: comb = NULL; break; } if ( comb == NULL ) { gen_cmt_line("Segment combination '%s' can not be represented in assembly", get_segment_combination(Sarea->comb)); comb = ""; } ptr += qsnprintf(ptr, end-ptr, "%s '%s'", comb, sclas); tag_off(ptr, end, COLOR_ASMDIR); MakeLine(buf, 0); }
void footer( void ) { gen_cmt_line( "end of file" ); }
void header( void ) { gen_cmt_line( "Processor: %s", inf.procName ); gen_cmt_line( "Target assembler: %s", ash.name ); }