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

  1.  
  2. //------------------------------------------------------------------------------------------------------
  3. //Strings.idc (rev 1.30): Parses PE file String Table
  4. //Note: This script demonstrates how to parse a single resource using Reslib.idc.
  5. //Resource Type may be configured by changing two variables within the script
  6. //Requires: Reslin.idc
  7. //
  8. // code by mammon_ All rights reversed, use as you see fit.....
  9. //------------------------------------------------------------------------------------------------------
  10.  
  11.  
  12. #define _RECURSE_               1        //Recurse Directories in header
  13. #define _DISPLAY_RESOURCES_     1        //Display Resources
  14.  
  15. #include <idc.idc>
  16. #include <Reslib.idc>
  17.  
  18.  
  19. static main(){
  20.     auto ea, num_entries, x, res_type, res_type_id;
  21.     res_type = "String_Table";
  22.     //res_type can be configured according to the table at the end of the file
  23.     res_type_id = 0x06;
  24.     //res_id can be configured according to the table at the end of the file
  25.     ea = GetResDir();
  26.     num_entries = Word(ea + 12) + Word (ea + 14);  //Get number of entries in .rsrc Header
  27.     ea = ea +16;
  28.     for ( x = 0; x <= num_entries; x = x + 1 ) {   //For each entry
  29.         if (Dword(ea) == res_type_id){             //check if it is the right resource
  30.             ParseSubDirHdr(ResolveOffset(ea + 4), res_type, 0, 0 );  //if so, parse
  31.         }
  32.         ea = ea + 8;
  33.     }
  34.     Message( res_type + " Parsing finished.\n");
  35. }
  36.  
  37. // Possible Resource Types:
  38. //    Res_ID == 0x01 Resource_Type = "Cursor";
  39. //    Res_ID == 0x02 Resource_Type = "Bitmap";
  40. //    Res_ID == 0x03 Resource_Type = "Icon";
  41. //    Res_ID == 0x04 Resource_Type = "Menu";
  42. //    Res_ID == 0x05 Resource_Type = "Dialog";
  43. //    Res_ID == 0x06 Resource_Type = "String_Table";
  44. //    Res_ID == 0x07 Resource_Type = "Font_Directory";
  45. //    Res_ID == 0x08 Resource_Type = "Font";
  46. //    Res_ID == 0x09 Resource_Type = "Accelerator_Table";
  47. //    Res_ID == 0x0A Resource_Type = "RCDATA_(Dynamically_Defined_Resource)";
  48. //    Res_ID == 0x0B Resource_Type = "Message_Table";
  49. //    Res_ID == 0x0C Resource_Type = "Group_Cursor";
  50. //    Res_ID == 0x0E Resource_Type = "Group_Icon";
  51. //    Res_ID == 0x10 Resource_Type = "Version";
  52. //    Res_ID == 0x11 Resource_Type = "DLG_Include";
  53. //    Res_ID == 0x13 Resource_Type = "PlugPlay";
  54. //    Res_ID == 0x14 Resource_Type = "VXD";
  55. //    Res_ID == 0x15 Resource_Type = "AniCursor";
  56. //    Res_ID == 0x2002 Resource_Type = "NewBitmap";
  57. //    Res_ID == 0x2004 Resource_Type = "NewMenu";
  58. //    Res_ID == 0x2005 Resource_Type = "NewDialog";
  59.  
  60.  
  61.  
  62.