home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / sherlock.zip / CV32 / CV.H next >
C/C++ Source or Header  |  1994-06-29  |  6KB  |  266 lines

  1. /*
  2. **  Sherlock - Copyright 1992, 1993, 1994
  3. **    Harfmann Software
  4. **    Compuserve: 73147,213
  5. **    All rights reserved
  6. */
  7. /*
  8. **  Header file to read the Codeview information from an EXE file.
  9. */
  10. #pragma pack(1)
  11.  
  12. #define sstModules    0x101
  13. #define sstPublic    0x102
  14. #define sstTypes    0x103
  15. #define sstSymbols    0x104
  16. #define sstSrcLines    0x105
  17. #define sstLibraries    0x106
  18. #define sstCompacted    0x108
  19. #define sstSrcLnSeg    0x109
  20.  
  21. /*
  22. ** This is the header linkage structure.
  23. */
  24. typedef struct {
  25.     char    signature[4];
  26.     long    offset;
  27. } Header;
  28.  
  29.  
  30. /*
  31. ** This is the DNT structure.
  32. */
  33. typedef struct {
  34.     unsigned short  sectionType;
  35.     unsigned short  moduleIndex;
  36.     signed long     offsetStart;
  37.     unsigned short  sectionSize;
  38. } SubSectionDictionary;
  39.  
  40.  
  41. typedef struct {
  42.     char    cbName;
  43.     char    name[1];
  44. } NAME;
  45.  
  46. /**************************************
  47. **                      *
  48. ** Make up of the sstModules - 0x0101 *
  49. **                      *
  50. **************************************/
  51. typedef struct {
  52.     unsigned short  segment;
  53.     unsigned short  offset;
  54.     unsigned short  cbSeg;
  55.     unsigned short  ovlNbr;     /* this represents the first segment. */
  56.     unsigned short  iLibraries;
  57.     char        cSeg;
  58.     char        reserved;
  59.     char        cbName;
  60.     char        name[1];
  61. } ModulesDataEntry;
  62.  
  63. typedef struct {
  64.     unsigned short  segment;
  65.     unsigned long   offset;
  66.     unsigned long   cbSeg;
  67.     unsigned short  ovlNbr;     /* this represents the first segment. */
  68.     unsigned short  iLibraries;
  69.     char        cSeg;
  70.     char        reserved;
  71.     char        cbName;
  72.     char        name[1];
  73. } ModulesDataEntry32;
  74.  
  75.  
  76. /**************************************
  77. **                      *
  78. ** sstPublics - 0x0102              *
  79. **                      *
  80. **************************************/
  81. typedef struct {
  82.     unsigned short  offset;
  83.     unsigned short  segment;
  84.     unsigned short  type;
  85.     unsigned char   cbName;
  86.     char        name[1];
  87. } PublicsDataEntry;
  88.  
  89. typedef struct {
  90.     unsigned long   offset;
  91.     unsigned short  segment;
  92.     unsigned short  type;
  93.     unsigned char   cbName;
  94.     char        name[1];
  95. } PublicsDataEntry32;
  96.  
  97.  
  98. /**************************************
  99. **                      *
  100. ** sstSrcLines - 0x0105           *
  101. **  UCHAR  - Name Length          *
  102. **  UCHAR* - Name              *
  103. **  USHORT - count              *
  104. **                      *
  105. ** sstSrcLnSeg - 0x0109           *
  106. **  UCHAR  - Name Length          *
  107. **  UCHAR* - Name              *
  108. **  USHORT - segment              *
  109. **  USHORT - count              *
  110. **                      *
  111. **                      *
  112. ** Line offset pair information.      *
  113. **************************************/
  114. typedef struct {
  115.     unsigned short  line;
  116.     unsigned short  offset;
  117. } LineOffsetEntry;
  118.  
  119. typedef struct {
  120.     unsigned short  line;
  121.     unsigned long   offset;
  122. } LineOffsetEntry32;
  123.  
  124.  
  125. /**************************************
  126. **                      *
  127. ** sstLibraries - 0x0106          *
  128. **                      *
  129. **************************************/
  130. typedef struct {
  131.     unsigned char   cbLibs;
  132.     char        Libs[1];
  133. } LIB;
  134.  
  135. /**************************************
  136. **                      *
  137. ** sstSymbols - 0x0104              *
  138. **                      *
  139. **                      *
  140. ** Define the symbol types.          *
  141. **                      *
  142. **                      *
  143. ** Block Start - 0x00 & 0x80          *
  144. **                      *
  145. **************************************/
  146. typedef struct {
  147.     unsigned short  offset;
  148.     unsigned short  length;
  149.     unsigned char   cbName;
  150.     unsigned char   name[1];
  151. } BlockStart;
  152.  
  153. typedef struct {
  154.     unsigned long   offset;
  155.     unsigned short  length;
  156.     unsigned char   cbName;
  157.     unsigned char   name[1];
  158. } BlockStart32;
  159.  
  160. /*
  161. ** BP-Relative symbol - 0x04 & 0x84
  162. */
  163. typedef struct {
  164.     unsigned short  offset;
  165.     unsigned short  type;
  166.     unsigned char   cbName;
  167.     unsigned char   name[1];
  168. } BPRelativeSymbol;
  169.  
  170. typedef struct {
  171.     unsigned long   offset;
  172.     unsigned short  type;
  173.     unsigned char   cbName;
  174.     unsigned char   name[1];
  175. } BPRelativeSymbol32;
  176.  
  177. /*
  178. **  Local (Data) Symbols - 0x05 & 0x85
  179. */
  180. typedef struct {
  181.     unsigned short  offset;
  182.     unsigned short  segment;
  183.     unsigned short  type;
  184.     unsigned char   cbName;
  185.     unsigned char   name[1];
  186. } LocalSymbol;
  187.  
  188. typedef struct {
  189.     unsigned long   offset;
  190.     unsigned short  segment;
  191.     unsigned short  type;
  192.     unsigned char   cbName;
  193.     unsigned char   name[1];
  194. } LocalSymbol32;
  195.  
  196. /*
  197. ** Code Label - 0x0B & 0x8B
  198. */
  199. typedef struct {
  200.     unsigned short  offset;
  201.     unsigned char   distance;
  202.     unsigned char   cbName;
  203.     unsigned char   name[1];
  204. } CodeLabel;
  205.  
  206. typedef struct {
  207.     unsigned long   offset;
  208.     unsigned char   distance;
  209.     unsigned char   cbName;
  210.     unsigned char   name[1];
  211. } CodeLabel32;
  212.  
  213. /*
  214. ** Register Symbol - 0x0D & 0x8D
  215. */
  216. typedef struct {
  217.     unsigned short  type;
  218.     unsigned char   registerNum;
  219.     unsigned char   cbName;
  220.     unsigned char   name[1];
  221. } RegisterSymbol;
  222.  
  223. /*
  224. ** Procedure Start - 0x01 & 0x81
  225. */
  226. typedef struct {
  227.     unsigned short  offset;
  228.     unsigned short  type;
  229.     unsigned short  procLength;
  230.     unsigned short  debugStart;
  231.     unsigned short  debugEnd;
  232.     unsigned short  reserved;
  233.     unsigned char   distance;
  234.     unsigned char   cbName;
  235.     unsigned char   name[1];
  236. } ProcedureStart;
  237.  
  238. typedef struct {
  239.     unsigned long   offset;
  240.     unsigned short  typeIndex;
  241.     unsigned short  procLength;
  242.     unsigned short  debugStart;
  243.     unsigned short  debugEnd;
  244.     unsigned short  reserved;
  245.     unsigned char   distance;
  246.     unsigned char   cbName;
  247.     unsigned char   name[1];
  248. } ProcedureStart32;
  249.  
  250. /*
  251. ** Change Default Segment - 0x11
  252. */
  253. typedef struct {
  254.     unsigned short  segment;
  255.     unsigned short  reserved;
  256. } ChangeDefaultSegment;
  257.  
  258.  
  259. /**************************************
  260. **                      *
  261. ** sstTypes    - 0x0103          *
  262. ** sstCompacted - 0x0108          *
  263. **                      *
  264. **************************************/
  265. #pragma pack()
  266.