THIPX.BAK 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355
  1. ;
  2. ; Command & Conquer Red Alert(tm)
  3. ; Copyright 2025 Electronic Arts Inc.
  4. ;
  5. ; This program is free software: you can redistribute it and/or modify
  6. ; it under the terms of the GNU General Public License as published by
  7. ; the Free Software Foundation, either version 3 of the License, or
  8. ; (at your option) any later version.
  9. ;
  10. ; This program is distributed in the hope that it will be useful,
  11. ; but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ; GNU General Public License for more details.
  14. ;
  15. ; You should have received a copy of the GNU General Public License
  16. ; along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. ;
  18. page ,132
  19. ;Thunk Compiler Version 1.8 May 11 1995 13:16:19
  20. ;File Compiled Tue Jan 23 15:12:09 1996
  21. ;Command Line: C:\BIN\THUNK.EXE thipx.thk
  22. TITLE $thipx.asm
  23. .386
  24. OPTION READONLY
  25. OPTION OLDSTRUCTS
  26. IFNDEF IS_16
  27. IFNDEF IS_32
  28. %out command line error: specify one of -DIS_16, -DIS_32
  29. .err
  30. ENDIF ;IS_32
  31. ENDIF ;IS_16
  32. IFDEF IS_32
  33. IFDEF IS_16
  34. %out command line error: you can't specify both -DIS_16 and -DIS_32
  35. .err
  36. ENDIF ;IS_16
  37. ;************************* START OF 32-BIT CODE *************************
  38. .model FLAT,STDCALL
  39. ;-- Import common flat thunk routines (in k32)
  40. externDef MapHInstLS :near32
  41. externDef MapHInstLS_PN :near32
  42. externDef MapHInstSL :near32
  43. externDef MapHInstSL_PN :near32
  44. externDef FT_Prolog :near32
  45. externDef FT_Thunk :near32
  46. externDef QT_Thunk :near32
  47. externDef FT_Exit0 :near32
  48. externDef FT_Exit4 :near32
  49. externDef FT_Exit8 :near32
  50. externDef FT_Exit12 :near32
  51. externDef FT_Exit16 :near32
  52. externDef FT_Exit20 :near32
  53. externDef FT_Exit24 :near32
  54. externDef FT_Exit28 :near32
  55. externDef FT_Exit32 :near32
  56. externDef FT_Exit36 :near32
  57. externDef FT_Exit40 :near32
  58. externDef FT_Exit44 :near32
  59. externDef FT_Exit48 :near32
  60. externDef FT_Exit52 :near32
  61. externDef FT_Exit56 :near32
  62. externDef SMapLS :near32
  63. externDef SUnMapLS :near32
  64. externDef SMapLS_IP_EBP_8 :near32
  65. externDef SUnMapLS_IP_EBP_8 :near32
  66. externDef SMapLS_IP_EBP_12 :near32
  67. externDef SUnMapLS_IP_EBP_12 :near32
  68. externDef SMapLS_IP_EBP_16 :near32
  69. externDef SUnMapLS_IP_EBP_16 :near32
  70. externDef SMapLS_IP_EBP_20 :near32
  71. externDef SUnMapLS_IP_EBP_20 :near32
  72. externDef SMapLS_IP_EBP_24 :near32
  73. externDef SUnMapLS_IP_EBP_24 :near32
  74. externDef SMapLS_IP_EBP_28 :near32
  75. externDef SUnMapLS_IP_EBP_28 :near32
  76. externDef SMapLS_IP_EBP_32 :near32
  77. externDef SUnMapLS_IP_EBP_32 :near32
  78. externDef SMapLS_IP_EBP_36 :near32
  79. externDef SUnMapLS_IP_EBP_36 :near32
  80. externDef SMapLS_IP_EBP_40 :near32
  81. externDef SUnMapLS_IP_EBP_40 :near32
  82. MapSL PROTO NEAR STDCALL p32:DWORD
  83. .code
  84. ;************************* COMMON PER-MODULE ROUTINES *************************
  85. .data
  86. public thipx_ThunkData32 ;This symbol must be exported.
  87. thipx_ThunkData32 label dword
  88. dd 3130534ch ;Protocol 'LS01'
  89. dd 0a179h ;Checksum
  90. dd 0 ;Jump table address.
  91. dd 3130424ch ;'LB01'
  92. dd 0 ;Flags
  93. dd 0 ;Reserved (MUST BE 0)
  94. dd 0 ;Reserved (MUST BE 0)
  95. dd offset QT_Thunk_thipx - offset thipx_ThunkData32
  96. dd offset FT_Prolog_thipx - offset thipx_ThunkData32
  97. .code
  98. externDef ThunkConnect32@24:near32
  99. public thipx_ThunkConnect32@16
  100. thipx_ThunkConnect32@16:
  101. pop edx
  102. push offset thipx_ThkData16
  103. push offset thipx_ThunkData32
  104. push edx
  105. jmp ThunkConnect32@24
  106. thipx_ThkData16 label byte
  107. db "thipx_ThunkData16",0
  108. pfnQT_Thunk_thipx dd offset QT_Thunk_thipx
  109. pfnFT_Prolog_thipx dd offset FT_Prolog_thipx
  110. .data
  111. QT_Thunk_thipx label byte
  112. db 32 dup(0cch) ;Patch space.
  113. FT_Prolog_thipx label byte
  114. db 32 dup(0cch) ;Patch space.
  115. .code
  116. ;************************ START OF THUNK BODIES************************
  117. ;
  118. public _IPX_Close_Socket95@4
  119. _IPX_Close_Socket95@4:
  120. mov cl,3
  121. jmp II_IPX_Close_Socket95@4
  122. public _IPX_Initialise@4
  123. _IPX_Initialise@4:
  124. mov cl,6
  125. jmp II_IPX_Close_Socket95@4
  126. public _IPX_Open_Socket95@4
  127. _IPX_Open_Socket95@4:
  128. mov cl,4
  129. ; _IPX_Close_Socket95(16) = _IPX_Close_Socket95(32) {}
  130. ;
  131. ; dword ptr [ebp+8]: param1
  132. ;
  133. public II_IPX_Close_Socket95@4
  134. II_IPX_Close_Socket95@4:
  135. push ebp
  136. mov ebp,esp
  137. push ecx
  138. sub esp,60
  139. push word ptr [ebp+8] ;param1: dword->word
  140. call dword ptr [pfnQT_Thunk_thipx]
  141. cwde
  142. leave
  143. retn 4
  144. ;
  145. public _IPX_Get_Connection_Number95@0
  146. _IPX_Get_Connection_Number95@0:
  147. mov cl,2
  148. jmp II_IPX_Get_Connection_Number95@0
  149. public _IPX_Uninitialise@0
  150. _IPX_Uninitialise@0:
  151. mov cl,5
  152. ; _IPX_Get_Connection_Number95(16) = _IPX_Get_Connection_Number95(32) {}
  153. ;
  154. ;
  155. public II_IPX_Get_Connection_Number95@0
  156. II_IPX_Get_Connection_Number95@0:
  157. push ebp
  158. mov ebp,esp
  159. push ecx
  160. sub esp,60
  161. call dword ptr [pfnQT_Thunk_thipx]
  162. cwde
  163. leave
  164. retn
  165. ;
  166. public _IPX_Get_Internet_Address95@12
  167. _IPX_Get_Internet_Address95@12:
  168. mov cl,1
  169. ; _IPX_Get_Internet_Address95(16) = _IPX_Get_Internet_Address95(32) {}
  170. ;
  171. ; dword ptr [ebp+8]: param1
  172. ; dword ptr [ebp+12]: netnum
  173. ; dword ptr [ebp+16]: node
  174. ;
  175. public II_IPX_Get_Internet_Address95@12
  176. II_IPX_Get_Internet_Address95@12:
  177. push ebp
  178. mov ebp,esp
  179. push ecx
  180. sub esp,60
  181. push word ptr [ebp+8] ;param1: dword->word
  182. call SMapLS_IP_EBP_12
  183. push eax
  184. call SMapLS_IP_EBP_16
  185. push eax
  186. call dword ptr [pfnQT_Thunk_thipx]
  187. cwde
  188. call SUnMapLS_IP_EBP_12
  189. call SUnMapLS_IP_EBP_16
  190. leave
  191. retn 12
  192. ;
  193. public __IPX_Get_User_ID95@8
  194. __IPX_Get_User_ID95@8:
  195. mov cl,0
  196. ; __IPX_Get_User_ID95(16) = __IPX_Get_User_ID95(32) {}
  197. ;
  198. ; dword ptr [ebp+8]: param1
  199. ; dword ptr [ebp+12]: user_id
  200. ;
  201. public II__IPX_Get_User_ID95@8
  202. II__IPX_Get_User_ID95@8:
  203. push ebp
  204. mov ebp,esp
  205. push ecx
  206. sub esp,60
  207. push word ptr [ebp+8] ;param1: dword->word
  208. call SMapLS_IP_EBP_12
  209. push eax
  210. call dword ptr [pfnQT_Thunk_thipx]
  211. cwde
  212. call SUnMapLS_IP_EBP_12
  213. leave
  214. retn 8
  215. ELSE
  216. ;************************* START OF 16-BIT CODE *************************
  217. OPTION SEGMENT:USE16
  218. .model LARGE,PASCAL
  219. .code
  220. externDef __IPX_Get_User_ID95:far16
  221. externDef _IPX_Get_Internet_Address95:far16
  222. externDef _IPX_Get_Connection_Number95:far16
  223. externDef _IPX_Close_Socket95:far16
  224. externDef _IPX_Open_Socket95:far16
  225. externDef _IPX_Uninitialise:far16
  226. externDef _IPX_Initialise:far16
  227. FT_thipxTargetTable label word
  228. dw offset __IPX_Get_User_ID95
  229. dw seg __IPX_Get_User_ID95
  230. dw offset _IPX_Get_Internet_Address95
  231. dw seg _IPX_Get_Internet_Address95
  232. dw offset _IPX_Get_Connection_Number95
  233. dw seg _IPX_Get_Connection_Number95
  234. dw offset _IPX_Close_Socket95
  235. dw seg _IPX_Close_Socket95
  236. dw offset _IPX_Open_Socket95
  237. dw seg _IPX_Open_Socket95
  238. dw offset _IPX_Uninitialise
  239. dw seg _IPX_Uninitialise
  240. dw offset _IPX_Initialise
  241. dw seg _IPX_Initialise
  242. .data
  243. public thipx_ThunkData16 ;This symbol must be exported.
  244. thipx_ThunkData16 dd 3130534ch ;Protocol 'LS01'
  245. dd 0a179h ;Checksum
  246. dw offset FT_thipxTargetTable
  247. dw seg FT_thipxTargetTable
  248. dd 0 ;First-time flag.
  249. .code
  250. externDef ThunkConnect16:far16
  251. public thipx_ThunkConnect16
  252. thipx_ThunkConnect16:
  253. pop ax
  254. pop dx
  255. push seg thipx_ThunkData16
  256. push offset thipx_ThunkData16
  257. push seg thipx_ThkData32
  258. push offset thipx_ThkData32
  259. push cs
  260. push dx
  261. push ax
  262. jmp ThunkConnect16
  263. thipx_ThkData32 label byte
  264. db "thipx_ThunkData32",0
  265. ENDIF
  266. END