WISESCRIPT.hexpat 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. struct Header {
  2. char unknown_0000[44];
  3. };
  4. struct String {
  5. char value[];
  6. };
  7. struct InstStruct1 {
  8. char log_path[];
  9. char font[];
  10. char unknown_0100[14];
  11. String ui_strings_1[56];
  12. };
  13. // 0x00 Wise deflated file header
  14. struct FileHeader {
  15. char unknown_2[2]; // 0x8000, 0x8100, 0x0000, 0x9800 0xA100
  16. u32 deflateStart;
  17. u32 deflateEnd;
  18. u16 date;
  19. u16 time;
  20. u32 inflatedSize;
  21. char unknown_20[20];
  22. u32 crc32;
  23. char filePath[];
  24. char fileText[];
  25. char terminator;
  26. };
  27. struct Unknown_0x03 {
  28. char unknown_1;
  29. char string_1[];
  30. char string_2[];
  31. };
  32. struct FormItem_0x04 {
  33. u8 no;
  34. char command_string_1[];
  35. // read this struct again until 'no' == 0 ???
  36. };
  37. struct Unknown_0x05 {
  38. // write .ini file?
  39. char file[];
  40. char heading[];
  41. char values[];
  42. };
  43. struct Unknown_0x06 {
  44. char unknown[6];
  45. u32 deflateStart;
  46. u32 deflateEnd;
  47. u32 inflatedSize;
  48. char terminator;
  49. };
  50. struct Unknown_0x07 {
  51. char unknown_1;
  52. char string_1[];
  53. char string_2[];
  54. if (unknown_1 == 0x02) {
  55. char string_3[];
  56. }
  57. };
  58. struct Unknown_0x08 {
  59. char unknown_1;
  60. };
  61. struct Unknown_0x09 {
  62. // 0x0901 and 0x0920 are different
  63. char unknown_1;
  64. if (unknown_1 != 0x01 && unknown_1 != 0x20) {
  65. char unknown_2;
  66. }
  67. char string_1[];
  68. char string_2[];
  69. char string_3[];
  70. char string_4[];
  71. if (unknown_1 == 0x01 || unknown_1 == 0x20) {
  72. char string_5[];
  73. }
  74. };
  75. struct Unknown_0x11 {
  76. char string_1[];
  77. };
  78. // Existing file on install medium (CD/DVD)
  79. struct ExistingFile_0x12 {
  80. char unknown_1; // 0C
  81. char unknown_41[41];
  82. char from_path[];
  83. char unknown_string_1[];
  84. char unknown_string_2[];
  85. char to_path[];
  86. };
  87. struct Unknown_0x14 {
  88. u32 deflatedStart;
  89. u32 deflatedEnd;
  90. u32 inflatedSize;
  91. char name[];
  92. char message[];
  93. };
  94. struct Unknown_0x15 {
  95. char unknown_1;
  96. char string_1[];
  97. char string_2[];
  98. };
  99. struct TempFile_0x16 {
  100. char name[];
  101. };
  102. struct Unknown_0x17 {
  103. char unknown_1;
  104. char unknown_4[4];
  105. char string_1[];
  106. };
  107. struct Unknown_0x18 {
  108. // skip tailing zeros
  109. };
  110. struct Unknown_0x23 { // option?
  111. char unknown_1;
  112. char string_1[];
  113. char string_2[];
  114. };
  115. struct Unknown_0x31 {
  116. char unknown_1; // always 0x7F ?
  117. char string_1[];
  118. };
  119. struct Unknown_0x0A {
  120. char unknown_2[2]; // 0x0200
  121. char string_1[];
  122. char string_2[];
  123. char string_3[];
  124. };
  125. struct Unknown_0x0B {
  126. char unknown_1;
  127. char string_1[];
  128. };
  129. struct Unknown_0x0C {
  130. char unknown_1;
  131. char string_1[];
  132. char string_2[];
  133. };
  134. struct Unknown_0x1C {
  135. char string_1[];
  136. };
  137. struct Unknown_0x1E {
  138. char unknown_2[2];
  139. };
  140. struct Container {
  141. char op;
  142. match (op) {
  143. (0x00): FileHeader fileHeader;
  144. (0x03): Unknown_0x03 unknown_0x03;
  145. (0x04): FormItem_0x04 formItem;
  146. (0x05): Unknown_0x05 unknown_0x05;
  147. (0x06): Unknown_0x06 unknown_0x06;
  148. (0x07): Unknown_0x07 unknown_0x07;
  149. (0x08): Unknown_0x08 unknown_0x08;
  150. (0x09): Unknown_0x09 unknown_0x09;
  151. (0x11): Unknown_0x11 unknown_0x11;
  152. (0x12): ExistingFile_0x12 existingFile_0x12;
  153. (0x14): Unknown_0x14 unknown_0x14;
  154. (0x15): Unknown_0x15 unknown_0x15;
  155. (0x16): TempFile_0x16 tempFile_0x16;
  156. (0x17): Unknown_0x17 unknown_0x17;
  157. (0x23): Unknown_0x23 unknown_0x23;
  158. (0x0A): Unknown_0x0A unknown_0x0A;
  159. (0x0B): Unknown_0x0B unknown_0x0B;
  160. (0x0C): Unknown_0x0C unknown_0x0C;
  161. (0x1B): continue;
  162. (0x1C): Unknown_0x1C unknown_0x1C;
  163. (0x1E): Unknown_0x1E unknown_0x1E;
  164. }
  165. };
  166. /*
  167. NAME MD5 FILE
  168. ---- --- ----
  169. HL:CS (CD) 43cd9aff74e04fa1b59321b898d9a6bd counter-strike.exe
  170. HLGOTY (CD) f5b8b35ca02beeeb146e62a63a0273a6 SETUP.EXE
  171. CS15 eedcfcf6545cef92f26fb9a7fdd77c42 csv15full.exe
  172. RTCW (CD) f2d9e3e1eaaed66047210881d130384f Setup.exe
  173. ET 5cc104767ecdf0feb3a36210adf46a8e WolfET.exe
  174. Example:
  175. // NOTE: Set absolute path to WISEINSTALL.hexpat
  176. #include </home/user/code/WISESCRIPT.hexpat>
  177. struct MainStruct {
  178. Header header;
  179. InstStruct1 install_struct_1;
  180. // HL:GOTY 6536
  181. // RTCW 403
  182. // HL:CS 29701
  183. // CS15 6253
  184. // ET 403
  185. Container items[390];
  186. };
  187. MainStruct mainStruct @0x0;
  188. */