home *** CD-ROM | disk | FTP | other *** search
/ Reverse Code Engineering RCE CD +sandman 2000 / ReverseCodeEngineeringRceCdsandman2000.iso / RCE / Mammon_ / global_str.idc < prev    next >
Text File  |  2000-05-25  |  1KB  |  40 lines

  1.  
  2.  
  3. //Global_str.idc
  4. // This script is similar to seg_string.idc and is a complement to ss.idc. The purpose of
  5. // this script is to parse strings globally; that is, to traverse each segment of the executable
  6. // and test each unexplored byte to determine if it is an ASCII character. If so, the byte is
  7. // converted into a string according to the default string type (for Win32 this should be
  8. // Unicode, for Win16 and dos this should be C. Be sure to increase the maximum length of
  9. // ascii names to 120 characters if you plan to use this script with ss.idc.
  10. //
  11. //code by mammon_ rev 10.17 (bug-report gratis Tomas Strelkauskas)
  12.  
  13. #include <idc.idc>
  14.  
  15. static main(){
  16.     auto x, ea, end_seg, oldea;
  17.     ea = FirstSeg();
  18.     end_seg = SegEnd(ea);
  19.     while ( ea != BADADDR) {
  20.         ea = FindUnexplored  ( ea, 1 );
  21.         if ( Byte(ea) > 0x19 && Byte(ea) < 0x7F){
  22.             MakeStr( ea, -1 );
  23.             MakeRptCmt(ea, Name(ea));
  24.             ea = ea + ItemSize( ea );
  25.         }
  26.         if (ea >= end_seg){
  27.                 oldea = ea - 1;
  28.                 ea = NextSeg(ea);
  29.                 if (ea!=BADADDR) end_seg = SegEnd(ea);
  30.                 else Message("\nFinal Segment Parsed: " + SegName( SegStart(oldea) ) + "\n");
  31.         }
  32.     }
  33.     Message("Done with string parsing.\n");
  34. }
  35.  
  36.  
  37.  
  38.  
  39.  
  40.