Windows NT 4.0 source code leak
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

243 lines
5.0 KiB

5 years ago
  1. /*
  2. ** takernel.s
  3. **
  4. ** Copyright(C) 1994 Microsoft Corporation.
  5. ** All Rights Reserved.
  6. **
  7. ** HISTORY:
  8. ** Created: 01/27/94 - MarkRi
  9. **
  10. */
  11. #include "ksmips.h"
  12. .data
  13. Module:
  14. .space 4
  15. ModName:
  16. .ascii "KERNEL32\0"
  17. .text
  18. .set noreorder ;
  19. .extern LogData ;
  20. .extern GetModuleHandleA ;
  21. .extern GetProcAddress ;
  22. .globl LogNote ;
  23. .ent LogNote ;
  24. LogNote:
  25. // On Entry:
  26. // t0 -> Note string
  27. // t1 -> API Name
  28. // t2 -> API Address
  29. subu sp, 8 * 4
  30. // Save arg regs and RA and t0
  31. // store args 'back'
  32. sw a3, 44(sp)
  33. sw a2, 40(sp)
  34. sw a1, 36(sp)
  35. sw a0, 32(sp)
  36. sw ra, 28(sp)
  37. sw t0, 24(sp)
  38. sw t1, 20(sp)
  39. sw t2, 16(sp)
  40. lw t2, 0(t2) // Do we already have the API addr?
  41. nop
  42. bne t2, zero, Found // Yes, go use it.
  43. lw t3, Module // Do we have our module handle?
  44. nop
  45. bne t3, zero, Search // Yes, go use it for search
  46. // Get module handle
  47. la a0, ModName
  48. jal GetModuleHandleA // Get our module handle
  49. nop
  50. sw v0, Module
  51. // restore base ptrs
  52. lw t0, 24(sp)
  53. lw t1, 20(sp)
  54. Search:
  55. // Get address of API
  56. lw a0, Module
  57. or a1, zero, t1
  58. jal GetProcAddress
  59. nop
  60. // save
  61. lw t2, 16(sp)
  62. sw v0, 0(t2) // Save the proc's address
  63. lw t0, 24(sp)
  64. Found:
  65. // t0 -> Note string
  66. or a0, zero, t0
  67. jal LogData
  68. nop
  69. // restore arg regs
  70. lw a0, 32(sp)
  71. lw a1, 36(sp)
  72. lw a2, 40(sp)
  73. lw a3, 44(sp)
  74. lw t2, 16(sp) // Get back address
  75. nop
  76. lw t1, 0(t2)
  77. lw ra, 28(sp) // restore RA
  78. addu sp, 8 * 4 // restore SP
  79. j t1 // do it
  80. nop
  81. .end LogNote
  82. #define ZJMP(argName) \
  83. .data ; \
  84. s##argName: ; \
  85. .ascii "NOTE:" #argName " \0" ; \
  86. n##argName: ;\
  87. .ascii #argName "\0" ; \
  88. .align 2 ;\
  89. a##argName: ; \
  90. .space 4 ; \
  91. .text ; \
  92. .globl z##argName ; \
  93. .ent z##argName ; \
  94. z##argName: ; \
  95. la t0, s##argName ; \
  96. la t1, n##argName ; \
  97. la t2, a##argName ; \
  98. j LogNote ; \
  99. nop ; \
  100. .end z##argName ;
  101. ZJMP(AddConsoleAliasA)
  102. ZJMP(AddConsoleAliasW)
  103. ZJMP(BaseAttachCompleteThunk)
  104. ZJMP(BasepDebugDump)
  105. ZJMP(CloseConsoleHandle)
  106. ZJMP(CloseProfileUserMapping)
  107. ZJMP(CmdBatNotification)
  108. ZJMP(ConsoleMenuControl)
  109. ZJMP(ConsoleSubst)
  110. ZJMP(CreateVirtualBuffer)
  111. ZJMP(DuplicateConsoleHandle)
  112. ZJMP(ExitVDM)
  113. ZJMP(ExpungeConsoleCommandHistoryA)
  114. ZJMP(ExpungeConsoleCommandHistoryW)
  115. ZJMP(ExtendVirtualBuffer)
  116. ZJMP(FreeVirtualBuffer)
  117. ZJMP(GetBinaryType)
  118. ZJMP(GetConsoleAliasA)
  119. ZJMP(GetConsoleAliasExesA)
  120. ZJMP(GetConsoleAliasExesLengthA)
  121. ZJMP(GetConsoleAliasExesLengthW)
  122. ZJMP(GetConsoleAliasExesW)
  123. ZJMP(GetConsoleAliasW)
  124. ZJMP(GetConsoleAliasesA)
  125. ZJMP(GetConsoleAliasesLengthA)
  126. ZJMP(GetConsoleAliasesLengthW)
  127. ZJMP(GetConsoleAliasesW)
  128. ZJMP(GetConsoleCommandHistoryA)
  129. ZJMP(GetConsoleCommandHistoryLengthA)
  130. ZJMP(GetConsoleCommandHistoryLengthW)
  131. ZJMP(GetConsoleCommandHistoryW)
  132. ZJMP(GetConsoleDisplayMode)
  133. ZJMP(GetConsoleFontInfo)
  134. ZJMP(GetConsoleFontSize)
  135. ZJMP(GetConsoleHardwareState)
  136. ZJMP(GetConsoleInputWaitHandle)
  137. ZJMP(GetCurrentConsoleFont)
  138. ZJMP(GetNextVDMCommand)
  139. ZJMP(GetNumberOfConsoleFonts)
  140. ZJMP(GetVDMCurrentDirectories)
  141. ZJMP(InvalidateConsoleDIBits)
  142. ZJMP(OpenConsoleW)
  143. ZJMP(OpenProfileUserMapping)
  144. ZJMP(QueryWin31IniFilesMappedToRegistry)
  145. ZJMP(RegisterConsoleVDM)
  146. ZJMP(RegisterWaitForInputIdle)
  147. ZJMP(RtlUnwind)
  148. ZJMP(SetConsoleCommandHistoryMode)
  149. ZJMP(SetConsoleCursor)
  150. ZJMP(SetConsoleDisplayMode)
  151. ZJMP(SetConsoleFont)
  152. ZJMP(SetConsoleHardwareState)
  153. ZJMP(SetConsoleKeyShortcuts)
  154. ZJMP(SetConsoleMaximumWindowSize)
  155. ZJMP(SetConsoleMenuClose)
  156. ZJMP(SetConsoleNumberOfCommandsA)
  157. ZJMP(SetConsoleNumberOfCommandsW)
  158. ZJMP(SetConsolePalette)
  159. ZJMP(SetLastConsoleEventActive)
  160. ZJMP(SetVDMCurrentDirectories)
  161. ZJMP(ShowConsoleCursor)
  162. ZJMP(TrimVirtualBuffer)
  163. ZJMP(VDMConsoleOperation)
  164. ZJMP(VDMOperationStarted)
  165. ZJMP(ValidateLCID)
  166. ZJMP(VerifyConsoleIoHandle)
  167. ZJMP(VirtualBufferExceptionHandler)
  168. ZJMP(WriteConsoleInputVDMA)
  169. ZJMP(WriteConsoleInputVDMW)
  170. ZJMP(lstrcat)
  171. ZJMP(lstrcmp)
  172. ZJMP(lstrcmpi)
  173. ZJMP(lstrcpy)
  174. ZJMP(lstrlen)
  175. ZJMP(ConvertDefaultLocale)
  176. ZJMP(DisableThreadLibraryCalls)
  177. ZJMP(EnumCalendarInfoA)
  178. ZJMP(EnumCalendarInfoW)
  179. ZJMP(EnumDateFormatsA)
  180. ZJMP(EnumDateFormatsW)
  181. ZJMP(EnumSystemCodePagesA)
  182. ZJMP(EnumSystemCodePagesW)
  183. ZJMP(EnumSystemLocalesA)
  184. ZJMP(EnumSystemLocalesW)
  185. ZJMP(EnumTimeFormatsA)
  186. ZJMP(EnumTimeFormatsW)
  187. ZJMP(FoldStringA)
  188. ZJMP(FreeLibraryAndExitThread)
  189. ZJMP(GetBinaryTypeA)
  190. ZJMP(GetBinaryTypeW)
  191. ZJMP(GetCompressedFileSizeA)
  192. ZJMP(GetCompressedFileSizeW)
  193. ZJMP(GetCurrencyFormatA)
  194. ZJMP(GetCurrencyFormatW)
  195. ZJMP(GetEnvironmentStrings)
  196. ZJMP(GetNumberFormatA)
  197. ZJMP(GetNumberFormatW)
  198. ZJMP(GetProcessAffinityMask)
  199. ZJMP(GetShortPathNameA)
  200. ZJMP(GetShortPathNameW)
  201. ZJMP(GetStringTypeExA)
  202. ZJMP(GetStringTypeExW)
  203. ZJMP(GetSystemTimeAdjustment)
  204. ZJMP(IsValidLocale)
  205. ZJMP(RegisterWowExec)
  206. ZJMP(SetLocaleInfoA)
  207. ZJMP(SetLocaleInfoW)
  208. ZJMP(SetSystemTimeAdjustment)
  209. ZJMP(SystemTimeToTzSpecificLocalTime)
  210. .set reorder