dstruct 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (491) hide show
  1. checksums.yaml +15 -0
  2. data/README.markdown +23 -0
  3. data/examples/smb_example.rb +35 -0
  4. data/lib/rex.rb +108 -0
  5. data/lib/rex/LICENSE +29 -0
  6. data/lib/rex/arch.rb +104 -0
  7. data/lib/rex/arch/sparc.rb +75 -0
  8. data/lib/rex/arch/x86.rb +524 -0
  9. data/lib/rex/assembly/nasm.rb +104 -0
  10. data/lib/rex/codepage.map +104 -0
  11. data/lib/rex/compat.rb +389 -0
  12. data/lib/rex/constants.rb +124 -0
  13. data/lib/rex/elfparsey.rb +9 -0
  14. data/lib/rex/elfparsey/elf.rb +121 -0
  15. data/lib/rex/elfparsey/elfbase.rb +256 -0
  16. data/lib/rex/elfparsey/exceptions.rb +25 -0
  17. data/lib/rex/elfscan.rb +10 -0
  18. data/lib/rex/elfscan/scanner.rb +226 -0
  19. data/lib/rex/elfscan/search.rb +44 -0
  20. data/lib/rex/encoder/alpha2.rb +31 -0
  21. data/lib/rex/encoder/alpha2/alpha_mixed.rb +68 -0
  22. data/lib/rex/encoder/alpha2/alpha_upper.rb +79 -0
  23. data/lib/rex/encoder/alpha2/generic.rb +90 -0
  24. data/lib/rex/encoder/alpha2/unicode_mixed.rb +116 -0
  25. data/lib/rex/encoder/alpha2/unicode_upper.rb +123 -0
  26. data/lib/rex/encoder/bloxor/bloxor.rb +327 -0
  27. data/lib/rex/encoder/ndr.rb +90 -0
  28. data/lib/rex/encoder/nonalpha.rb +61 -0
  29. data/lib/rex/encoder/nonupper.rb +64 -0
  30. data/lib/rex/encoder/xdr.rb +107 -0
  31. data/lib/rex/encoder/xor.rb +69 -0
  32. data/lib/rex/encoder/xor/dword.rb +13 -0
  33. data/lib/rex/encoder/xor/dword_additive.rb +13 -0
  34. data/lib/rex/encoders/xor_dword.rb +35 -0
  35. data/lib/rex/encoders/xor_dword_additive.rb +53 -0
  36. data/lib/rex/encoding/xor.rb +20 -0
  37. data/lib/rex/encoding/xor/byte.rb +15 -0
  38. data/lib/rex/encoding/xor/dword.rb +21 -0
  39. data/lib/rex/encoding/xor/dword_additive.rb +92 -0
  40. data/lib/rex/encoding/xor/exceptions.rb +17 -0
  41. data/lib/rex/encoding/xor/generic.rb +146 -0
  42. data/lib/rex/encoding/xor/qword.rb +15 -0
  43. data/lib/rex/encoding/xor/word.rb +21 -0
  44. data/lib/rex/exceptions.rb +275 -0
  45. data/lib/rex/exploitation/cmdstager.rb +10 -0
  46. data/lib/rex/exploitation/cmdstager/base.rb +190 -0
  47. data/lib/rex/exploitation/cmdstager/bourne.rb +105 -0
  48. data/lib/rex/exploitation/cmdstager/debug_asm.rb +140 -0
  49. data/lib/rex/exploitation/cmdstager/debug_write.rb +134 -0
  50. data/lib/rex/exploitation/cmdstager/echo.rb +164 -0
  51. data/lib/rex/exploitation/cmdstager/printf.rb +122 -0
  52. data/lib/rex/exploitation/cmdstager/tftp.rb +71 -0
  53. data/lib/rex/exploitation/cmdstager/vbs.rb +126 -0
  54. data/lib/rex/exploitation/egghunter.rb +425 -0
  55. data/lib/rex/exploitation/encryptjs.rb +78 -0
  56. data/lib/rex/exploitation/heaplib.js.b64 +331 -0
  57. data/lib/rex/exploitation/heaplib.rb +107 -0
  58. data/lib/rex/exploitation/js.rb +6 -0
  59. data/lib/rex/exploitation/js/detect.rb +69 -0
  60. data/lib/rex/exploitation/js/memory.rb +81 -0
  61. data/lib/rex/exploitation/js/network.rb +84 -0
  62. data/lib/rex/exploitation/js/utils.rb +33 -0
  63. data/lib/rex/exploitation/jsobfu.rb +513 -0
  64. data/lib/rex/exploitation/obfuscatejs.rb +336 -0
  65. data/lib/rex/exploitation/omelet.rb +321 -0
  66. data/lib/rex/exploitation/opcodedb.rb +819 -0
  67. data/lib/rex/exploitation/powershell.rb +62 -0
  68. data/lib/rex/exploitation/powershell/function.rb +63 -0
  69. data/lib/rex/exploitation/powershell/obfu.rb +98 -0
  70. data/lib/rex/exploitation/powershell/output.rb +151 -0
  71. data/lib/rex/exploitation/powershell/param.rb +23 -0
  72. data/lib/rex/exploitation/powershell/parser.rb +183 -0
  73. data/lib/rex/exploitation/powershell/psh_methods.rb +70 -0
  74. data/lib/rex/exploitation/powershell/script.rb +99 -0
  75. data/lib/rex/exploitation/ropdb.rb +190 -0
  76. data/lib/rex/exploitation/seh.rb +93 -0
  77. data/lib/rex/file.rb +160 -0
  78. data/lib/rex/image_source.rb +10 -0
  79. data/lib/rex/image_source/disk.rb +58 -0
  80. data/lib/rex/image_source/image_source.rb +44 -0
  81. data/lib/rex/image_source/memory.rb +35 -0
  82. data/lib/rex/io/bidirectional_pipe.rb +161 -0
  83. data/lib/rex/io/datagram_abstraction.rb +35 -0
  84. data/lib/rex/io/ring_buffer.rb +369 -0
  85. data/lib/rex/io/stream.rb +312 -0
  86. data/lib/rex/io/stream_abstraction.rb +209 -0
  87. data/lib/rex/io/stream_server.rb +221 -0
  88. data/lib/rex/job_container.rb +200 -0
  89. data/lib/rex/logging.rb +4 -0
  90. data/lib/rex/logging/log_dispatcher.rb +180 -0
  91. data/lib/rex/logging/log_sink.rb +43 -0
  92. data/lib/rex/logging/sinks/flatfile.rb +56 -0
  93. data/lib/rex/logging/sinks/stderr.rb +44 -0
  94. data/lib/rex/mac_oui.rb +16581 -0
  95. data/lib/rex/machparsey.rb +9 -0
  96. data/lib/rex/machparsey/exceptions.rb +34 -0
  97. data/lib/rex/machparsey/mach.rb +209 -0
  98. data/lib/rex/machparsey/machbase.rb +408 -0
  99. data/lib/rex/machscan.rb +9 -0
  100. data/lib/rex/machscan/scanner.rb +217 -0
  101. data/lib/rex/mime.rb +10 -0
  102. data/lib/rex/mime/encoding.rb +17 -0
  103. data/lib/rex/mime/header.rb +78 -0
  104. data/lib/rex/mime/message.rb +150 -0
  105. data/lib/rex/mime/part.rb +50 -0
  106. data/lib/rex/nop/opty2.rb +109 -0
  107. data/lib/rex/nop/opty2_tables.rb +301 -0
  108. data/lib/rex/ole.rb +202 -0
  109. data/lib/rex/ole/clsid.rb +44 -0
  110. data/lib/rex/ole/difat.rb +138 -0
  111. data/lib/rex/ole/directory.rb +228 -0
  112. data/lib/rex/ole/direntry.rb +237 -0
  113. data/lib/rex/ole/docs/dependencies.txt +8 -0
  114. data/lib/rex/ole/docs/references.txt +1 -0
  115. data/lib/rex/ole/fat.rb +96 -0
  116. data/lib/rex/ole/header.rb +201 -0
  117. data/lib/rex/ole/minifat.rb +74 -0
  118. data/lib/rex/ole/propset.rb +141 -0
  119. data/lib/rex/ole/samples/create_ole.rb +27 -0
  120. data/lib/rex/ole/samples/dir.rb +35 -0
  121. data/lib/rex/ole/samples/dump_stream.rb +34 -0
  122. data/lib/rex/ole/samples/ole_info.rb +23 -0
  123. data/lib/rex/ole/storage.rb +392 -0
  124. data/lib/rex/ole/stream.rb +50 -0
  125. data/lib/rex/ole/substorage.rb +46 -0
  126. data/lib/rex/ole/util.rb +154 -0
  127. data/lib/rex/parser/acunetix_nokogiri.rb +406 -0
  128. data/lib/rex/parser/apple_backup_manifestdb.rb +132 -0
  129. data/lib/rex/parser/appscan_nokogiri.rb +367 -0
  130. data/lib/rex/parser/arguments.rb +108 -0
  131. data/lib/rex/parser/burp_session_nokogiri.rb +291 -0
  132. data/lib/rex/parser/ci_nokogiri.rb +193 -0
  133. data/lib/rex/parser/foundstone_nokogiri.rb +342 -0
  134. data/lib/rex/parser/fusionvm_nokogiri.rb +109 -0
  135. data/lib/rex/parser/group_policy_preferences.rb +185 -0
  136. data/lib/rex/parser/ini.rb +186 -0
  137. data/lib/rex/parser/ip360_aspl_xml.rb +103 -0
  138. data/lib/rex/parser/ip360_xml.rb +98 -0
  139. data/lib/rex/parser/mbsa_nokogiri.rb +256 -0
  140. data/lib/rex/parser/nessus_xml.rb +121 -0
  141. data/lib/rex/parser/netsparker_xml.rb +109 -0
  142. data/lib/rex/parser/nexpose_raw_nokogiri.rb +686 -0
  143. data/lib/rex/parser/nexpose_simple_nokogiri.rb +330 -0
  144. data/lib/rex/parser/nexpose_xml.rb +172 -0
  145. data/lib/rex/parser/nmap_nokogiri.rb +394 -0
  146. data/lib/rex/parser/nmap_xml.rb +166 -0
  147. data/lib/rex/parser/nokogiri_doc_mixin.rb +233 -0
  148. data/lib/rex/parser/openvas_nokogiri.rb +172 -0
  149. data/lib/rex/parser/outpost24_nokogiri.rb +240 -0
  150. data/lib/rex/parser/retina_xml.rb +110 -0
  151. data/lib/rex/parser/unattend.rb +171 -0
  152. data/lib/rex/parser/wapiti_nokogiri.rb +105 -0
  153. data/lib/rex/payloads.rb +2 -0
  154. data/lib/rex/payloads/win32.rb +3 -0
  155. data/lib/rex/payloads/win32/common.rb +27 -0
  156. data/lib/rex/payloads/win32/kernel.rb +54 -0
  157. data/lib/rex/payloads/win32/kernel/common.rb +55 -0
  158. data/lib/rex/payloads/win32/kernel/migration.rb +13 -0
  159. data/lib/rex/payloads/win32/kernel/recovery.rb +51 -0
  160. data/lib/rex/payloads/win32/kernel/stager.rb +195 -0
  161. data/lib/rex/peparsey.rb +10 -0
  162. data/lib/rex/peparsey/exceptions.rb +30 -0
  163. data/lib/rex/peparsey/pe.rb +210 -0
  164. data/lib/rex/peparsey/pe_memdump.rb +61 -0
  165. data/lib/rex/peparsey/pebase.rb +1662 -0
  166. data/lib/rex/peparsey/section.rb +128 -0
  167. data/lib/rex/pescan.rb +11 -0
  168. data/lib/rex/pescan/analyze.rb +366 -0
  169. data/lib/rex/pescan/scanner.rb +230 -0
  170. data/lib/rex/pescan/search.rb +68 -0
  171. data/lib/rex/platforms.rb +2 -0
  172. data/lib/rex/platforms/windows.rb +52 -0
  173. data/lib/rex/poly.rb +134 -0
  174. data/lib/rex/poly/block.rb +480 -0
  175. data/lib/rex/poly/machine.rb +13 -0
  176. data/lib/rex/poly/machine/machine.rb +830 -0
  177. data/lib/rex/poly/machine/x86.rb +509 -0
  178. data/lib/rex/poly/register.rb +101 -0
  179. data/lib/rex/poly/register/x86.rb +41 -0
  180. data/lib/rex/post.rb +7 -0
  181. data/lib/rex/post/dir.rb +51 -0
  182. data/lib/rex/post/file.rb +172 -0
  183. data/lib/rex/post/file_stat.rb +220 -0
  184. data/lib/rex/post/gen.pl +13 -0
  185. data/lib/rex/post/io.rb +182 -0
  186. data/lib/rex/post/meterpreter.rb +5 -0
  187. data/lib/rex/post/meterpreter/channel.rb +446 -0
  188. data/lib/rex/post/meterpreter/channel_container.rb +54 -0
  189. data/lib/rex/post/meterpreter/channels/pool.rb +160 -0
  190. data/lib/rex/post/meterpreter/channels/pools/file.rb +62 -0
  191. data/lib/rex/post/meterpreter/channels/pools/stream_pool.rb +103 -0
  192. data/lib/rex/post/meterpreter/channels/stream.rb +87 -0
  193. data/lib/rex/post/meterpreter/client.rb +483 -0
  194. data/lib/rex/post/meterpreter/client_core.rb +352 -0
  195. data/lib/rex/post/meterpreter/dependencies.rb +3 -0
  196. data/lib/rex/post/meterpreter/extension.rb +32 -0
  197. data/lib/rex/post/meterpreter/extensions/android/android.rb +128 -0
  198. data/lib/rex/post/meterpreter/extensions/android/tlv.rb +40 -0
  199. data/lib/rex/post/meterpreter/extensions/espia/espia.rb +58 -0
  200. data/lib/rex/post/meterpreter/extensions/espia/tlv.rb +17 -0
  201. data/lib/rex/post/meterpreter/extensions/extapi/adsi/adsi.rb +71 -0
  202. data/lib/rex/post/meterpreter/extensions/extapi/clipboard/clipboard.rb +169 -0
  203. data/lib/rex/post/meterpreter/extensions/extapi/extapi.rb +45 -0
  204. data/lib/rex/post/meterpreter/extensions/extapi/service/service.rb +104 -0
  205. data/lib/rex/post/meterpreter/extensions/extapi/tlv.rb +77 -0
  206. data/lib/rex/post/meterpreter/extensions/extapi/window/window.rb +56 -0
  207. data/lib/rex/post/meterpreter/extensions/extapi/wmi/wmi.rb +75 -0
  208. data/lib/rex/post/meterpreter/extensions/incognito/incognito.rb +94 -0
  209. data/lib/rex/post/meterpreter/extensions/incognito/tlv.rb +22 -0
  210. data/lib/rex/post/meterpreter/extensions/kiwi/kiwi.rb +361 -0
  211. data/lib/rex/post/meterpreter/extensions/kiwi/tlv.rb +76 -0
  212. data/lib/rex/post/meterpreter/extensions/lanattacks/dhcp/dhcp.rb +78 -0
  213. data/lib/rex/post/meterpreter/extensions/lanattacks/lanattacks.rb +43 -0
  214. data/lib/rex/post/meterpreter/extensions/lanattacks/tftp/tftp.rb +49 -0
  215. data/lib/rex/post/meterpreter/extensions/lanattacks/tlv.rb +17 -0
  216. data/lib/rex/post/meterpreter/extensions/mimikatz/mimikatz.rb +128 -0
  217. data/lib/rex/post/meterpreter/extensions/mimikatz/tlv.rb +16 -0
  218. data/lib/rex/post/meterpreter/extensions/networkpug/networkpug.rb +57 -0
  219. data/lib/rex/post/meterpreter/extensions/networkpug/tlv.rb +16 -0
  220. data/lib/rex/post/meterpreter/extensions/priv/fs.rb +118 -0
  221. data/lib/rex/post/meterpreter/extensions/priv/passwd.rb +61 -0
  222. data/lib/rex/post/meterpreter/extensions/priv/priv.rb +109 -0
  223. data/lib/rex/post/meterpreter/extensions/priv/tlv.rb +29 -0
  224. data/lib/rex/post/meterpreter/extensions/sniffer/sniffer.rb +117 -0
  225. data/lib/rex/post/meterpreter/extensions/sniffer/tlv.rb +27 -0
  226. data/lib/rex/post/meterpreter/extensions/stdapi/constants.rb +396 -0
  227. data/lib/rex/post/meterpreter/extensions/stdapi/fs/dir.rb +284 -0
  228. data/lib/rex/post/meterpreter/extensions/stdapi/fs/file.rb +399 -0
  229. data/lib/rex/post/meterpreter/extensions/stdapi/fs/file_stat.rb +104 -0
  230. data/lib/rex/post/meterpreter/extensions/stdapi/fs/io.rb +48 -0
  231. data/lib/rex/post/meterpreter/extensions/stdapi/net/arp.rb +59 -0
  232. data/lib/rex/post/meterpreter/extensions/stdapi/net/config.rb +256 -0
  233. data/lib/rex/post/meterpreter/extensions/stdapi/net/interface.rb +129 -0
  234. data/lib/rex/post/meterpreter/extensions/stdapi/net/netstat.rb +97 -0
  235. data/lib/rex/post/meterpreter/extensions/stdapi/net/resolve.rb +106 -0
  236. data/lib/rex/post/meterpreter/extensions/stdapi/net/route.rb +67 -0
  237. data/lib/rex/post/meterpreter/extensions/stdapi/net/socket.rb +139 -0
  238. data/lib/rex/post/meterpreter/extensions/stdapi/net/socket_subsystem/tcp_client_channel.rb +180 -0
  239. data/lib/rex/post/meterpreter/extensions/stdapi/net/socket_subsystem/tcp_server_channel.rb +168 -0
  240. data/lib/rex/post/meterpreter/extensions/stdapi/net/socket_subsystem/udp_channel.rb +209 -0
  241. data/lib/rex/post/meterpreter/extensions/stdapi/railgun/api_constants.rb +38146 -0
  242. data/lib/rex/post/meterpreter/extensions/stdapi/railgun/buffer_item.rb +48 -0
  243. data/lib/rex/post/meterpreter/extensions/stdapi/railgun/def/def_advapi32.rb +2102 -0
  244. data/lib/rex/post/meterpreter/extensions/stdapi/railgun/def/def_crypt32.rb +32 -0
  245. data/lib/rex/post/meterpreter/extensions/stdapi/railgun/def/def_iphlpapi.rb +97 -0
  246. data/lib/rex/post/meterpreter/extensions/stdapi/railgun/def/def_kernel32.rb +3852 -0
  247. data/lib/rex/post/meterpreter/extensions/stdapi/railgun/def/def_netapi32.rb +100 -0
  248. data/lib/rex/post/meterpreter/extensions/stdapi/railgun/def/def_ntdll.rb +168 -0
  249. data/lib/rex/post/meterpreter/extensions/stdapi/railgun/def/def_psapi.rb +32 -0
  250. data/lib/rex/post/meterpreter/extensions/stdapi/railgun/def/def_shell32.rb +32 -0
  251. data/lib/rex/post/meterpreter/extensions/stdapi/railgun/def/def_user32.rb +3170 -0
  252. data/lib/rex/post/meterpreter/extensions/stdapi/railgun/def/def_version.rb +41 -0
  253. data/lib/rex/post/meterpreter/extensions/stdapi/railgun/def/def_wlanapi.rb +87 -0
  254. data/lib/rex/post/meterpreter/extensions/stdapi/railgun/def/def_wldap32.rb +128 -0
  255. data/lib/rex/post/meterpreter/extensions/stdapi/railgun/def/def_ws2_32.rb +613 -0
  256. data/lib/rex/post/meterpreter/extensions/stdapi/railgun/dll.rb +388 -0
  257. data/lib/rex/post/meterpreter/extensions/stdapi/railgun/dll_function.rb +111 -0
  258. data/lib/rex/post/meterpreter/extensions/stdapi/railgun/dll_helper.rb +149 -0
  259. data/lib/rex/post/meterpreter/extensions/stdapi/railgun/dll_wrapper.rb +27 -0
  260. data/lib/rex/post/meterpreter/extensions/stdapi/railgun/mock_magic.rb +515 -0
  261. data/lib/rex/post/meterpreter/extensions/stdapi/railgun/multicall.rb +319 -0
  262. data/lib/rex/post/meterpreter/extensions/stdapi/railgun/platform_util.rb +23 -0
  263. data/lib/rex/post/meterpreter/extensions/stdapi/railgun/railgun.rb +301 -0
  264. data/lib/rex/post/meterpreter/extensions/stdapi/railgun/tlv.rb +56 -0
  265. data/lib/rex/post/meterpreter/extensions/stdapi/railgun/type/pointer_util.rb +106 -0
  266. data/lib/rex/post/meterpreter/extensions/stdapi/railgun/util.rb +676 -0
  267. data/lib/rex/post/meterpreter/extensions/stdapi/railgun/win_const_manager.rb +96 -0
  268. data/lib/rex/post/meterpreter/extensions/stdapi/stdapi.rb +151 -0
  269. data/lib/rex/post/meterpreter/extensions/stdapi/sys/config.rb +128 -0
  270. data/lib/rex/post/meterpreter/extensions/stdapi/sys/event_log.rb +192 -0
  271. data/lib/rex/post/meterpreter/extensions/stdapi/sys/event_log_subsystem/event_record.rb +41 -0
  272. data/lib/rex/post/meterpreter/extensions/stdapi/sys/power.rb +60 -0
  273. data/lib/rex/post/meterpreter/extensions/stdapi/sys/process.rb +408 -0
  274. data/lib/rex/post/meterpreter/extensions/stdapi/sys/process_subsystem/image.rb +129 -0
  275. data/lib/rex/post/meterpreter/extensions/stdapi/sys/process_subsystem/io.rb +55 -0
  276. data/lib/rex/post/meterpreter/extensions/stdapi/sys/process_subsystem/memory.rb +336 -0
  277. data/lib/rex/post/meterpreter/extensions/stdapi/sys/process_subsystem/thread.rb +141 -0
  278. data/lib/rex/post/meterpreter/extensions/stdapi/sys/registry.rb +328 -0
  279. data/lib/rex/post/meterpreter/extensions/stdapi/sys/registry_subsystem/registry_key.rb +193 -0
  280. data/lib/rex/post/meterpreter/extensions/stdapi/sys/registry_subsystem/registry_value.rb +102 -0
  281. data/lib/rex/post/meterpreter/extensions/stdapi/sys/registry_subsystem/remote_registry_key.rb +188 -0
  282. data/lib/rex/post/meterpreter/extensions/stdapi/sys/thread.rb +180 -0
  283. data/lib/rex/post/meterpreter/extensions/stdapi/tlv.rb +236 -0
  284. data/lib/rex/post/meterpreter/extensions/stdapi/ui.rb +259 -0
  285. data/lib/rex/post/meterpreter/extensions/stdapi/webcam/webcam.rb +201 -0
  286. data/lib/rex/post/meterpreter/inbound_packet_handler.rb +30 -0
  287. data/lib/rex/post/meterpreter/object_aliases.rb +83 -0
  288. data/lib/rex/post/meterpreter/packet.rb +709 -0
  289. data/lib/rex/post/meterpreter/packet_dispatcher.rb +543 -0
  290. data/lib/rex/post/meterpreter/packet_parser.rb +94 -0
  291. data/lib/rex/post/meterpreter/packet_response_waiter.rb +83 -0
  292. data/lib/rex/post/meterpreter/ui/console.rb +142 -0
  293. data/lib/rex/post/meterpreter/ui/console/command_dispatcher.rb +86 -0
  294. data/lib/rex/post/meterpreter/ui/console/command_dispatcher/android.rb +383 -0
  295. data/lib/rex/post/meterpreter/ui/console/command_dispatcher/core.rb +939 -0
  296. data/lib/rex/post/meterpreter/ui/console/command_dispatcher/espia.rb +109 -0
  297. data/lib/rex/post/meterpreter/ui/console/command_dispatcher/extapi.rb +65 -0
  298. data/lib/rex/post/meterpreter/ui/console/command_dispatcher/extapi/adsi.rb +198 -0
  299. data/lib/rex/post/meterpreter/ui/console/command_dispatcher/extapi/clipboard.rb +444 -0
  300. data/lib/rex/post/meterpreter/ui/console/command_dispatcher/extapi/service.rb +199 -0
  301. data/lib/rex/post/meterpreter/ui/console/command_dispatcher/extapi/window.rb +118 -0
  302. data/lib/rex/post/meterpreter/ui/console/command_dispatcher/extapi/wmi.rb +108 -0
  303. data/lib/rex/post/meterpreter/ui/console/command_dispatcher/incognito.rb +242 -0
  304. data/lib/rex/post/meterpreter/ui/console/command_dispatcher/kiwi.rb +509 -0
  305. data/lib/rex/post/meterpreter/ui/console/command_dispatcher/lanattacks.rb +60 -0
  306. data/lib/rex/post/meterpreter/ui/console/command_dispatcher/lanattacks/dhcp.rb +254 -0
  307. data/lib/rex/post/meterpreter/ui/console/command_dispatcher/lanattacks/tftp.rb +159 -0
  308. data/lib/rex/post/meterpreter/ui/console/command_dispatcher/mimikatz.rb +182 -0
  309. data/lib/rex/post/meterpreter/ui/console/command_dispatcher/networkpug.rb +232 -0
  310. data/lib/rex/post/meterpreter/ui/console/command_dispatcher/priv.rb +62 -0
  311. data/lib/rex/post/meterpreter/ui/console/command_dispatcher/priv/elevate.rb +97 -0
  312. data/lib/rex/post/meterpreter/ui/console/command_dispatcher/priv/passwd.rb +52 -0
  313. data/lib/rex/post/meterpreter/ui/console/command_dispatcher/priv/timestomp.rb +133 -0
  314. data/lib/rex/post/meterpreter/ui/console/command_dispatcher/sniffer.rb +204 -0
  315. data/lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi.rb +66 -0
  316. data/lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/fs.rb +527 -0
  317. data/lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/net.rb +448 -0
  318. data/lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/sys.rb +906 -0
  319. data/lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/ui.rb +318 -0
  320. data/lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/webcam.rb +343 -0
  321. data/lib/rex/post/meterpreter/ui/console/interactive_channel.rb +99 -0
  322. data/lib/rex/post/permission.rb +26 -0
  323. data/lib/rex/post/process.rb +57 -0
  324. data/lib/rex/post/thread.rb +57 -0
  325. data/lib/rex/post/ui.rb +52 -0
  326. data/lib/rex/proto.rb +15 -0
  327. data/lib/rex/proto/addp.rb +218 -0
  328. data/lib/rex/proto/dcerpc.rb +7 -0
  329. data/lib/rex/proto/dcerpc/client.rb +362 -0
  330. data/lib/rex/proto/dcerpc/exceptions.rb +151 -0
  331. data/lib/rex/proto/dcerpc/handle.rb +48 -0
  332. data/lib/rex/proto/dcerpc/ndr.rb +73 -0
  333. data/lib/rex/proto/dcerpc/packet.rb +264 -0
  334. data/lib/rex/proto/dcerpc/response.rb +188 -0
  335. data/lib/rex/proto/dcerpc/uuid.rb +85 -0
  336. data/lib/rex/proto/dcerpc/wdscp.rb +3 -0
  337. data/lib/rex/proto/dcerpc/wdscp/constants.rb +89 -0
  338. data/lib/rex/proto/dcerpc/wdscp/packet.rb +94 -0
  339. data/lib/rex/proto/dhcp.rb +7 -0
  340. data/lib/rex/proto/dhcp/constants.rb +34 -0
  341. data/lib/rex/proto/dhcp/server.rb +334 -0
  342. data/lib/rex/proto/drda.rb +6 -0
  343. data/lib/rex/proto/drda/constants.rb +50 -0
  344. data/lib/rex/proto/drda/packet.rb +253 -0
  345. data/lib/rex/proto/drda/utils.rb +124 -0
  346. data/lib/rex/proto/http.rb +7 -0
  347. data/lib/rex/proto/http/client.rb +722 -0
  348. data/lib/rex/proto/http/client_request.rb +472 -0
  349. data/lib/rex/proto/http/handler.rb +47 -0
  350. data/lib/rex/proto/http/handler/erb.rb +129 -0
  351. data/lib/rex/proto/http/handler/proc.rb +61 -0
  352. data/lib/rex/proto/http/header.rb +173 -0
  353. data/lib/rex/proto/http/packet.rb +414 -0
  354. data/lib/rex/proto/http/request.rb +354 -0
  355. data/lib/rex/proto/http/response.rb +151 -0
  356. data/lib/rex/proto/http/server.rb +385 -0
  357. data/lib/rex/proto/iax2.rb +2 -0
  358. data/lib/rex/proto/iax2/call.rb +326 -0
  359. data/lib/rex/proto/iax2/client.rb +218 -0
  360. data/lib/rex/proto/iax2/codecs.rb +5 -0
  361. data/lib/rex/proto/iax2/codecs/alaw.rb +16 -0
  362. data/lib/rex/proto/iax2/codecs/g711.rb +2176 -0
  363. data/lib/rex/proto/iax2/codecs/mulaw.rb +17 -0
  364. data/lib/rex/proto/iax2/constants.rb +262 -0
  365. data/lib/rex/proto/ipmi.rb +57 -0
  366. data/lib/rex/proto/ipmi/channel_auth_reply.rb +89 -0
  367. data/lib/rex/proto/ipmi/open_session_reply.rb +36 -0
  368. data/lib/rex/proto/ipmi/rakp2.rb +36 -0
  369. data/lib/rex/proto/ipmi/utils.rb +125 -0
  370. data/lib/rex/proto/natpmp.rb +7 -0
  371. data/lib/rex/proto/natpmp/constants.rb +19 -0
  372. data/lib/rex/proto/natpmp/packet.rb +45 -0
  373. data/lib/rex/proto/ntlm.rb +8 -0
  374. data/lib/rex/proto/ntlm/base.rb +327 -0
  375. data/lib/rex/proto/ntlm/constants.rb +75 -0
  376. data/lib/rex/proto/ntlm/crypt.rb +412 -0
  377. data/lib/rex/proto/ntlm/exceptions.rb +17 -0
  378. data/lib/rex/proto/ntlm/message.rb +534 -0
  379. data/lib/rex/proto/ntlm/utils.rb +765 -0
  380. data/lib/rex/proto/ntp.rb +3 -0
  381. data/lib/rex/proto/ntp/constants.rb +12 -0
  382. data/lib/rex/proto/ntp/modes.rb +130 -0
  383. data/lib/rex/proto/pjl.rb +31 -0
  384. data/lib/rex/proto/pjl/client.rb +163 -0
  385. data/lib/rex/proto/proxy/socks4a.rb +441 -0
  386. data/lib/rex/proto/rfb.rb +13 -0
  387. data/lib/rex/proto/rfb/cipher.rb +82 -0
  388. data/lib/rex/proto/rfb/client.rb +205 -0
  389. data/lib/rex/proto/rfb/constants.rb +50 -0
  390. data/lib/rex/proto/sip.rb +4 -0
  391. data/lib/rex/proto/sip/response.rb +61 -0
  392. data/lib/rex/proto/smb.rb +8 -0
  393. data/lib/rex/proto/smb/client.rb +2064 -0
  394. data/lib/rex/proto/smb/constants.rb +1064 -0
  395. data/lib/rex/proto/smb/crypt.rb +37 -0
  396. data/lib/rex/proto/smb/evasions.rb +67 -0
  397. data/lib/rex/proto/smb/exceptions.rb +867 -0
  398. data/lib/rex/proto/smb/simpleclient.rb +173 -0
  399. data/lib/rex/proto/smb/simpleclient/open_file.rb +106 -0
  400. data/lib/rex/proto/smb/simpleclient/open_pipe.rb +57 -0
  401. data/lib/rex/proto/smb/utils.rb +104 -0
  402. data/lib/rex/proto/sunrpc.rb +2 -0
  403. data/lib/rex/proto/sunrpc/client.rb +196 -0
  404. data/lib/rex/proto/tftp.rb +13 -0
  405. data/lib/rex/proto/tftp/client.rb +344 -0
  406. data/lib/rex/proto/tftp/constants.rb +39 -0
  407. data/lib/rex/proto/tftp/server.rb +497 -0
  408. data/lib/rex/random_identifier_generator.rb +177 -0
  409. data/lib/rex/registry.rb +14 -0
  410. data/lib/rex/registry/hive.rb +132 -0
  411. data/lib/rex/registry/lfkey.rb +51 -0
  412. data/lib/rex/registry/nodekey.rb +54 -0
  413. data/lib/rex/registry/regf.rb +25 -0
  414. data/lib/rex/registry/valuekey.rb +67 -0
  415. data/lib/rex/registry/valuelist.rb +29 -0
  416. data/lib/rex/ropbuilder.rb +8 -0
  417. data/lib/rex/ropbuilder/rop.rb +271 -0
  418. data/lib/rex/script.rb +42 -0
  419. data/lib/rex/script/base.rb +61 -0
  420. data/lib/rex/script/meterpreter.rb +16 -0
  421. data/lib/rex/script/shell.rb +10 -0
  422. data/lib/rex/service.rb +49 -0
  423. data/lib/rex/service_manager.rb +154 -0
  424. data/lib/rex/services/local_relay.rb +424 -0
  425. data/lib/rex/socket.rb +788 -0
  426. data/lib/rex/socket/comm.rb +120 -0
  427. data/lib/rex/socket/comm/local.rb +526 -0
  428. data/lib/rex/socket/ip.rb +132 -0
  429. data/lib/rex/socket/parameters.rb +363 -0
  430. data/lib/rex/socket/range_walker.rb +470 -0
  431. data/lib/rex/socket/ssl_tcp.rb +345 -0
  432. data/lib/rex/socket/ssl_tcp_server.rb +188 -0
  433. data/lib/rex/socket/subnet_walker.rb +76 -0
  434. data/lib/rex/socket/switch_board.rb +289 -0
  435. data/lib/rex/socket/tcp.rb +79 -0
  436. data/lib/rex/socket/tcp_server.rb +67 -0
  437. data/lib/rex/socket/udp.rb +165 -0
  438. data/lib/rex/sslscan/result.rb +201 -0
  439. data/lib/rex/sslscan/scanner.rb +206 -0
  440. data/lib/rex/struct2.rb +5 -0
  441. data/lib/rex/struct2/c_struct.rb +181 -0
  442. data/lib/rex/struct2/c_struct_template.rb +39 -0
  443. data/lib/rex/struct2/constant.rb +26 -0
  444. data/lib/rex/struct2/element.rb +44 -0
  445. data/lib/rex/struct2/generic.rb +73 -0
  446. data/lib/rex/struct2/restraint.rb +54 -0
  447. data/lib/rex/struct2/s_string.rb +72 -0
  448. data/lib/rex/struct2/s_struct.rb +111 -0
  449. data/lib/rex/sync.rb +6 -0
  450. data/lib/rex/sync/event.rb +85 -0
  451. data/lib/rex/sync/read_write_lock.rb +177 -0
  452. data/lib/rex/sync/ref.rb +58 -0
  453. data/lib/rex/sync/thread_safe.rb +83 -0
  454. data/lib/rex/text.rb +1813 -0
  455. data/lib/rex/thread_factory.rb +43 -0
  456. data/lib/rex/time.rb +66 -0
  457. data/lib/rex/transformer.rb +116 -0
  458. data/lib/rex/ui.rb +22 -0
  459. data/lib/rex/ui/interactive.rb +304 -0
  460. data/lib/rex/ui/output.rb +85 -0
  461. data/lib/rex/ui/output/none.rb +19 -0
  462. data/lib/rex/ui/progress_tracker.rb +97 -0
  463. data/lib/rex/ui/subscriber.rb +160 -0
  464. data/lib/rex/ui/text/color.rb +98 -0
  465. data/lib/rex/ui/text/dispatcher_shell.rb +538 -0
  466. data/lib/rex/ui/text/input.rb +119 -0
  467. data/lib/rex/ui/text/input/buffer.rb +79 -0
  468. data/lib/rex/ui/text/input/readline.rb +129 -0
  469. data/lib/rex/ui/text/input/socket.rb +96 -0
  470. data/lib/rex/ui/text/input/stdio.rb +46 -0
  471. data/lib/rex/ui/text/irb_shell.rb +62 -0
  472. data/lib/rex/ui/text/output.rb +86 -0
  473. data/lib/rex/ui/text/output/buffer.rb +62 -0
  474. data/lib/rex/ui/text/output/buffer/stdout.rb +26 -0
  475. data/lib/rex/ui/text/output/file.rb +44 -0
  476. data/lib/rex/ui/text/output/socket.rb +44 -0
  477. data/lib/rex/ui/text/output/stdio.rb +53 -0
  478. data/lib/rex/ui/text/output/tee.rb +56 -0
  479. data/lib/rex/ui/text/progress_tracker.rb +57 -0
  480. data/lib/rex/ui/text/shell.rb +403 -0
  481. data/lib/rex/ui/text/table.rb +346 -0
  482. data/lib/rex/zip.rb +96 -0
  483. data/lib/rex/zip/archive.rb +130 -0
  484. data/lib/rex/zip/blocks.rb +184 -0
  485. data/lib/rex/zip/entry.rb +122 -0
  486. data/lib/rex/zip/jar.rb +283 -0
  487. data/lib/rex/zip/samples/comment.rb +32 -0
  488. data/lib/rex/zip/samples/mkwar.rb +138 -0
  489. data/lib/rex/zip/samples/mkzip.rb +19 -0
  490. data/lib/rex/zip/samples/recursive.rb +58 -0
  491. metadata +536 -0
@@ -0,0 +1,48 @@
1
+ # -*- coding: binary -*-
2
+ # Copyright (c) 2010, patrickHVE@googlemail.com
3
+ # All rights reserved.
4
+ #
5
+ # Redistribution and use in source and binary forms, with or without
6
+ # modification, are permitted provided that the following conditions are met:
7
+ # * Redistributions of source code must retain the above copyright
8
+ # notice, this list of conditions and the following disclaimer.
9
+ # * Redistributions in binary form must reproduce the above copyright
10
+ # notice, this list of conditions and the following disclaimer in the
11
+ # documentation and/or other materials provided with the distribution.
12
+ # * The names of the author may not be used to endorse or promote products
13
+ # derived from this software without specific prior written permission.
14
+ #
15
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16
+ # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17
+ # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18
+ # DISCLAIMED. IN NO EVENT SHALL patrickHVE@googlemail.com BE LIABLE FOR ANY
19
+ # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20
+ # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21
+ # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22
+ # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23
+ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24
+ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25
+
26
+ module Rex
27
+ module Post
28
+ module Meterpreter
29
+ module Extensions
30
+ module Stdapi
31
+ module Railgun
32
+
33
+ #
34
+ #
35
+ #
36
+ class BufferItem
37
+
38
+ attr_reader :belongs_to_param_n, :addr, :length_in_bytes, :datatype
39
+
40
+ def initialize(belongs_to_param_n, addr, length_in_bytes, datatype)
41
+ @belongs_to_param_n = belongs_to_param_n
42
+ @addr = addr
43
+ @length_in_bytes = length_in_bytes
44
+ @datatype = datatype
45
+ end
46
+ end
47
+
48
+ end; end; end; end; end; end
@@ -0,0 +1,2102 @@
1
+ # -*- coding: binary -*-
2
+ module Rex
3
+ module Post
4
+ module Meterpreter
5
+ module Extensions
6
+ module Stdapi
7
+ module Railgun
8
+ module Def
9
+
10
+ class Def_advapi32
11
+
12
+ CREDENTIAL = [
13
+ [:Flags, :DWORD],
14
+ [:Type, :DWORD],
15
+ [:TargetName, :LPTSTR],
16
+ [:Comment, :LPTSTR],
17
+ [:LastWritten, :FILETIME],
18
+ [:CredentialBlobSize, :DWORD],
19
+ [:CredentialBlob, :LPBYTE],
20
+ [:Persist, :DWORD],
21
+ [:AttributeCount, :LPTSTR],
22
+ [:Attributes, :PCREDENTIAL_ATTRIBUTE],
23
+ [:TargetAlias, :LPTSTR],
24
+ [:UserName, :LPTSTR]
25
+ ]
26
+
27
+ def self.create_dll(dll_path = 'advapi32')
28
+ dll = DLL.new(dll_path, ApiConstants.manager)
29
+
30
+ dll.add_function('QueryServiceStatus', 'DWORD', [
31
+ ['LPVOID', 'hService', 'in'],
32
+ ['PBLOB', 'lpServiceStatus', 'out']])
33
+
34
+ dll.add_function('CredEnumerateA', 'BOOL', [
35
+ ['PCHAR', 'Filter', 'in'],
36
+ ['DWORD', 'Flags', 'in'],
37
+ ['PDWORD', 'Count', 'out'],
38
+ ['PBLOB', 'Credentials', 'out']])
39
+
40
+ #Functions for Windows CryptoAPI
41
+ dll.add_function( 'CryptAcquireContextW', 'BOOL',[
42
+ ['PDWORD', 'phProv', 'out'],
43
+ ['PWCHAR', 'pszContainer', 'in'],
44
+ ['PWCHAR', 'pszProvider', 'in'],
45
+ ['DWORD', 'dwProvType', 'in'],
46
+ ['DWORD', 'dwflags', 'in']])
47
+
48
+ dll.add_function( 'CryptAcquireContextA', 'BOOL',[
49
+ ['PDWORD', 'phProv', 'out'],
50
+ ['PWCHAR', 'pszContainer', 'in'],
51
+ ['PWCHAR', 'pszProvider', 'in'],
52
+ ['DWORD', 'dwProvType', 'in'],
53
+ ['DWORD', 'dwflags', 'in']])
54
+
55
+
56
+ dll.add_function( 'CryptContextAddRef', 'BOOL', [
57
+ ['LPVOID', 'hProv', 'in'],
58
+ ['DWORD', 'pdwReserved', 'in'],
59
+ ['DWORD', 'dwFlags', 'in']])
60
+
61
+ dll.add_function( 'CryptEnumProvidersW', 'BOOL', [
62
+ ['DWORD', 'dwIndex', 'in'],
63
+ ['DWORD', 'pdwReserved', 'in'],
64
+ ['DWORD', 'dwFlags', 'in'],
65
+ ['PDWORD', 'pdwProvType', 'out'],
66
+ ['PWCHAR', 'pszProvName', 'out'],
67
+ ['PDWORD', 'pcbProvName', 'inout']])
68
+
69
+ dll.add_function( 'CryptEnumProvidersA', 'BOOL', [
70
+ ['DWORD', 'dwIndex', 'in'],
71
+ ['DWORD', 'pdwReserved', 'in'],
72
+ ['DWORD', 'dwFlags', 'in'],
73
+ ['PDWORD', 'pdwProvType', 'out'],
74
+ ['PCHAR', 'pszProvName', 'out'],
75
+ ['PDWORD', 'pcbProvName', 'inout']])
76
+
77
+ dll.add_function( 'CryptEnumProviderTypesW', 'BOOL', [
78
+ ['DWORD', 'dwIndex', 'in'],
79
+ ['DWORD', 'pdwReserved', 'in'],
80
+ ['DWORD', 'dwFlags', 'in'],
81
+ ['PDWORD', 'pdwProvType', 'out'],
82
+ ['PWCHAR', 'pszTypeName', 'out'],
83
+ ['PDWORD', 'pcbTypeName', 'inout']])
84
+
85
+ dll.add_function( 'CryptEnumProviderTypesA', 'BOOL', [
86
+ ['DWORD', 'dwIndex', 'in'],
87
+ ['DWORD', 'pdwReserved', 'in'],
88
+ ['DWORD', 'dwFlags', 'in'],
89
+ ['PDWORD', 'pdwProvType', 'out'],
90
+ ['PCHAR', 'pszTypeName', 'out'],
91
+ ['PDWORD', 'pcbTypeName', 'inout']])
92
+
93
+ dll.add_function( 'CryptGetDefaultProviderW ', 'BOOL', [
94
+ ['DWORD', 'dwProvType', 'in'],
95
+ ['DWORD', 'pwdReserved', 'in'],
96
+ ['DWORD', 'dwFlags', 'in'],
97
+ ['PWCHAR', 'pszProvName', 'out'],
98
+ ['PDWORD', 'pcbProvName', 'inout']])
99
+
100
+ dll.add_function( 'CryptGetDefaultProviderA ', 'BOOL', [
101
+ ['DWORD', 'dwProvType', 'in'],
102
+ ['DWORD', 'pwdReserved', 'in'],
103
+ ['DWORD', 'dwFlags', 'in'],
104
+ ['PCHAR', 'pszProvName', 'out'],
105
+ ['PDWORD', 'pcbProvName', 'inout']])
106
+
107
+ dll.add_function( 'CryptGetProvParam', 'BOOL', [
108
+ ['LPVOID', 'hProv', 'in'],
109
+ ['DWORD', 'dwParam', 'in'],
110
+ ['PBLOB', 'pbData', 'out'],
111
+ ['PDWORD', 'pwdDataLen', 'inout'],
112
+ ['DWORD', 'dwFlags', 'in']])
113
+
114
+ dll.add_function( 'CryptSetProviderW', 'BOOL', [
115
+ ['PWCHAR', 'pszProvName', 'in'],
116
+ ['DWORD', 'dwProvType', 'in']])
117
+
118
+ dll.add_function( 'CryptSetProviderA', 'BOOL', [
119
+ ['PCHAR', 'pszProvName', 'in'],
120
+ ['DWORD', 'dwProvType', 'in']])
121
+
122
+ dll.add_function( 'CryptSetProviderExW', 'BOOL', [
123
+ ['PWCHAR', 'pszProvName', 'in'],
124
+ ['DWORD', 'dwProvType', 'in'],
125
+ ['DWORD', 'pdwReserved', 'in'],
126
+ ['DWORD', 'dwFlags', 'in']])
127
+
128
+ dll.add_function( 'CryptSetProviderExA', 'BOOL', [
129
+ ['PCHAR', 'pszProvName', 'in'],
130
+ ['DWORD', 'dwProvType', 'in'],
131
+ ['DWORD', 'pdwReserved', 'in'],
132
+ ['DWORD', 'dwFlags', 'in']])
133
+
134
+ dll.add_function( 'CryptSetProvParam', 'BOOL', [
135
+ ['LPVOID', 'hProv', 'in'],
136
+ ['DWORD', 'dwParam', 'in'],
137
+ ['PBLOB', 'pbData', 'in'],
138
+ ['DWORD', 'dwFlags','in']])
139
+
140
+ dll.add_function( 'CryptDuplicateKey', 'BOOL', [
141
+ ['LPVOID', 'hKey', 'in'],
142
+ ['DWORD', 'pdwReserved', 'in'],
143
+ ['DWORD', 'dwFlags', 'in'],
144
+ ['PDWORD', 'phKey', 'out']])
145
+
146
+ dll.add_function( 'CryptExportKey', 'BOOL', [
147
+ ['LPVOID', 'hKey', 'in'],
148
+ ['LPVOID', 'hExpKey', 'in'],
149
+ ['DWORD', 'dwBlobType', 'in'],
150
+ ['DWORD', 'dwFlags', 'in'],
151
+ ['PBLOB', 'pbData', 'out'],
152
+ ['PDWORD', 'pwdDataLen', 'inout']])
153
+
154
+ dll.add_function( 'CryptGenKey', 'BOOL', [
155
+ ['LPVOID', 'hProv', 'in'],
156
+ ['DWORD', 'Algid', 'in'],
157
+ ['DWORD', 'dwFlags', 'in'],
158
+ ['PDWORD', 'phKey', 'out']])
159
+
160
+ dll.add_function( 'CryptGenRandom', 'BOOL', [
161
+ ['LPVOID', 'hProv', 'in'],
162
+ ['DWORD', 'dwLen', 'in'],
163
+ ['PBLOB', 'pbBuffer', 'inout']])
164
+
165
+ dll.add_function( 'CryptGetKeyParam', 'BOOL', [
166
+ ['LPVOID', 'hKey', 'in'],
167
+ ['DWORD', 'dwParam', 'in'],
168
+ ['PBLOB', 'pbData', 'out'],
169
+ ['PDWORD', 'pdwDataLen', 'inout'],
170
+ ['DWORD', 'dwFlags', 'in']])
171
+
172
+ dll.add_function( 'CryptGetUserKey', 'BOOL', [
173
+ ['LPVOID', 'hProv', 'in'],
174
+ ['DWORD', 'dwKeySpec', 'in'],
175
+ ['PDWORD', 'phUserKey', 'out']])
176
+
177
+ dll.add_function( 'CryptImportKey', 'BOOL', [
178
+ ['LPVOID', 'hProv', 'in'],
179
+ ['PBLOB', 'pbData', 'in'],
180
+ ['DWORD', 'dwDataLen', 'in'],
181
+ ['LPVOID', 'hPubKey', 'in'],
182
+ ['DWORD', 'dwFlags', 'in'],
183
+ ['PDWORD', 'phKey', 'out']])
184
+
185
+ dll.add_function( 'CryptSetKeyParam', 'BOOL', [
186
+ ['LPVOID', 'hKey', 'in'],
187
+ ['DWORD', 'dwParam', 'in'],
188
+ ['PBLOB', 'pbData', 'in'],
189
+ ['DWORD', 'dwFlags', 'in']])
190
+
191
+ dll.add_function( 'CryptEncrypt', 'BOOL', [
192
+ ['LPVOID', 'hKey', 'in'],
193
+ ['LPVOID', 'hHash', 'in'],
194
+ ['BOOL', 'Final', 'in'],
195
+ ['DWORD', 'dwFlags', 'in'],
196
+ ['PBLOB', 'pbData', 'inout'],
197
+ ['PDWORD', 'pdwDataLen', 'inout'],
198
+ ['DWORD', 'dwBufLen', 'in']])
199
+
200
+ dll.add_function( 'CryptDuplicateHash', 'BOOL', [
201
+ ['LPVOID', 'hHash', 'in'],
202
+ ['DWORD', 'pdwReserved', 'in'],
203
+ ['DWORD', 'dwFlags', 'in'],
204
+ ['PDWORD', 'phHash', 'out']])
205
+
206
+ dll.add_function( 'CryptGetHashParam', 'BOOL', [
207
+ ['LPVOID', 'hHash', 'in'],
208
+ ['DWORD', 'dwParam', 'in'],
209
+ ['PBLOB', 'pbData', 'out'],
210
+ ['PDWORD', 'pdwDataLen', 'inout'],
211
+ ['DWORD', 'dwFlags', 'in']])
212
+
213
+ dll.add_function( 'CryptHashSessionKey', 'BOOL', [
214
+ ['LPVOID', 'hHash', 'in'],
215
+ ['LPVOID', 'hKey', 'in'],
216
+ ['DWORD', 'dwFlags', 'in']])
217
+
218
+ dll.add_function( 'CryptSetHashParam', 'BOOL', [
219
+ ['LPVOID', 'hHash', 'in'],
220
+ ['DWORD', 'dwParam', 'in'],
221
+ ['PBLOB', 'pbData', 'in'],
222
+ ['DWORD', 'dwFlags', 'in']])
223
+
224
+ dll.add_function( 'CryptSignHashW', 'BOOL', [
225
+ ['LPVOID', 'hHash', 'in'],
226
+ ['DWORD', 'dwKeySpec', 'in'],
227
+ ['PWCHAR', 'sDescription', 'in'],
228
+ ['DWORD', 'dwFlags', 'in'],
229
+ ['PBLOB', 'pbSignature', 'out'],
230
+ ['PDWORD', 'pdwSigLen', 'inout']])
231
+
232
+ dll.add_function( 'CryptSignHashA', 'BOOL', [
233
+ ['LPVOID', 'hHash', 'in'],
234
+ ['DWORD', 'dwKeySpec', 'in'],
235
+ ['PCHAR', 'sDescription', 'in'],
236
+ ['DWORD', 'dwFlags', 'in'],
237
+ ['PBLOB', 'pbSignature', 'out'],
238
+ ['PDWORD', 'pdwSigLen', 'inout']])
239
+
240
+ dll.add_function( 'CryptVerifySignatureW', 'BOOL', [
241
+ ['LPVOID', 'hHash', 'in'],
242
+ ['PBLOB', 'pbSignature', 'in'],
243
+ ['DWORD', 'dwSigLen', 'in'],
244
+ ['LPVOID', 'hPubKey', 'in'],
245
+ ['PWCHAR', 'sDescription', 'in'],
246
+ ['DWORD', 'dwFlags', 'in']])
247
+
248
+ dll.add_function( 'CryptVerifySignatureA', 'BOOL', [
249
+ ['LPVOID', 'hHash', 'in'],
250
+ ['PBLOB', 'pbSignature', 'in'],
251
+ ['DWORD', 'dwSigLen', 'in'],
252
+ ['LPVOID', 'hPubKey', 'in'],
253
+ ['PCHAR', 'sDescription', 'in'],
254
+ ['DWORD', 'dwFlags', 'in']])
255
+
256
+ dll.add_function( 'CryptCreateHash', 'BOOL',[
257
+ ['LPVOID', 'hProv', 'in'],
258
+ ['DWORD', 'Algid', 'in'],
259
+ ['LPVOID', 'hKey', 'in'],
260
+ ['DWORD', 'dwFlags', 'in'],
261
+ ['PDWORD', 'phHash', 'out']])
262
+
263
+ dll.add_function( 'CryptHashData', 'BOOL',[
264
+ ['LPVOID', 'hHash', 'in'],
265
+ ['PWCHAR', 'pbData', 'in'],
266
+ ['DWORD', 'dwDataLen', 'in'],
267
+ ['DWORD', 'dwFlags', 'in']])
268
+
269
+ dll.add_function( 'CryptDeriveKey', 'BOOL',[
270
+ ['LPVOID', 'hProv', 'in'],
271
+ ['DWORD', 'Algid', 'in'],
272
+ ['LPVOID', 'hBaseData', 'in'],
273
+ ['DWORD', 'dwFlags', 'in'],
274
+ ['PDWORD', 'phKey', 'inout']])
275
+
276
+ dll.add_function( 'CryptDecrypt', 'BOOL',[
277
+ ['LPVOID', 'hKey', 'in'],
278
+ ['LPVOID', 'hHash', 'in'],
279
+ ['BOOL', 'Final', 'in'],
280
+ ['DWORD', 'dwFlags', 'in'],
281
+ ['PBLOB', 'pbData', 'inout'],
282
+ ['PDWORD', 'pdwDataLen', 'inout']])
283
+
284
+ dll.add_function( 'CryptDestroyHash', 'BOOL',[
285
+ ['LPVOID', 'hHash', 'in']])
286
+
287
+ dll.add_function( 'CryptDestroyKey', 'BOOL',[
288
+ ['LPVOID', 'hKey', 'in']])
289
+
290
+ dll.add_function( 'CryptReleaseContext', 'BOOL',[
291
+ ['LPVOID', 'hProv', 'in'],
292
+ ['DWORD', 'dwFlags', 'in']])
293
+
294
+
295
+ # Function to open the Service Control Database
296
+ dll.add_function('OpenSCManagerA','DWORD',[
297
+ [ "PCHAR", "lpMachineName", "inout" ],
298
+ [ "PCHAR", "lpDatabaseName", "inout" ],
299
+ [ "DWORD", "dwDesiredAccess", "in" ]
300
+ ])
301
+
302
+ # Function for creating a Service
303
+ dll.add_function('CreateServiceA','DWORD',[
304
+ [ "DWORD", "hSCManager", "in" ],
305
+ [ "PCHAR", "lpServiceName", "in" ],
306
+ [ "PCHAR", "lpDisplayName", "in" ],
307
+ [ "DWORD", "dwDesiredAccess", "in" ],
308
+ [ "DWORD", "dwServiceType", "in" ],
309
+ [ "DWORD", "dwStartType", "in" ],
310
+ [ "DWORD", "dwErrorControl", "in" ],
311
+ [ "PCHAR", "lpBinaryPathName", "in" ],
312
+ [ "PCHAR", "lpLoadOrderGroup", "in" ],
313
+ [ "PDWORD", "lpdwTagId", "out" ],
314
+ [ "PCHAR", "lpDependencies", "in" ],
315
+ [ "PCHAR", "lpServiceStartName", "in" ],
316
+ [ "PCHAR", "lpPassword", "in" ]
317
+ ])
318
+
319
+ dll.add_function('OpenServiceA','DWORD',[
320
+ [ "DWORD", "hSCManager", "in" ],
321
+ [ "PCHAR", "lpServiceName", "in" ],
322
+ [ "DWORD", "dwDesiredAccess", "in" ]
323
+ ])
324
+
325
+ #access rights: SERVICE_CHANGE_CONFIG (0x0002) SERVICE_START (0x0010)
326
+ #SERVICE_STOP (0x0020)
327
+
328
+ dll.add_function('StartServiceA','BOOL',[
329
+ [ "DWORD", "hService", "in" ],
330
+ [ "DWORD", "dwNumServiceArgs", "in" ],
331
+ [ "PCHAR", "lpServiceArgVectors", "in" ]
332
+ ])
333
+
334
+ dll.add_function('ControlService','BOOL',[
335
+ [ "DWORD", "hService", "in" ],
336
+ [ "DWORD", "dwControl", "in" ],
337
+ [ "PBLOB", "lpServiceStatus", "out" ]
338
+ ])
339
+
340
+ #SERVICE_CONTROL_STOP = 0x00000001
341
+
342
+ # _SERVICE_STATUS is an array of 7 DWORDS - dwServiceType;
343
+ #dwCurrentState; dwControlsAccepted; dwWin32ExitCode;
344
+ #dwServiceSpecificExitCode; dwCheckPoint; dwWaitHint;
345
+
346
+ dll.add_function('ChangeServiceConfigA','BOOL',[
347
+ [ "DWORD", "hService", "in" ],
348
+ [ "DWORD", "dwServiceType", "in" ],
349
+ [ "DWORD", "dwStartType", "in" ],
350
+ [ "DWORD", "dwErrorControl", "in" ],
351
+ [ "PCHAR", "lpBinaryPathName", "in" ],
352
+ [ "PCHAR", "lpLoadOrderGroup", "in" ],
353
+ [ "PDWORD", "lpdwTagId", "out" ],
354
+ [ "PCHAR", "lpDependencies", "in" ],
355
+ [ "PCHAR", "lpServiceStartName", "in" ],
356
+ [ "PCHAR", "lpPassword", "in" ],
357
+ [ "PCHAR", "lpDisplayName", "in" ]
358
+ ])
359
+
360
+ dll.add_function('CloseServiceHandle','BOOL',[
361
+ [ "DWORD", "hSCObject", "in" ]
362
+ ])
363
+
364
+ dll.add_function('DeleteService','BOOL',[
365
+ [ "DWORD", "hService", "in" ]
366
+ ])
367
+
368
+ dll.add_function('AbortSystemShutdownA', 'BOOL',[
369
+ ["PCHAR","lpMachineName","in"],
370
+ ])
371
+
372
+ dll.add_function('AbortSystemShutdownW', 'BOOL',[
373
+ ["PWCHAR","lpMachineName","in"],
374
+ ])
375
+
376
+ dll.add_function('InitiateSystemShutdownA', 'BOOL',[
377
+ ["PCHAR","lpMachineName","in"],
378
+ ["PCHAR","lpMessage","in"],
379
+ ["DWORD","dwTimeout","in"],
380
+ ["BOOL","bForceAppsClosed","in"],
381
+ ["BOOL","bRebootAfterShutdown","in"],
382
+ ])
383
+
384
+ dll.add_function('InitiateSystemShutdownExA', 'BOOL',[
385
+ ["PCHAR","lpMachineName","in"],
386
+ ["PCHAR","lpMessage","in"],
387
+ ["DWORD","dwTimeout","in"],
388
+ ["BOOL","bForceAppsClosed","in"],
389
+ ["BOOL","bRebootAfterShutdown","in"],
390
+ ["DWORD","dwReason","in"],
391
+ ])
392
+
393
+ dll.add_function('InitiateSystemShutdownExW', 'BOOL',[
394
+ ["PWCHAR","lpMachineName","in"],
395
+ ["PWCHAR","lpMessage","in"],
396
+ ["DWORD","dwTimeout","in"],
397
+ ["BOOL","bForceAppsClosed","in"],
398
+ ["BOOL","bRebootAfterShutdown","in"],
399
+ ["DWORD","dwReason","in"],
400
+ ])
401
+
402
+ dll.add_function('InitiateSystemShutdownW', 'BOOL',[
403
+ ["PWCHAR","lpMachineName","in"],
404
+ ["PWCHAR","lpMessage","in"],
405
+ ["DWORD","dwTimeout","in"],
406
+ ["BOOL","bForceAppsClosed","in"],
407
+ ["BOOL","bRebootAfterShutdown","in"],
408
+ ])
409
+
410
+ dll.add_function('RegCloseKey', 'DWORD',[
411
+ ["DWORD","hKey","in"],
412
+ ])
413
+
414
+ dll.add_function('RegConnectRegistryA', 'DWORD',[
415
+ ["PCHAR","lpMachineName","in"],
416
+ ["DWORD","hKey","in"],
417
+ ["PDWORD","phkResult","out"],
418
+ ])
419
+
420
+ dll.add_function('RegConnectRegistryExA', 'DWORD',[
421
+ ["PCHAR","lpMachineName","in"],
422
+ ["DWORD","hKey","in"],
423
+ ["DWORD","Flags","in"],
424
+ ["PDWORD","phkResult","out"],
425
+ ])
426
+
427
+ dll.add_function('RegConnectRegistryExW', 'DWORD',[
428
+ ["PWCHAR","lpMachineName","in"],
429
+ ["DWORD","hKey","in"],
430
+ ["DWORD","Flags","in"],
431
+ ["PDWORD","phkResult","out"],
432
+ ])
433
+
434
+ dll.add_function('RegConnectRegistryW', 'DWORD',[
435
+ ["PWCHAR","lpMachineName","in"],
436
+ ["DWORD","hKey","in"],
437
+ ["PDWORD","phkResult","out"],
438
+ ])
439
+
440
+ dll.add_function('RegCreateKeyA', 'DWORD',[
441
+ ["DWORD","hKey","in"],
442
+ ["PCHAR","lpSubKey","in"],
443
+ ["PDWORD","phkResult","out"],
444
+ ])
445
+
446
+ dll.add_function('RegCreateKeyExA', 'DWORD',[
447
+ ["DWORD","hKey","in"],
448
+ ["PCHAR","lpSubKey","in"],
449
+ ["DWORD","Reserved","inout"],
450
+ ["PCHAR","lpClass","in"],
451
+ ["DWORD","dwOptions","in"],
452
+ ["DWORD","samDesired","in"],
453
+ ["PBLOB","lpSecurityAttributes","in"],
454
+ ["PDWORD","phkResult","out"],
455
+ ["PDWORD","lpdwDisposition","out"],
456
+ ])
457
+
458
+ dll.add_function('RegCreateKeyExW', 'DWORD',[
459
+ ["DWORD","hKey","in"],
460
+ ["PWCHAR","lpSubKey","in"],
461
+ ["DWORD","Reserved","inout"],
462
+ ["PWCHAR","lpClass","in"],
463
+ ["DWORD","dwOptions","in"],
464
+ ["DWORD","samDesired","in"],
465
+ ["PBLOB","lpSecurityAttributes","in"],
466
+ ["PDWORD","phkResult","out"],
467
+ ["PDWORD","lpdwDisposition","out"],
468
+ ])
469
+
470
+ dll.add_function('RegCreateKeyW', 'DWORD',[
471
+ ["DWORD","hKey","in"],
472
+ ["PWCHAR","lpSubKey","in"],
473
+ ["PDWORD","phkResult","out"],
474
+ ])
475
+
476
+ dll.add_function('RegDeleteKeyA', 'DWORD',[
477
+ ["DWORD","hKey","in"],
478
+ ["PCHAR","lpSubKey","in"],
479
+ ])
480
+
481
+ dll.add_function('RegDeleteKeyExA', 'DWORD',[
482
+ ["DWORD","hKey","in"],
483
+ ["PCHAR","lpSubKey","in"],
484
+ ["DWORD","samDesired","in"],
485
+ ["DWORD","Reserved","inout"],
486
+ ])
487
+
488
+ dll.add_function('RegDeleteKeyExW', 'DWORD',[
489
+ ["DWORD","hKey","in"],
490
+ ["PWCHAR","lpSubKey","in"],
491
+ ["DWORD","samDesired","in"],
492
+ ["DWORD","Reserved","inout"],
493
+ ])
494
+
495
+ dll.add_function('RegDeleteKeyW', 'DWORD',[
496
+ ["DWORD","hKey","in"],
497
+ ["PWCHAR","lpSubKey","in"],
498
+ ])
499
+
500
+ dll.add_function('RegDeleteValueA', 'DWORD',[
501
+ ["DWORD","hKey","in"],
502
+ ["PCHAR","lpValueName","in"],
503
+ ])
504
+
505
+ dll.add_function('RegDeleteValueW', 'DWORD',[
506
+ ["DWORD","hKey","in"],
507
+ ["PWCHAR","lpValueName","in"],
508
+ ])
509
+
510
+ dll.add_function('RegDisablePredefinedCache', 'DWORD',[
511
+ ])
512
+
513
+ dll.add_function('RegDisableReflectionKey', 'DWORD',[
514
+ ["DWORD","hBase","in"],
515
+ ])
516
+
517
+ dll.add_function('RegEnableReflectionKey', 'DWORD',[
518
+ ["DWORD","hBase","in"],
519
+ ])
520
+
521
+ dll.add_function('RegEnumKeyA', 'DWORD',[
522
+ ["DWORD","hKey","in"],
523
+ ["DWORD","dwIndex","in"],
524
+ ["PCHAR","lpName","out"],
525
+ ["DWORD","cchName","in"],
526
+ ])
527
+
528
+ dll.add_function('RegEnumKeyExA', 'DWORD',[
529
+ ["DWORD","hKey","in"],
530
+ ["DWORD","dwIndex","in"],
531
+ ["PCHAR","lpName","out"],
532
+ ["PDWORD","lpcchName","inout"],
533
+ ["PDWORD","lpReserved","inout"],
534
+ ["PCHAR","lpClass","inout"],
535
+ ["PDWORD","lpcchClass","inout"],
536
+ ["PBLOB","lpftLastWriteTime","out"],
537
+ ])
538
+
539
+ dll.add_function('RegEnumKeyExW', 'DWORD',[
540
+ ["DWORD","hKey","in"],
541
+ ["DWORD","dwIndex","in"],
542
+ ["PWCHAR","lpName","out"],
543
+ ["PDWORD","lpcchName","inout"],
544
+ ["PDWORD","lpReserved","inout"],
545
+ ["PWCHAR","lpClass","inout"],
546
+ ["PDWORD","lpcchClass","inout"],
547
+ ["PBLOB","lpftLastWriteTime","out"],
548
+ ])
549
+
550
+ dll.add_function('RegEnumKeyW', 'DWORD',[
551
+ ["DWORD","hKey","in"],
552
+ ["DWORD","dwIndex","in"],
553
+ ["PWCHAR","lpName","out"],
554
+ ["DWORD","cchName","in"],
555
+ ])
556
+
557
+ dll.add_function('RegEnumValueA', 'DWORD',[
558
+ ["DWORD","hKey","in"],
559
+ ["DWORD","dwIndex","in"],
560
+ ["PCHAR","lpValueName","out"],
561
+ ["PDWORD","lpcchValueName","inout"],
562
+ ["PDWORD","lpReserved","inout"],
563
+ ["PDWORD","lpType","out"],
564
+ ["PBLOB","lpData","out"],
565
+ ["PDWORD","lpcbData","inout"],
566
+ ])
567
+
568
+ dll.add_function('RegEnumValueW', 'DWORD',[
569
+ ["DWORD","hKey","in"],
570
+ ["DWORD","dwIndex","in"],
571
+ ["PWCHAR","lpValueName","out"],
572
+ ["PDWORD","lpcchValueName","inout"],
573
+ ["PDWORD","lpReserved","inout"],
574
+ ["PDWORD","lpType","out"],
575
+ ["PBLOB","lpData","out"],
576
+ ["PDWORD","lpcbData","inout"],
577
+ ])
578
+
579
+ dll.add_function('RegFlushKey', 'DWORD',[
580
+ ["DWORD","hKey","in"],
581
+ ])
582
+
583
+ dll.add_function('RegGetKeySecurity', 'DWORD',[
584
+ ["DWORD","hKey","in"],
585
+ ["PBLOB","SecurityInformation","in"],
586
+ ["PBLOB","pSecurityDescriptor","out"],
587
+ ["PDWORD","lpcbSecurityDescriptor","inout"],
588
+ ])
589
+
590
+ dll.add_function('RegGetValueA', 'DWORD',[
591
+ ["DWORD","hkey","in"],
592
+ ["PCHAR","lpSubKey","in"],
593
+ ["PCHAR","lpValue","in"],
594
+ ["DWORD","dwFlags","in"],
595
+ ["PDWORD","pdwType","out"],
596
+ ["PBLOB","pvData","out"],
597
+ ["PDWORD","pcbData","inout"],
598
+ ])
599
+
600
+ dll.add_function('RegGetValueW', 'DWORD',[
601
+ ["DWORD","hkey","in"],
602
+ ["PWCHAR","lpSubKey","in"],
603
+ ["PWCHAR","lpValue","in"],
604
+ ["DWORD","dwFlags","in"],
605
+ ["PDWORD","pdwType","out"],
606
+ ["PBLOB","pvData","out"],
607
+ ["PDWORD","pcbData","inout"],
608
+ ])
609
+
610
+ dll.add_function('RegLoadKeyA', 'DWORD',[
611
+ ["DWORD","hKey","in"],
612
+ ["PCHAR","lpSubKey","in"],
613
+ ["PCHAR","lpFile","in"],
614
+ ])
615
+
616
+ dll.add_function('RegLoadKeyW', 'DWORD',[
617
+ ["DWORD","hKey","in"],
618
+ ["PWCHAR","lpSubKey","in"],
619
+ ["PWCHAR","lpFile","in"],
620
+ ])
621
+
622
+ dll.add_function('RegNotifyChangeKeyValue', 'DWORD',[
623
+ ["DWORD","hKey","in"],
624
+ ["BOOL","bWatchSubtree","in"],
625
+ ["DWORD","dwNotifyFilter","in"],
626
+ ["DWORD","hEvent","in"],
627
+ ["BOOL","fAsynchronous","in"],
628
+ ])
629
+
630
+ dll.add_function('RegOpenCurrentUser', 'DWORD',[
631
+ ["DWORD","samDesired","in"],
632
+ ["PDWORD","phkResult","out"],
633
+ ])
634
+
635
+ dll.add_function('RegOpenKeyA', 'DWORD',[
636
+ ["DWORD","hKey","in"],
637
+ ["PCHAR","lpSubKey","in"],
638
+ ["PDWORD","phkResult","out"],
639
+ ])
640
+
641
+ dll.add_function('RegOpenKeyExA', 'DWORD',[
642
+ ["DWORD","hKey","in"],
643
+ ["PCHAR","lpSubKey","in"],
644
+ ["DWORD","ulOptions","inout"],
645
+ ["DWORD","samDesired","in"],
646
+ ["PDWORD","phkResult","out"],
647
+ ])
648
+
649
+ dll.add_function('RegOpenKeyExW', 'DWORD',[
650
+ ["DWORD","hKey","in"],
651
+ ["PWCHAR","lpSubKey","in"],
652
+ ["DWORD","ulOptions","inout"],
653
+ ["DWORD","samDesired","in"],
654
+ ["PDWORD","phkResult","out"],
655
+ ])
656
+
657
+ dll.add_function('RegOpenKeyW', 'DWORD',[
658
+ ["DWORD","hKey","in"],
659
+ ["PWCHAR","lpSubKey","in"],
660
+ ["PDWORD","phkResult","out"],
661
+ ])
662
+
663
+ dll.add_function('RegOpenUserClassesRoot', 'DWORD',[
664
+ ["DWORD","hToken","in"],
665
+ ["DWORD","dwOptions","inout"],
666
+ ["DWORD","samDesired","in"],
667
+ ["PDWORD","phkResult","out"],
668
+ ])
669
+
670
+ dll.add_function('RegOverridePredefKey', 'DWORD',[
671
+ ["DWORD","hKey","in"],
672
+ ["DWORD","hNewHKey","in"],
673
+ ])
674
+
675
+ dll.add_function('RegQueryInfoKeyA', 'DWORD',[
676
+ ["DWORD","hKey","in"],
677
+ ["PCHAR","lpClass","out"],
678
+ ["PDWORD","lpcchClass","inout"],
679
+ ["PDWORD","lpReserved","inout"],
680
+ ["PDWORD","lpcSubKeys","out"],
681
+ ["PDWORD","lpcbMaxSubKeyLen","out"],
682
+ ["PDWORD","lpcbMaxClassLen","out"],
683
+ ["PDWORD","lpcValues","out"],
684
+ ["PDWORD","lpcbMaxValueNameLen","out"],
685
+ ["PDWORD","lpcbMaxValueLen","out"],
686
+ ["PDWORD","lpcbSecurityDescriptor","out"],
687
+ ["PBLOB","lpftLastWriteTime","out"],
688
+ ])
689
+
690
+ dll.add_function('RegQueryInfoKeyW', 'DWORD',[
691
+ ["DWORD","hKey","in"],
692
+ ["PWCHAR","lpClass","out"],
693
+ ["PDWORD","lpcchClass","inout"],
694
+ ["PDWORD","lpReserved","inout"],
695
+ ["PDWORD","lpcSubKeys","out"],
696
+ ["PDWORD","lpcbMaxSubKeyLen","out"],
697
+ ["PDWORD","lpcbMaxClassLen","out"],
698
+ ["PDWORD","lpcValues","out"],
699
+ ["PDWORD","lpcbMaxValueNameLen","out"],
700
+ ["PDWORD","lpcbMaxValueLen","out"],
701
+ ["PDWORD","lpcbSecurityDescriptor","out"],
702
+ ["PBLOB","lpftLastWriteTime","out"],
703
+ ])
704
+
705
+ dll.add_function('RegQueryMultipleValuesA', 'DWORD',[
706
+ ["DWORD","hKey","in"],
707
+ ["PBLOB","val_list","out"],
708
+ ["DWORD","num_vals","in"],
709
+ ["PCHAR","lpValueBuf","out"],
710
+ ["PDWORD","ldwTotsize","inout"],
711
+ ])
712
+
713
+ dll.add_function('RegQueryMultipleValuesW', 'DWORD',[
714
+ ["DWORD","hKey","in"],
715
+ ["PBLOB","val_list","out"],
716
+ ["DWORD","num_vals","in"],
717
+ ["PWCHAR","lpValueBuf","out"],
718
+ ["PDWORD","ldwTotsize","inout"],
719
+ ])
720
+
721
+ dll.add_function('RegQueryReflectionKey', 'DWORD',[
722
+ ["DWORD","hBase","in"],
723
+ ["PBLOB","bIsReflectionDisabled","out"],
724
+ ])
725
+
726
+ dll.add_function('RegQueryValueA', 'DWORD',[
727
+ ["DWORD","hKey","in"],
728
+ ["PCHAR","lpSubKey","in"],
729
+ ["PCHAR","lpData","out"],
730
+ ["PDWORD","lpcbData","inout"],
731
+ ])
732
+
733
+ dll.add_function('RegQueryValueExA', 'DWORD',[
734
+ ["DWORD","hKey","in"],
735
+ ["PCHAR","lpValueName","in"],
736
+ ["PDWORD","lpReserved","inout"],
737
+ ["PDWORD","lpType","out"],
738
+ ["PBLOB","lpData","out"],
739
+ ["PDWORD","lpcbData","inout"],
740
+ ])
741
+
742
+ dll.add_function('RegQueryValueExW', 'DWORD',[
743
+ ["DWORD","hKey","in"],
744
+ ["PWCHAR","lpValueName","in"],
745
+ ["PDWORD","lpReserved","inout"],
746
+ ["PDWORD","lpType","out"],
747
+ ["PBLOB","lpData","out"],
748
+ ["PDWORD","lpcbData","inout"],
749
+ ])
750
+
751
+ dll.add_function('RegQueryValueW', 'DWORD',[
752
+ ["DWORD","hKey","in"],
753
+ ["PWCHAR","lpSubKey","in"],
754
+ ["PWCHAR","lpData","out"],
755
+ ["PDWORD","lpcbData","inout"],
756
+ ])
757
+
758
+ dll.add_function('RegReplaceKeyA', 'DWORD',[
759
+ ["DWORD","hKey","in"],
760
+ ["PCHAR","lpSubKey","in"],
761
+ ["PCHAR","lpNewFile","in"],
762
+ ["PCHAR","lpOldFile","in"],
763
+ ])
764
+
765
+ dll.add_function('RegReplaceKeyW', 'DWORD',[
766
+ ["DWORD","hKey","in"],
767
+ ["PWCHAR","lpSubKey","in"],
768
+ ["PWCHAR","lpNewFile","in"],
769
+ ["PWCHAR","lpOldFile","in"],
770
+ ])
771
+
772
+ dll.add_function('RegRestoreKeyA', 'DWORD',[
773
+ ["DWORD","hKey","in"],
774
+ ["PCHAR","lpFile","in"],
775
+ ["DWORD","dwFlags","in"],
776
+ ])
777
+
778
+ dll.add_function('RegRestoreKeyW', 'DWORD',[
779
+ ["DWORD","hKey","in"],
780
+ ["PWCHAR","lpFile","in"],
781
+ ["DWORD","dwFlags","in"],
782
+ ])
783
+
784
+ dll.add_function('RegSaveKeyA', 'DWORD',[
785
+ ["DWORD","hKey","in"],
786
+ ["PCHAR","lpFile","in"],
787
+ ["PBLOB","lpSecurityAttributes","in"],
788
+ ])
789
+
790
+ dll.add_function('RegSaveKeyExA', 'DWORD',[
791
+ ["DWORD","hKey","in"],
792
+ ["PCHAR","lpFile","in"],
793
+ ["PBLOB","lpSecurityAttributes","in"],
794
+ ["DWORD","Flags","in"],
795
+ ])
796
+
797
+ dll.add_function('RegSaveKeyExW', 'DWORD',[
798
+ ["DWORD","hKey","in"],
799
+ ["PWCHAR","lpFile","in"],
800
+ ["PBLOB","lpSecurityAttributes","in"],
801
+ ["DWORD","Flags","in"],
802
+ ])
803
+
804
+ dll.add_function('RegSaveKeyW', 'DWORD',[
805
+ ["DWORD","hKey","in"],
806
+ ["PWCHAR","lpFile","in"],
807
+ ["PBLOB","lpSecurityAttributes","in"],
808
+ ])
809
+
810
+ dll.add_function('RegSetKeySecurity', 'DWORD',[
811
+ ["DWORD","hKey","in"],
812
+ ["PBLOB","SecurityInformation","in"],
813
+ ["PBLOB","pSecurityDescriptor","in"],
814
+ ])
815
+
816
+ dll.add_function('RegSetValueA', 'DWORD',[
817
+ ["DWORD","hKey","in"],
818
+ ["PCHAR","lpSubKey","in"],
819
+ ["DWORD","dwType","in"],
820
+ ["PCHAR","lpData","in"],
821
+ ["DWORD","cbData","in"],
822
+ ])
823
+
824
+ dll.add_function('RegSetValueExA', 'DWORD',[
825
+ ["DWORD","hKey","in"],
826
+ ["PCHAR","lpValueName","in"],
827
+ ["DWORD","Reserved","inout"],
828
+ ["DWORD","dwType","in"],
829
+ ["PBLOB","lpData","in"],
830
+ ["DWORD","cbData","in"],
831
+ ])
832
+
833
+ dll.add_function('RegSetValueExW', 'DWORD',[
834
+ ["DWORD","hKey","in"],
835
+ ["PWCHAR","lpValueName","in"],
836
+ ["DWORD","Reserved","inout"],
837
+ ["DWORD","dwType","in"],
838
+ ["PBLOB","lpData","in"],
839
+ ["DWORD","cbData","in"],
840
+ ])
841
+
842
+ dll.add_function('RegSetValueW', 'DWORD',[
843
+ ["DWORD","hKey","in"],
844
+ ["PWCHAR","lpSubKey","in"],
845
+ ["DWORD","dwType","in"],
846
+ ["PWCHAR","lpData","in"],
847
+ ["DWORD","cbData","in"],
848
+ ])
849
+
850
+ dll.add_function('RegUnLoadKeyA', 'DWORD',[
851
+ ["DWORD","hKey","in"],
852
+ ["PCHAR","lpSubKey","in"],
853
+ ])
854
+
855
+ dll.add_function('RegUnLoadKeyW', 'DWORD',[
856
+ ["DWORD","hKey","in"],
857
+ ["PWCHAR","lpSubKey","in"],
858
+ ])
859
+
860
+ dll.add_function('Wow64Win32ApiEntry', 'DWORD',[
861
+ ["DWORD","dwFuncNumber","in"],
862
+ ["DWORD","dwFlag","in"],
863
+ ["DWORD","dwRes","in"],
864
+ ])
865
+
866
+ dll.add_function('AccessCheck', 'BOOL',[
867
+ ["PBLOB","pSecurityDescriptor","in"],
868
+ ["DWORD","ClientToken","in"],
869
+ ["DWORD","DesiredAccess","in"],
870
+ ["PBLOB","GenericMapping","in"],
871
+ ["PBLOB","PrivilegeSet","out"],
872
+ ["PDWORD","PrivilegeSetLength","inout"],
873
+ ["PDWORD","GrantedAccess","out"],
874
+ ["PBLOB","AccessStatus","out"],
875
+ ])
876
+
877
+ dll.add_function('AccessCheckAndAuditAlarmA', 'BOOL',[
878
+ ["PCHAR","SubsystemName","in"],
879
+ ["PBLOB","HandleId","in"],
880
+ ["PCHAR","ObjectTypeName","in"],
881
+ ["PCHAR","ObjectName","in"],
882
+ ["PBLOB","SecurityDescriptor","in"],
883
+ ["DWORD","DesiredAccess","in"],
884
+ ["PBLOB","GenericMapping","in"],
885
+ ["BOOL","ObjectCreation","in"],
886
+ ["PDWORD","GrantedAccess","out"],
887
+ ["PBLOB","AccessStatus","out"],
888
+ ["PBLOB","pfGenerateOnClose","out"],
889
+ ])
890
+
891
+ dll.add_function('AccessCheckAndAuditAlarmW', 'BOOL',[
892
+ ["PWCHAR","SubsystemName","in"],
893
+ ["PBLOB","HandleId","in"],
894
+ ["PWCHAR","ObjectTypeName","in"],
895
+ ["PWCHAR","ObjectName","in"],
896
+ ["PBLOB","SecurityDescriptor","in"],
897
+ ["DWORD","DesiredAccess","in"],
898
+ ["PBLOB","GenericMapping","in"],
899
+ ["BOOL","ObjectCreation","in"],
900
+ ["PDWORD","GrantedAccess","out"],
901
+ ["PBLOB","AccessStatus","out"],
902
+ ["PBLOB","pfGenerateOnClose","out"],
903
+ ])
904
+
905
+ dll.add_function('AccessCheckByType', 'BOOL',[
906
+ ["PBLOB","pSecurityDescriptor","in"],
907
+ ["LPVOID","PrincipalSelfSid","in"],
908
+ ["DWORD","ClientToken","in"],
909
+ ["DWORD","DesiredAccess","in"],
910
+ ["PBLOB","ObjectTypeList","inout"],
911
+ ["DWORD","ObjectTypeListLength","in"],
912
+ ["PBLOB","GenericMapping","in"],
913
+ ["PBLOB","PrivilegeSet","out"],
914
+ ["PDWORD","PrivilegeSetLength","inout"],
915
+ ["PDWORD","GrantedAccess","out"],
916
+ ["PBLOB","AccessStatus","out"],
917
+ ])
918
+
919
+ dll.add_function('AccessCheckByTypeAndAuditAlarmA', 'BOOL',[
920
+ ["PCHAR","SubsystemName","in"],
921
+ ["PBLOB","HandleId","in"],
922
+ ["PCHAR","ObjectTypeName","in"],
923
+ ["PCHAR","ObjectName","in"],
924
+ ["PBLOB","SecurityDescriptor","in"],
925
+ ["LPVOID","PrincipalSelfSid","in"],
926
+ ["DWORD","DesiredAccess","in"],
927
+ ["DWORD","AuditType","in"],
928
+ ["DWORD","Flags","in"],
929
+ ["PBLOB","ObjectTypeList","inout"],
930
+ ["DWORD","ObjectTypeListLength","in"],
931
+ ["PBLOB","GenericMapping","in"],
932
+ ["BOOL","ObjectCreation","in"],
933
+ ["PDWORD","GrantedAccess","out"],
934
+ ["PBLOB","AccessStatus","out"],
935
+ ["PBLOB","pfGenerateOnClose","out"],
936
+ ])
937
+
938
+ dll.add_function('AccessCheckByTypeAndAuditAlarmW', 'BOOL',[
939
+ ["PWCHAR","SubsystemName","in"],
940
+ ["PBLOB","HandleId","in"],
941
+ ["PWCHAR","ObjectTypeName","in"],
942
+ ["PWCHAR","ObjectName","in"],
943
+ ["PBLOB","SecurityDescriptor","in"],
944
+ ["LPVOID","PrincipalSelfSid","in"],
945
+ ["DWORD","DesiredAccess","in"],
946
+ ["DWORD","AuditType","in"],
947
+ ["DWORD","Flags","in"],
948
+ ["PBLOB","ObjectTypeList","inout"],
949
+ ["DWORD","ObjectTypeListLength","in"],
950
+ ["PBLOB","GenericMapping","in"],
951
+ ["BOOL","ObjectCreation","in"],
952
+ ["PDWORD","GrantedAccess","out"],
953
+ ["PBLOB","AccessStatus","out"],
954
+ ["PBLOB","pfGenerateOnClose","out"],
955
+ ])
956
+
957
+ dll.add_function('AccessCheckByTypeResultList', 'BOOL',[
958
+ ["PBLOB","pSecurityDescriptor","in"],
959
+ ["LPVOID","PrincipalSelfSid","in"],
960
+ ["DWORD","ClientToken","in"],
961
+ ["DWORD","DesiredAccess","in"],
962
+ ["PBLOB","ObjectTypeList","inout"],
963
+ ["DWORD","ObjectTypeListLength","in"],
964
+ ["PBLOB","GenericMapping","in"],
965
+ ["PBLOB","PrivilegeSet","out"],
966
+ ["PDWORD","PrivilegeSetLength","inout"],
967
+ ["PDWORD","GrantedAccessList","out"],
968
+ ["PDWORD","AccessStatusList","out"],
969
+ ])
970
+
971
+ dll.add_function('AccessCheckByTypeResultListAndAuditAlarmA', 'BOOL',[
972
+ ["PCHAR","SubsystemName","in"],
973
+ ["PBLOB","HandleId","in"],
974
+ ["PCHAR","ObjectTypeName","in"],
975
+ ["PCHAR","ObjectName","in"],
976
+ ["PBLOB","SecurityDescriptor","in"],
977
+ ["LPVOID","PrincipalSelfSid","in"],
978
+ ["DWORD","DesiredAccess","in"],
979
+ ["DWORD","AuditType","in"],
980
+ ["DWORD","Flags","in"],
981
+ ["PBLOB","ObjectTypeList","inout"],
982
+ ["DWORD","ObjectTypeListLength","in"],
983
+ ["PBLOB","GenericMapping","in"],
984
+ ["BOOL","ObjectCreation","in"],
985
+ ["PDWORD","GrantedAccess","out"],
986
+ ["PDWORD","AccessStatusList","out"],
987
+ ["PBLOB","pfGenerateOnClose","out"],
988
+ ])
989
+
990
+ dll.add_function('AccessCheckByTypeResultListAndAuditAlarmByHandleA', 'BOOL',[
991
+ ["PCHAR","SubsystemName","in"],
992
+ ["PBLOB","HandleId","in"],
993
+ ["DWORD","ClientToken","in"],
994
+ ["PCHAR","ObjectTypeName","in"],
995
+ ["PCHAR","ObjectName","in"],
996
+ ["PBLOB","SecurityDescriptor","in"],
997
+ ["LPVOID","PrincipalSelfSid","in"],
998
+ ["DWORD","DesiredAccess","in"],
999
+ ["DWORD","AuditType","in"],
1000
+ ["DWORD","Flags","in"],
1001
+ ["PBLOB","ObjectTypeList","inout"],
1002
+ ["DWORD","ObjectTypeListLength","in"],
1003
+ ["PBLOB","GenericMapping","in"],
1004
+ ["BOOL","ObjectCreation","in"],
1005
+ ["PDWORD","GrantedAccess","out"],
1006
+ ["PDWORD","AccessStatusList","out"],
1007
+ ["PBLOB","pfGenerateOnClose","out"],
1008
+ ])
1009
+
1010
+ dll.add_function('AccessCheckByTypeResultListAndAuditAlarmByHandleW', 'BOOL',[
1011
+ ["PWCHAR","SubsystemName","in"],
1012
+ ["PBLOB","HandleId","in"],
1013
+ ["DWORD","ClientToken","in"],
1014
+ ["PWCHAR","ObjectTypeName","in"],
1015
+ ["PWCHAR","ObjectName","in"],
1016
+ ["PBLOB","SecurityDescriptor","in"],
1017
+ ["LPVOID","PrincipalSelfSid","in"],
1018
+ ["DWORD","DesiredAccess","in"],
1019
+ ["DWORD","AuditType","in"],
1020
+ ["DWORD","Flags","in"],
1021
+ ["PBLOB","ObjectTypeList","inout"],
1022
+ ["DWORD","ObjectTypeListLength","in"],
1023
+ ["PBLOB","GenericMapping","in"],
1024
+ ["BOOL","ObjectCreation","in"],
1025
+ ["PDWORD","GrantedAccess","out"],
1026
+ ["PDWORD","AccessStatusList","out"],
1027
+ ["PBLOB","pfGenerateOnClose","out"],
1028
+ ])
1029
+
1030
+ dll.add_function('AccessCheckByTypeResultListAndAuditAlarmW', 'BOOL',[
1031
+ ["PWCHAR","SubsystemName","in"],
1032
+ ["PBLOB","HandleId","in"],
1033
+ ["PWCHAR","ObjectTypeName","in"],
1034
+ ["PWCHAR","ObjectName","in"],
1035
+ ["PBLOB","SecurityDescriptor","in"],
1036
+ ["LPVOID","PrincipalSelfSid","in"],
1037
+ ["DWORD","DesiredAccess","in"],
1038
+ ["DWORD","AuditType","in"],
1039
+ ["DWORD","Flags","in"],
1040
+ ["PBLOB","ObjectTypeList","inout"],
1041
+ ["DWORD","ObjectTypeListLength","in"],
1042
+ ["PBLOB","GenericMapping","in"],
1043
+ ["BOOL","ObjectCreation","in"],
1044
+ ["PDWORD","GrantedAccess","out"],
1045
+ ["PDWORD","AccessStatusList","out"],
1046
+ ["PBLOB","pfGenerateOnClose","out"],
1047
+ ])
1048
+
1049
+ dll.add_function('AddAccessAllowedAce', 'BOOL',[
1050
+ ["PBLOB","pAcl","inout"],
1051
+ ["DWORD","dwAceRevision","in"],
1052
+ ["DWORD","AccessMask","in"],
1053
+ ["LPVOID","pSid","in"],
1054
+ ])
1055
+
1056
+ dll.add_function('AddAccessAllowedAceEx', 'BOOL',[
1057
+ ["PBLOB","pAcl","inout"],
1058
+ ["DWORD","dwAceRevision","in"],
1059
+ ["DWORD","AceFlags","in"],
1060
+ ["DWORD","AccessMask","in"],
1061
+ ["LPVOID","pSid","in"],
1062
+ ])
1063
+
1064
+ dll.add_function('AddAccessAllowedObjectAce', 'BOOL',[
1065
+ ["PBLOB","pAcl","inout"],
1066
+ ["DWORD","dwAceRevision","in"],
1067
+ ["DWORD","AceFlags","in"],
1068
+ ["DWORD","AccessMask","in"],
1069
+ ["PBLOB","ObjectTypeGuid","in"],
1070
+ ["PBLOB","InheritedObjectTypeGuid","in"],
1071
+ ["LPVOID","pSid","in"],
1072
+ ])
1073
+
1074
+ dll.add_function('AddAccessDeniedAce', 'BOOL',[
1075
+ ["PBLOB","pAcl","inout"],
1076
+ ["DWORD","dwAceRevision","in"],
1077
+ ["DWORD","AccessMask","in"],
1078
+ ["LPVOID","pSid","in"],
1079
+ ])
1080
+
1081
+ dll.add_function('AddAccessDeniedAceEx', 'BOOL',[
1082
+ ["PBLOB","pAcl","inout"],
1083
+ ["DWORD","dwAceRevision","in"],
1084
+ ["DWORD","AceFlags","in"],
1085
+ ["DWORD","AccessMask","in"],
1086
+ ["LPVOID","pSid","in"],
1087
+ ])
1088
+
1089
+ dll.add_function('AddAccessDeniedObjectAce', 'BOOL',[
1090
+ ["PBLOB","pAcl","inout"],
1091
+ ["DWORD","dwAceRevision","in"],
1092
+ ["DWORD","AceFlags","in"],
1093
+ ["DWORD","AccessMask","in"],
1094
+ ["PBLOB","ObjectTypeGuid","in"],
1095
+ ["PBLOB","InheritedObjectTypeGuid","in"],
1096
+ ["LPVOID","pSid","in"],
1097
+ ])
1098
+
1099
+ dll.add_function('AddAce', 'BOOL',[
1100
+ ["PBLOB","pAcl","inout"],
1101
+ ["DWORD","dwAceRevision","in"],
1102
+ ["DWORD","dwStartingAceIndex","in"],
1103
+ ["PBLOB","pAceList","in"],
1104
+ ["DWORD","nAceListLength","in"],
1105
+ ])
1106
+
1107
+ dll.add_function('AddAuditAccessAce', 'BOOL',[
1108
+ ["PBLOB","pAcl","inout"],
1109
+ ["DWORD","dwAceRevision","in"],
1110
+ ["DWORD","dwAccessMask","in"],
1111
+ ["LPVOID","pSid","in"],
1112
+ ["BOOL","bAuditSuccess","in"],
1113
+ ["BOOL","bAuditFailure","in"],
1114
+ ])
1115
+
1116
+ dll.add_function('AddAuditAccessAceEx', 'BOOL',[
1117
+ ["PBLOB","pAcl","inout"],
1118
+ ["DWORD","dwAceRevision","in"],
1119
+ ["DWORD","AceFlags","in"],
1120
+ ["DWORD","dwAccessMask","in"],
1121
+ ["LPVOID","pSid","in"],
1122
+ ["BOOL","bAuditSuccess","in"],
1123
+ ["BOOL","bAuditFailure","in"],
1124
+ ])
1125
+
1126
+ dll.add_function('AddAuditAccessObjectAce', 'BOOL',[
1127
+ ["PBLOB","pAcl","inout"],
1128
+ ["DWORD","dwAceRevision","in"],
1129
+ ["DWORD","AceFlags","in"],
1130
+ ["DWORD","AccessMask","in"],
1131
+ ["PBLOB","ObjectTypeGuid","in"],
1132
+ ["PBLOB","InheritedObjectTypeGuid","in"],
1133
+ ["LPVOID","pSid","in"],
1134
+ ["BOOL","bAuditSuccess","in"],
1135
+ ["BOOL","bAuditFailure","in"],
1136
+ ])
1137
+
1138
+ dll.add_function('AdjustTokenGroups', 'BOOL',[
1139
+ ["DWORD","TokenHandle","in"],
1140
+ ["BOOL","ResetToDefault","in"],
1141
+ ["PBLOB","NewState","in"],
1142
+ ["DWORD","BufferLength","in"],
1143
+ ["PBLOB","PreviousState","out"],
1144
+ ["PDWORD","ReturnLength","out"],
1145
+ ])
1146
+
1147
+ dll.add_function('AdjustTokenPrivileges', 'BOOL',[
1148
+ ["DWORD","TokenHandle","in"],
1149
+ ["BOOL","DisableAllPrivileges","in"],
1150
+ ["PBLOB","NewState","in"],
1151
+ ["DWORD","BufferLength","in"],
1152
+ ["PBLOB","PreviousState","out"],
1153
+ ["PDWORD","ReturnLength","out"],
1154
+ ])
1155
+
1156
+ dll.add_function('AllocateAndInitializeSid', 'BOOL',[
1157
+ ["PBLOB","pIdentifierAuthority","in"],
1158
+ ["BYTE","nSubAuthorityCount","in"],
1159
+ ["DWORD","nSubAuthority0","in"],
1160
+ ["DWORD","nSubAuthority1","in"],
1161
+ ["DWORD","nSubAuthority2","in"],
1162
+ ["DWORD","nSubAuthority3","in"],
1163
+ ["DWORD","nSubAuthority4","in"],
1164
+ ["DWORD","nSubAuthority5","in"],
1165
+ ["DWORD","nSubAuthority6","in"],
1166
+ ["DWORD","nSubAuthority7","in"],
1167
+ ["PDWORD","pSid","out"],
1168
+ ])
1169
+
1170
+ dll.add_function('AllocateLocallyUniqueId', 'BOOL',[
1171
+ ["PBLOB","Luid","out"],
1172
+ ])
1173
+
1174
+ dll.add_function('AreAllAccessesGranted', 'BOOL',[
1175
+ ["DWORD","GrantedAccess","in"],
1176
+ ["DWORD","DesiredAccess","in"],
1177
+ ])
1178
+
1179
+ dll.add_function('AreAnyAccessesGranted', 'BOOL',[
1180
+ ["DWORD","GrantedAccess","in"],
1181
+ ["DWORD","DesiredAccess","in"],
1182
+ ])
1183
+
1184
+ dll.add_function('BackupEventLogA', 'BOOL',[
1185
+ ["DWORD","hEventLog","in"],
1186
+ ["PCHAR","lpBackupFileName","in"],
1187
+ ])
1188
+
1189
+ dll.add_function('BackupEventLogW', 'BOOL',[
1190
+ ["DWORD","hEventLog","in"],
1191
+ ["PWCHAR","lpBackupFileName","in"],
1192
+ ])
1193
+
1194
+ dll.add_function('CheckTokenMembership', 'BOOL',[
1195
+ ["DWORD","TokenHandle","in"],
1196
+ ["PBLOB","SidToCheck","in"],
1197
+ ["PBLOB","IsMember","out"],
1198
+ ])
1199
+
1200
+ dll.add_function('ClearEventLogA', 'BOOL',[
1201
+ ["DWORD","hEventLog","in"],
1202
+ ["PCHAR","lpBackupFileName","in"],
1203
+ ])
1204
+
1205
+ dll.add_function('ClearEventLogW', 'BOOL',[
1206
+ ["DWORD","hEventLog","in"],
1207
+ ["PWCHAR","lpBackupFileName","in"],
1208
+ ])
1209
+
1210
+ dll.add_function('CloseEncryptedFileRaw', 'VOID',[
1211
+ ["PBLOB","pvContext","in"],
1212
+ ])
1213
+
1214
+ dll.add_function('CloseEventLog', 'BOOL',[
1215
+ ["DWORD","hEventLog","in"],
1216
+ ])
1217
+
1218
+ dll.add_function('ConvertToAutoInheritPrivateObjectSecurity', 'BOOL',[
1219
+ ["PBLOB","ParentDescriptor","in"],
1220
+ ["PBLOB","CurrentSecurityDescriptor","in"],
1221
+ ["PBLOB","NewSecurityDescriptor","out"],
1222
+ ["PBLOB","ObjectType","in"],
1223
+ ["BOOL","IsDirectoryObject","in"],
1224
+ ["PBLOB","GenericMapping","in"],
1225
+ ])
1226
+
1227
+ dll.add_function('ConvertStringSidToSidA', 'BOOL',[
1228
+ ["PCHAR","StringSid","in"],
1229
+ ["PDWORD","pSid","out"],
1230
+ ])
1231
+
1232
+ dll.add_function('ConvertStringSidToSidW', 'BOOL',[
1233
+ ["PWCHAR","StringSid","in"],
1234
+ ["PDWORD","pSid","out"],
1235
+ ])
1236
+
1237
+ dll.add_function('CopySid', 'BOOL',[
1238
+ ["DWORD","nDestinationSidLength","in"],
1239
+ ["PBLOB","pDestinationSid","out"],
1240
+ ["LPVOID","pSourceSid","in"],
1241
+ ])
1242
+
1243
+ dll.add_function('CreatePrivateObjectSecurity', 'BOOL',[
1244
+ ["PBLOB","ParentDescriptor","in"],
1245
+ ["PBLOB","CreatorDescriptor","in"],
1246
+ ["PBLOB","NewDescriptor","out"],
1247
+ ["BOOL","IsDirectoryObject","in"],
1248
+ ["DWORD","Token","in"],
1249
+ ["PBLOB","GenericMapping","in"],
1250
+ ])
1251
+
1252
+ dll.add_function('CreatePrivateObjectSecurityEx', 'BOOL',[
1253
+ ["PBLOB","ParentDescriptor","in"],
1254
+ ["PBLOB","CreatorDescriptor","in"],
1255
+ ["PBLOB","NewDescriptor","out"],
1256
+ ["PBLOB","ObjectType","in"],
1257
+ ["BOOL","IsContainerObject","in"],
1258
+ ["DWORD","AutoInheritFlags","in"],
1259
+ ["DWORD","Token","in"],
1260
+ ["PBLOB","GenericMapping","in"],
1261
+ ])
1262
+
1263
+ dll.add_function('CreatePrivateObjectSecurityWithMultipleInheritance', 'BOOL',[
1264
+ ["PBLOB","ParentDescriptor","in"],
1265
+ ["PBLOB","CreatorDescriptor","in"],
1266
+ ["PBLOB","NewDescriptor","out"],
1267
+ ["PBLOB","ObjectTypes","in"],
1268
+ ["DWORD","GuidCount","in"],
1269
+ ["BOOL","IsContainerObject","in"],
1270
+ ["DWORD","AutoInheritFlags","in"],
1271
+ ["DWORD","Token","in"],
1272
+ ["PBLOB","GenericMapping","in"],
1273
+ ])
1274
+
1275
+ dll.add_function('CreateProcessAsUserA', 'BOOL',[
1276
+ ["DWORD","hToken","in"],
1277
+ ["PCHAR","lpApplicationName","in"],
1278
+ ["PCHAR","lpCommandLine","inout"],
1279
+ ["PBLOB","lpProcessAttributes","in"],
1280
+ ["PBLOB","lpThreadAttributes","in"],
1281
+ ["BOOL","bInheritHandles","in"],
1282
+ ["DWORD","dwCreationFlags","in"],
1283
+ ["PBLOB","lpEnvironment","in"],
1284
+ ["PCHAR","lpCurrentDirectory","in"],
1285
+ ["PBLOB","lpStartupInfo","in"],
1286
+ ["PBLOB","lpProcessInformation","out"],
1287
+ ])
1288
+
1289
+ dll.add_function('CreateProcessAsUserW', 'BOOL',[
1290
+ ["DWORD","hToken","in"],
1291
+ ["PWCHAR","lpApplicationName","in"],
1292
+ ["PWCHAR","lpCommandLine","inout"],
1293
+ ["PBLOB","lpProcessAttributes","in"],
1294
+ ["PBLOB","lpThreadAttributes","in"],
1295
+ ["BOOL","bInheritHandles","in"],
1296
+ ["DWORD","dwCreationFlags","in"],
1297
+ ["PBLOB","lpEnvironment","in"],
1298
+ ["PWCHAR","lpCurrentDirectory","in"],
1299
+ ["PBLOB","lpStartupInfo","in"],
1300
+ ["PBLOB","lpProcessInformation","out"],
1301
+ ])
1302
+
1303
+ dll.add_function('CreateProcessWithLogonW', 'BOOL',[
1304
+ ["PWCHAR","lpUsername","in"],
1305
+ ["PWCHAR","lpDomain","in"],
1306
+ ["PWCHAR","lpPassword","in"],
1307
+ ["DWORD","dwLogonFlags","in"],
1308
+ ["PWCHAR","lpApplicationName","in"],
1309
+ ["PWCHAR","lpCommandLine","inout"],
1310
+ ["DWORD","dwCreationFlags","in"],
1311
+ ["PBLOB","lpEnvironment","in"],
1312
+ ["PWCHAR","lpCurrentDirectory","in"],
1313
+ ["PBLOB","lpStartupInfo","in"],
1314
+ ["PBLOB","lpProcessInformation","out"],
1315
+ ])
1316
+
1317
+ dll.add_function('CreateProcessWithTokenW', 'BOOL',[
1318
+ ["DWORD","hToken","in"],
1319
+ ["DWORD","dwLogonFlags","in"],
1320
+ ["PWCHAR","lpApplicationName","in"],
1321
+ ["PWCHAR","lpCommandLine","inout"],
1322
+ ["DWORD","dwCreationFlags","in"],
1323
+ ["PBLOB","lpEnvironment","in"],
1324
+ ["PWCHAR","lpCurrentDirectory","in"],
1325
+ ["PBLOB","lpStartupInfo","in"],
1326
+ ["PBLOB","lpProcessInformation","out"],
1327
+ ])
1328
+
1329
+ dll.add_function('CreateRestrictedToken', 'BOOL',[
1330
+ ["DWORD","ExistingTokenHandle","in"],
1331
+ ["DWORD","Flags","in"],
1332
+ ["DWORD","DisableSidCount","in"],
1333
+ ["PBLOB","SidsToDisable","in"],
1334
+ ["DWORD","DeletePrivilegeCount","in"],
1335
+ ["PBLOB","PrivilegesToDelete","in"],
1336
+ ["DWORD","RestrictedSidCount","in"],
1337
+ ["PBLOB","SidsToRestrict","in"],
1338
+ ["PDWORD","NewTokenHandle","out"],
1339
+ ])
1340
+
1341
+ dll.add_function('CreateWellKnownSid', 'BOOL',[
1342
+ ["DWORD","WellKnownSidType","in"],
1343
+ ["PBLOB","DomainSid","in"],
1344
+ ["PBLOB","pSid","out"],
1345
+ ["PDWORD","cbSid","inout"],
1346
+ ])
1347
+
1348
+ dll.add_function('DecryptFileA', 'BOOL',[
1349
+ ["PCHAR","lpFileName","in"],
1350
+ ["DWORD","dwReserved","inout"],
1351
+ ])
1352
+
1353
+ dll.add_function('DecryptFileW', 'BOOL',[
1354
+ ["PWCHAR","lpFileName","in"],
1355
+ ["DWORD","dwReserved","inout"],
1356
+ ])
1357
+
1358
+ dll.add_function('DeleteAce', 'BOOL',[
1359
+ ["PBLOB","pAcl","inout"],
1360
+ ["DWORD","dwAceIndex","in"],
1361
+ ])
1362
+
1363
+ dll.add_function('DeregisterEventSource', 'BOOL',[
1364
+ ["DWORD","hEventLog","in"],
1365
+ ])
1366
+
1367
+ dll.add_function('DestroyPrivateObjectSecurity', 'BOOL',[
1368
+ ["PBLOB","ObjectDescriptor","in"],
1369
+ ])
1370
+
1371
+ dll.add_function('DuplicateToken', 'BOOL',[
1372
+ ["DWORD","ExistingTokenHandle","in"],
1373
+ ["DWORD","ImpersonationLevel","in"],
1374
+ ["PDWORD","DuplicateTokenHandle","out"],
1375
+ ])
1376
+
1377
+ dll.add_function('DuplicateTokenEx', 'BOOL',[
1378
+ ["DWORD","hExistingToken","in"],
1379
+ ["DWORD","dwDesiredAccess","in"],
1380
+ ["PBLOB","lpTokenAttributes","in"],
1381
+ ["DWORD","ImpersonationLevel","in"],
1382
+ ["DWORD","TokenType","in"],
1383
+ ["PDWORD","phNewToken","out"],
1384
+ ])
1385
+
1386
+ dll.add_function('EncryptFileA', 'BOOL',[
1387
+ ["PCHAR","lpFileName","in"],
1388
+ ])
1389
+
1390
+ dll.add_function('EncryptFileW', 'BOOL',[
1391
+ ["PWCHAR","lpFileName","in"],
1392
+ ])
1393
+
1394
+ dll.add_function('EqualDomainSid', 'BOOL',[
1395
+ ["LPVOID","pSid1","in"],
1396
+ ["LPVOID","pSid2","in"],
1397
+ ["PBLOB","pfEqual","out"],
1398
+ ])
1399
+
1400
+ dll.add_function('EqualPrefixSid', 'BOOL',[
1401
+ ["LPVOID","pSid1","in"],
1402
+ ["LPVOID","pSid2","in"],
1403
+ ])
1404
+
1405
+ dll.add_function('EqualSid', 'BOOL',[
1406
+ ["LPVOID","pSid1","in"],
1407
+ ["LPVOID","pSid2","in"],
1408
+ ])
1409
+
1410
+ dll.add_function('FileEncryptionStatusA', 'BOOL',[
1411
+ ["PCHAR","lpFileName","in"],
1412
+ ["PDWORD","lpStatus","out"],
1413
+ ])
1414
+
1415
+ dll.add_function('FileEncryptionStatusW', 'BOOL',[
1416
+ ["PWCHAR","lpFileName","in"],
1417
+ ["PDWORD","lpStatus","out"],
1418
+ ])
1419
+
1420
+ dll.add_function('FindFirstFreeAce', 'BOOL',[
1421
+ ["PBLOB","pAcl","in"],
1422
+ ["PBLOB","pAce","out"],
1423
+ ])
1424
+
1425
+ dll.add_function('FreeSid', 'LPVOID',[
1426
+ ["LPVOID","pSid","in"],
1427
+ ])
1428
+
1429
+ dll.add_function('GetAce', 'BOOL',[
1430
+ ["PBLOB","pAcl","in"],
1431
+ ["DWORD","dwAceIndex","in"],
1432
+ ["PBLOB","pAce","out"],
1433
+ ])
1434
+
1435
+ dll.add_function('GetAclInformation', 'BOOL',[
1436
+ ["PBLOB","pAcl","in"],
1437
+ ["PBLOB","pAclInformation","out"],
1438
+ ["DWORD","nAclInformationLength","in"],
1439
+ ["DWORD","dwAclInformationClass","in"],
1440
+ ])
1441
+
1442
+ dll.add_function('GetCurrentHwProfileA', 'BOOL',[
1443
+ ["PBLOB","lpHwProfileInfo","out"],
1444
+ ])
1445
+
1446
+ dll.add_function('GetCurrentHwProfileW', 'BOOL',[
1447
+ ["PBLOB","lpHwProfileInfo","out"],
1448
+ ])
1449
+
1450
+ dll.add_function('GetEventLogInformation', 'BOOL',[
1451
+ ["DWORD","hEventLog","in"],
1452
+ ["DWORD","dwInfoLevel","in"],
1453
+ ["PBLOB","lpBuffer","out"],
1454
+ ["DWORD","cbBufSize","in"],
1455
+ ["PDWORD","pcbBytesNeeded","out"],
1456
+ ])
1457
+
1458
+ dll.add_function('GetFileSecurityA', 'BOOL',[
1459
+ ["PCHAR","lpFileName","in"],
1460
+ ["DWORD","RequestedInformation","in"],
1461
+ ["PBLOB","pSecurityDescriptor","out"],
1462
+ ["DWORD","nLength","in"],
1463
+ ["PDWORD","lpnLengthNeeded","out"],
1464
+ ])
1465
+
1466
+ dll.add_function('GetFileSecurityW', 'BOOL',[
1467
+ ["PWCHAR","lpFileName","in"],
1468
+ ["DWORD","RequestedInformation","in"],
1469
+ ["PBLOB","pSecurityDescriptor","out"],
1470
+ ["DWORD","nLength","in"],
1471
+ ["PDWORD","lpnLengthNeeded","out"],
1472
+ ])
1473
+
1474
+ dll.add_function('GetKernelObjectSecurity', 'BOOL',[
1475
+ ["DWORD","Handle","in"],
1476
+ ["PBLOB","RequestedInformation","in"],
1477
+ ["PBLOB","pSecurityDescriptor","out"],
1478
+ ["DWORD","nLength","in"],
1479
+ ["PDWORD","lpnLengthNeeded","out"],
1480
+ ])
1481
+
1482
+ dll.add_function('GetLengthSid', 'DWORD',[
1483
+ ["LPVOID","pSid","in"],
1484
+ ])
1485
+
1486
+ dll.add_function('GetNumberOfEventLogRecords', 'BOOL',[
1487
+ ["DWORD","hEventLog","in"],
1488
+ ["PDWORD","NumberOfRecords","out"],
1489
+ ])
1490
+
1491
+ dll.add_function('GetOldestEventLogRecord', 'BOOL',[
1492
+ ["DWORD","hEventLog","in"],
1493
+ ["PDWORD","OldestRecord","out"],
1494
+ ])
1495
+
1496
+ dll.add_function('GetPrivateObjectSecurity', 'BOOL',[
1497
+ ["PBLOB","ObjectDescriptor","in"],
1498
+ ["PBLOB","SecurityInformation","in"],
1499
+ ["PBLOB","ResultantDescriptor","out"],
1500
+ ["DWORD","DescriptorLength","in"],
1501
+ ["PDWORD","ReturnLength","out"],
1502
+ ])
1503
+
1504
+ dll.add_function('GetSecurityDescriptorControl', 'BOOL',[
1505
+ ["PBLOB","pSecurityDescriptor","in"],
1506
+ ["PBLOB","pControl","out"],
1507
+ ["PDWORD","lpdwRevision","out"],
1508
+ ])
1509
+
1510
+ dll.add_function('GetSecurityDescriptorDacl', 'BOOL',[
1511
+ ["PBLOB","pSecurityDescriptor","in"],
1512
+ ["PBLOB","lpbDaclPresent","out"],
1513
+ ["PBLOB","pDacl","out"],
1514
+ ["PBLOB","lpbDaclDefaulted","out"],
1515
+ ])
1516
+
1517
+ dll.add_function('GetSecurityDescriptorGroup', 'BOOL',[
1518
+ ["PBLOB","pSecurityDescriptor","in"],
1519
+ ["PBLOB","pGroup","out"],
1520
+ ["PBLOB","lpbGroupDefaulted","out"],
1521
+ ])
1522
+
1523
+ dll.add_function('GetSecurityDescriptorLength', 'DWORD',[
1524
+ ["PBLOB","pSecurityDescriptor","in"],
1525
+ ])
1526
+
1527
+ dll.add_function('GetSecurityDescriptorOwner', 'BOOL',[
1528
+ ["PBLOB","pSecurityDescriptor","in"],
1529
+ ["PBLOB","pOwner","out"],
1530
+ ["PBLOB","lpbOwnerDefaulted","out"],
1531
+ ])
1532
+
1533
+ dll.add_function('GetSecurityDescriptorRMControl', 'DWORD',[
1534
+ ["PBLOB","SecurityDescriptor","in"],
1535
+ ["PBLOB","RMControl","out"],
1536
+ ])
1537
+
1538
+ dll.add_function('GetSecurityDescriptorSacl', 'BOOL',[
1539
+ ["PBLOB","pSecurityDescriptor","in"],
1540
+ ["PBLOB","lpbSaclPresent","out"],
1541
+ ["PBLOB","pSacl","out"],
1542
+ ["PBLOB","lpbSaclDefaulted","out"],
1543
+ ])
1544
+
1545
+ dll.add_function('GetSidLengthRequired', 'DWORD',[
1546
+ ["BYTE","nSubAuthorityCount","in"],
1547
+ ])
1548
+
1549
+ dll.add_function('GetTokenInformation', 'BOOL',[
1550
+ ["DWORD","TokenHandle","in"],
1551
+ ["DWORD","TokenInformationClass","in"],
1552
+ ["PBLOB","TokenInformation","out"],
1553
+ ["DWORD","TokenInformationLength","in"],
1554
+ ["PDWORD","ReturnLength","out"],
1555
+ ])
1556
+
1557
+ dll.add_function('GetUserNameA', 'BOOL',[
1558
+ ["PCHAR","lpBuffer","out"],
1559
+ ["PDWORD","pcbBuffer","inout"],
1560
+ ])
1561
+
1562
+ dll.add_function('GetUserNameW', 'BOOL',[
1563
+ ["PWCHAR","lpBuffer","out"],
1564
+ ["PDWORD","pcbBuffer","inout"],
1565
+ ])
1566
+
1567
+ dll.add_function('GetWindowsAccountDomainSid', 'BOOL',[
1568
+ ["LPVOID","pSid","in"],
1569
+ ["PBLOB","pDomainSid","out"],
1570
+ ["PDWORD","cbDomainSid","inout"],
1571
+ ])
1572
+
1573
+ dll.add_function('ImpersonateAnonymousToken', 'BOOL',[
1574
+ ["DWORD","ThreadHandle","in"],
1575
+ ])
1576
+
1577
+ dll.add_function('ImpersonateLoggedOnUser', 'BOOL',[
1578
+ ["DWORD","hToken","in"],
1579
+ ])
1580
+
1581
+ dll.add_function('ImpersonateNamedPipeClient', 'BOOL',[
1582
+ ["DWORD","hNamedPipe","in"],
1583
+ ])
1584
+
1585
+ dll.add_function('ImpersonateSelf', 'BOOL',[
1586
+ ["DWORD","ImpersonationLevel","in"],
1587
+ ])
1588
+
1589
+ dll.add_function('InitializeAcl', 'BOOL',[
1590
+ ["PBLOB","pAcl","out"],
1591
+ ["DWORD","nAclLength","in"],
1592
+ ["DWORD","dwAclRevision","in"],
1593
+ ])
1594
+
1595
+ dll.add_function('InitializeSecurityDescriptor', 'BOOL',[
1596
+ ["PBLOB","pSecurityDescriptor","out"],
1597
+ ["DWORD","dwRevision","in"],
1598
+ ])
1599
+
1600
+ dll.add_function('InitializeSid', 'BOOL',[
1601
+ ["PBLOB","Sid","out"],
1602
+ ["PBLOB","pIdentifierAuthority","in"],
1603
+ ["BYTE","nSubAuthorityCount","in"],
1604
+ ])
1605
+
1606
+ dll.add_function('IsTextUnicode', 'BOOL',[
1607
+ ["DWORD","iSize","in"],
1608
+ ["PDWORD","lpiResult","inout"],
1609
+ ])
1610
+
1611
+ dll.add_function('IsTokenRestricted', 'BOOL',[
1612
+ ["DWORD","TokenHandle","in"],
1613
+ ])
1614
+
1615
+ dll.add_function('IsTokenUntrusted', 'BOOL',[
1616
+ ["DWORD","TokenHandle","in"],
1617
+ ])
1618
+
1619
+ dll.add_function('IsValidAcl', 'BOOL',[
1620
+ ["PBLOB","pAcl","in"],
1621
+ ])
1622
+
1623
+ dll.add_function('IsValidSecurityDescriptor', 'BOOL',[
1624
+ ["PBLOB","pSecurityDescriptor","in"],
1625
+ ])
1626
+
1627
+ dll.add_function('IsValidSid', 'BOOL',[
1628
+ ["LPVOID","pSid","in"],
1629
+ ])
1630
+
1631
+ dll.add_function('IsWellKnownSid', 'BOOL',[
1632
+ ["LPVOID","pSid","in"],
1633
+ ["DWORD","WellKnownSidType","in"],
1634
+ ])
1635
+
1636
+ dll.add_function('LogonUserA', 'BOOL',[
1637
+ ["PCHAR","lpszUsername","in"],
1638
+ ["PCHAR","lpszDomain","in"],
1639
+ ["PCHAR","lpszPassword","in"],
1640
+ ["DWORD","dwLogonType","in"],
1641
+ ["DWORD","dwLogonProvider","in"],
1642
+ ["PDWORD","phToken","out"],
1643
+ ])
1644
+
1645
+ dll.add_function('LogonUserExA', 'BOOL',[
1646
+ ["PCHAR","lpszUsername","in"],
1647
+ ["PCHAR","lpszDomain","in"],
1648
+ ["PCHAR","lpszPassword","in"],
1649
+ ["DWORD","dwLogonType","in"],
1650
+ ["DWORD","dwLogonProvider","in"],
1651
+ ["PDWORD","phToken","out"],
1652
+ ["PDWORD","ppLogonSid","out"],
1653
+ ["PBLOB","ppProfileBuffer","out"],
1654
+ ["PDWORD","pdwProfileLength","out"],
1655
+ ["PBLOB","pQuotaLimits","out"],
1656
+ ])
1657
+
1658
+ dll.add_function('LogonUserExW', 'BOOL',[
1659
+ ["PWCHAR","lpszUsername","in"],
1660
+ ["PWCHAR","lpszDomain","in"],
1661
+ ["PWCHAR","lpszPassword","in"],
1662
+ ["DWORD","dwLogonType","in"],
1663
+ ["DWORD","dwLogonProvider","in"],
1664
+ ["PDWORD","phToken","out"],
1665
+ ["PDWORD","ppLogonSid","out"],
1666
+ ["PBLOB","ppProfileBuffer","out"],
1667
+ ["PDWORD","pdwProfileLength","out"],
1668
+ ["PBLOB","pQuotaLimits","out"],
1669
+ ])
1670
+
1671
+ dll.add_function('LogonUserW', 'BOOL',[
1672
+ ["PWCHAR","lpszUsername","in"],
1673
+ ["PWCHAR","lpszDomain","in"],
1674
+ ["PWCHAR","lpszPassword","in"],
1675
+ ["DWORD","dwLogonType","in"],
1676
+ ["DWORD","dwLogonProvider","in"],
1677
+ ["PDWORD","phToken","out"],
1678
+ ])
1679
+
1680
+ dll.add_function('LookupAccountNameA', 'BOOL',[
1681
+ ["PCHAR","lpSystemName","in"],
1682
+ ["PCHAR","lpAccountName","in"],
1683
+ ["PBLOB","Sid","out"],
1684
+ ["PDWORD","cbSid","inout"],
1685
+ ["PCHAR","ReferencedDomainName","out"],
1686
+ ["PDWORD","cchReferencedDomainName","inout"],
1687
+ ["PBLOB","peUse","out"],
1688
+ ])
1689
+
1690
+ dll.add_function('LookupAccountNameW', 'BOOL',[
1691
+ ["PWCHAR","lpSystemName","in"],
1692
+ ["PWCHAR","lpAccountName","in"],
1693
+ ["PBLOB","Sid","out"],
1694
+ ["PDWORD","cbSid","inout"],
1695
+ ["PWCHAR","ReferencedDomainName","out"],
1696
+ ["PDWORD","cchReferencedDomainName","inout"],
1697
+ ["PBLOB","peUse","out"],
1698
+ ])
1699
+
1700
+ dll.add_function('LookupAccountSidA', 'BOOL',[
1701
+ ["PCHAR","lpSystemName","in"],
1702
+ ["LPVOID","Sid","in"],
1703
+ ["PCHAR","Name","out"],
1704
+ ["PDWORD","cchName","inout"],
1705
+ ["PCHAR","ReferencedDomainName","out"],
1706
+ ["PDWORD","cchReferencedDomainName","inout"],
1707
+ ["PBLOB","peUse","out"],
1708
+ ])
1709
+
1710
+ dll.add_function('LookupAccountSidW', 'BOOL',[
1711
+ ["PWCHAR","lpSystemName","in"],
1712
+ ["LPVOID","Sid","in"],
1713
+ ["PWCHAR","Name","out"],
1714
+ ["PDWORD","cchName","inout"],
1715
+ ["PWCHAR","ReferencedDomainName","out"],
1716
+ ["PDWORD","cchReferencedDomainName","inout"],
1717
+ ["PBLOB","peUse","out"],
1718
+ ])
1719
+
1720
+ dll.add_function('LookupPrivilegeDisplayNameA', 'BOOL',[
1721
+ ["PCHAR","lpSystemName","in"],
1722
+ ["PCHAR","lpName","in"],
1723
+ ["PCHAR","lpDisplayName","out"],
1724
+ ["PDWORD","cchDisplayName","inout"],
1725
+ ["PDWORD","lpLanguageId","out"],
1726
+ ])
1727
+
1728
+ dll.add_function('LookupPrivilegeDisplayNameW', 'BOOL',[
1729
+ ["PWCHAR","lpSystemName","in"],
1730
+ ["PWCHAR","lpName","in"],
1731
+ ["PWCHAR","lpDisplayName","out"],
1732
+ ["PDWORD","cchDisplayName","inout"],
1733
+ ["PDWORD","lpLanguageId","out"],
1734
+ ])
1735
+
1736
+ dll.add_function('LookupPrivilegeNameA', 'BOOL',[
1737
+ ["PCHAR","lpSystemName","in"],
1738
+ ["PBLOB","lpLuid","in"],
1739
+ ["PCHAR","lpName","out"],
1740
+ ["PDWORD","cchName","inout"],
1741
+ ])
1742
+
1743
+ dll.add_function('LookupPrivilegeNameW', 'BOOL',[
1744
+ ["PWCHAR","lpSystemName","in"],
1745
+ ["PBLOB","lpLuid","in"],
1746
+ ["PWCHAR","lpName","out"],
1747
+ ["PDWORD","cchName","inout"],
1748
+ ])
1749
+
1750
+ dll.add_function('LookupPrivilegeValueA', 'BOOL',[
1751
+ ["PCHAR","lpSystemName","in"],
1752
+ ["PCHAR","lpName","in"],
1753
+ ["PBLOB","lpLuid","out"],
1754
+ ])
1755
+
1756
+ dll.add_function('LookupPrivilegeValueW', 'BOOL',[
1757
+ ["PWCHAR","lpSystemName","in"],
1758
+ ["PWCHAR","lpName","in"],
1759
+ ["PBLOB","lpLuid","out"],
1760
+ ])
1761
+
1762
+ dll.add_function('MakeAbsoluteSD', 'BOOL',[
1763
+ ["PBLOB","pSelfRelativeSecurityDescriptor","in"],
1764
+ ["PBLOB","pAbsoluteSecurityDescriptor","out"],
1765
+ ["PDWORD","lpdwAbsoluteSecurityDescriptorSize","inout"],
1766
+ ["PBLOB","pDacl","out"],
1767
+ ["PDWORD","lpdwDaclSize","inout"],
1768
+ ["PBLOB","pSacl","out"],
1769
+ ["PDWORD","lpdwSaclSize","inout"],
1770
+ ["PBLOB","pOwner","out"],
1771
+ ["PDWORD","lpdwOwnerSize","inout"],
1772
+ ["PBLOB","pPrimaryGroup","out"],
1773
+ ["PDWORD","lpdwPrimaryGroupSize","inout"],
1774
+ ])
1775
+
1776
+ dll.add_function('MakeAbsoluteSD2', 'BOOL',[
1777
+ ["PBLOB","pSelfRelativeSecurityDescriptor","inout"],
1778
+ ["PDWORD","lpdwBufferSize","inout"],
1779
+ ])
1780
+
1781
+ dll.add_function('MakeSelfRelativeSD', 'BOOL',[
1782
+ ["PBLOB","pAbsoluteSecurityDescriptor","in"],
1783
+ ["PBLOB","pSelfRelativeSecurityDescriptor","out"],
1784
+ ["PDWORD","lpdwBufferLength","inout"],
1785
+ ])
1786
+
1787
+ dll.add_function('MapGenericMask', 'VOID',[
1788
+ ["PDWORD","AccessMask","inout"],
1789
+ ["PBLOB","GenericMapping","in"],
1790
+ ])
1791
+
1792
+ dll.add_function('NotifyChangeEventLog', 'BOOL',[
1793
+ ["DWORD","hEventLog","in"],
1794
+ ["DWORD","hEvent","in"],
1795
+ ])
1796
+
1797
+ dll.add_function('ObjectCloseAuditAlarmA', 'BOOL',[
1798
+ ["PCHAR","SubsystemName","in"],
1799
+ ["PBLOB","HandleId","in"],
1800
+ ["BOOL","GenerateOnClose","in"],
1801
+ ])
1802
+
1803
+ dll.add_function('ObjectCloseAuditAlarmW', 'BOOL',[
1804
+ ["PWCHAR","SubsystemName","in"],
1805
+ ["PBLOB","HandleId","in"],
1806
+ ["BOOL","GenerateOnClose","in"],
1807
+ ])
1808
+
1809
+ dll.add_function('ObjectDeleteAuditAlarmA', 'BOOL',[
1810
+ ["PCHAR","SubsystemName","in"],
1811
+ ["PBLOB","HandleId","in"],
1812
+ ["BOOL","GenerateOnClose","in"],
1813
+ ])
1814
+
1815
+ dll.add_function('ObjectDeleteAuditAlarmW', 'BOOL',[
1816
+ ["PWCHAR","SubsystemName","in"],
1817
+ ["PBLOB","HandleId","in"],
1818
+ ["BOOL","GenerateOnClose","in"],
1819
+ ])
1820
+
1821
+ dll.add_function('ObjectOpenAuditAlarmA', 'BOOL',[
1822
+ ["PCHAR","SubsystemName","in"],
1823
+ ["PBLOB","HandleId","in"],
1824
+ ["PCHAR","ObjectTypeName","in"],
1825
+ ["PCHAR","ObjectName","in"],
1826
+ ["PBLOB","pSecurityDescriptor","in"],
1827
+ ["DWORD","ClientToken","in"],
1828
+ ["DWORD","DesiredAccess","in"],
1829
+ ["DWORD","GrantedAccess","in"],
1830
+ ["PBLOB","Privileges","in"],
1831
+ ["BOOL","ObjectCreation","in"],
1832
+ ["BOOL","AccessGranted","in"],
1833
+ ["PBLOB","GenerateOnClose","out"],
1834
+ ])
1835
+
1836
+ dll.add_function('ObjectOpenAuditAlarmW', 'BOOL',[
1837
+ ["PWCHAR","SubsystemName","in"],
1838
+ ["PBLOB","HandleId","in"],
1839
+ ["PWCHAR","ObjectTypeName","in"],
1840
+ ["PWCHAR","ObjectName","in"],
1841
+ ["PBLOB","pSecurityDescriptor","in"],
1842
+ ["DWORD","ClientToken","in"],
1843
+ ["DWORD","DesiredAccess","in"],
1844
+ ["DWORD","GrantedAccess","in"],
1845
+ ["PBLOB","Privileges","in"],
1846
+ ["BOOL","ObjectCreation","in"],
1847
+ ["BOOL","AccessGranted","in"],
1848
+ ["PBLOB","GenerateOnClose","out"],
1849
+ ])
1850
+
1851
+ dll.add_function('ObjectPrivilegeAuditAlarmA', 'BOOL',[
1852
+ ["PCHAR","SubsystemName","in"],
1853
+ ["PBLOB","HandleId","in"],
1854
+ ["DWORD","ClientToken","in"],
1855
+ ["DWORD","DesiredAccess","in"],
1856
+ ["PBLOB","Privileges","in"],
1857
+ ["BOOL","AccessGranted","in"],
1858
+ ])
1859
+
1860
+ dll.add_function('ObjectPrivilegeAuditAlarmW', 'BOOL',[
1861
+ ["PWCHAR","SubsystemName","in"],
1862
+ ["PBLOB","HandleId","in"],
1863
+ ["DWORD","ClientToken","in"],
1864
+ ["DWORD","DesiredAccess","in"],
1865
+ ["PBLOB","Privileges","in"],
1866
+ ["BOOL","AccessGranted","in"],
1867
+ ])
1868
+
1869
+ dll.add_function('OpenBackupEventLogA', 'DWORD',[
1870
+ ["PCHAR","lpUNCServerName","in"],
1871
+ ["PCHAR","lpFileName","in"],
1872
+ ])
1873
+
1874
+ dll.add_function('OpenBackupEventLogW', 'DWORD',[
1875
+ ["PWCHAR","lpUNCServerName","in"],
1876
+ ["PWCHAR","lpFileName","in"],
1877
+ ])
1878
+
1879
+ dll.add_function('OpenEncryptedFileRawA', 'DWORD',[
1880
+ ["PCHAR","lpFileName","in"],
1881
+ ["DWORD","ulFlags","in"],
1882
+ ["PBLOB","pvContext","out"],
1883
+ ])
1884
+
1885
+ dll.add_function('OpenEncryptedFileRawW', 'DWORD',[
1886
+ ["PWCHAR","lpFileName","in"],
1887
+ ["DWORD","ulFlags","in"],
1888
+ ["PBLOB","pvContext","out"],
1889
+ ])
1890
+
1891
+ dll.add_function('OpenEventLogA', 'DWORD',[
1892
+ ["PCHAR","lpUNCServerName","in"],
1893
+ ["PCHAR","lpSourceName","in"],
1894
+ ])
1895
+
1896
+ dll.add_function('OpenEventLogW', 'DWORD',[
1897
+ ["PWCHAR","lpUNCServerName","in"],
1898
+ ["PWCHAR","lpSourceName","in"],
1899
+ ])
1900
+
1901
+ dll.add_function('OpenProcessToken', 'BOOL',[
1902
+ ["DWORD","ProcessHandle","in"],
1903
+ ["DWORD","DesiredAccess","in"],
1904
+ ["PDWORD","TokenHandle","out"],
1905
+ ])
1906
+
1907
+ dll.add_function('OpenThreadToken', 'BOOL',[
1908
+ ["DWORD","ThreadHandle","in"],
1909
+ ["DWORD","DesiredAccess","in"],
1910
+ ["BOOL","OpenAsSelf","in"],
1911
+ ["PDWORD","TokenHandle","out"],
1912
+ ])
1913
+
1914
+ dll.add_function('PrivilegeCheck', 'BOOL',[
1915
+ ["DWORD","ClientToken","in"],
1916
+ ["PBLOB","RequiredPrivileges","inout"],
1917
+ ["PBLOB","pfResult","out"],
1918
+ ])
1919
+
1920
+ dll.add_function('PrivilegedServiceAuditAlarmA', 'BOOL',[
1921
+ ["PCHAR","SubsystemName","in"],
1922
+ ["PCHAR","ServiceName","in"],
1923
+ ["DWORD","ClientToken","in"],
1924
+ ["PBLOB","Privileges","in"],
1925
+ ["BOOL","AccessGranted","in"],
1926
+ ])
1927
+
1928
+ dll.add_function('PrivilegedServiceAuditAlarmW', 'BOOL',[
1929
+ ["PWCHAR","SubsystemName","in"],
1930
+ ["PWCHAR","ServiceName","in"],
1931
+ ["DWORD","ClientToken","in"],
1932
+ ["PBLOB","Privileges","in"],
1933
+ ["BOOL","AccessGranted","in"],
1934
+ ])
1935
+
1936
+ dll.add_function('ReadEncryptedFileRaw', 'DWORD',[
1937
+ ["PBLOB","pfExportCallback","in"],
1938
+ ["PBLOB","pvCallbackContext","in"],
1939
+ ["PBLOB","pvContext","in"],
1940
+ ])
1941
+
1942
+ dll.add_function('ReadEventLogA', 'BOOL',[
1943
+ ["DWORD","hEventLog","in"],
1944
+ ["DWORD","dwReadFlags","in"],
1945
+ ["DWORD","dwRecordOffset","in"],
1946
+ ["PBLOB","lpBuffer","out"],
1947
+ ["DWORD","nNumberOfBytesToRead","in"],
1948
+ ["PDWORD","pnBytesRead","out"],
1949
+ ["PDWORD","pnMinNumberOfBytesNeeded","out"],
1950
+ ])
1951
+
1952
+ dll.add_function('ReadEventLogW', 'BOOL',[
1953
+ ["DWORD","hEventLog","in"],
1954
+ ["DWORD","dwReadFlags","in"],
1955
+ ["DWORD","dwRecordOffset","in"],
1956
+ ["PBLOB","lpBuffer","out"],
1957
+ ["DWORD","nNumberOfBytesToRead","in"],
1958
+ ["PDWORD","pnBytesRead","out"],
1959
+ ["PDWORD","pnMinNumberOfBytesNeeded","out"],
1960
+ ])
1961
+
1962
+ dll.add_function('RegisterEventSourceA', 'DWORD',[
1963
+ ["PCHAR","lpUNCServerName","in"],
1964
+ ["PCHAR","lpSourceName","in"],
1965
+ ])
1966
+
1967
+ dll.add_function('RegisterEventSourceW', 'DWORD',[
1968
+ ["PWCHAR","lpUNCServerName","in"],
1969
+ ["PWCHAR","lpSourceName","in"],
1970
+ ])
1971
+
1972
+ dll.add_function('ReportEventA', 'BOOL',[
1973
+ ["DWORD","hEventLog","in"],
1974
+ ["WORD","wType","in"],
1975
+ ["WORD","wCategory","in"],
1976
+ ["DWORD","dwEventID","in"],
1977
+ ["LPVOID","lpUserSid","in"],
1978
+ ["WORD","wNumStrings","in"],
1979
+ ["DWORD","dwDataSize","in"],
1980
+ ["PBLOB","lpStrings","in"],
1981
+ ["PBLOB","lpRawData","in"],
1982
+ ])
1983
+
1984
+ dll.add_function('ReportEventW', 'BOOL',[
1985
+ ["DWORD","hEventLog","in"],
1986
+ ["WORD","wType","in"],
1987
+ ["WORD","wCategory","in"],
1988
+ ["DWORD","dwEventID","in"],
1989
+ ["LPVOID","lpUserSid","in"],
1990
+ ["WORD","wNumStrings","in"],
1991
+ ["DWORD","dwDataSize","in"],
1992
+ ["PBLOB","lpStrings","in"],
1993
+ ["PBLOB","lpRawData","in"],
1994
+ ])
1995
+
1996
+ dll.add_function('RevertToSelf', 'BOOL',[
1997
+ ])
1998
+
1999
+ dll.add_function('SetAclInformation', 'BOOL',[
2000
+ ["PBLOB","pAcl","inout"],
2001
+ ["PBLOB","pAclInformation","in"],
2002
+ ["DWORD","nAclInformationLength","in"],
2003
+ ["DWORD","dwAclInformationClass","in"],
2004
+ ])
2005
+
2006
+ dll.add_function('SetFileSecurityA', 'BOOL',[
2007
+ ["PCHAR","lpFileName","in"],
2008
+ ["PBLOB","SecurityInformation","in"],
2009
+ ["PBLOB","pSecurityDescriptor","in"],
2010
+ ])
2011
+
2012
+ dll.add_function('SetFileSecurityW', 'BOOL',[
2013
+ ["PWCHAR","lpFileName","in"],
2014
+ ["PBLOB","SecurityInformation","in"],
2015
+ ["PBLOB","pSecurityDescriptor","in"],
2016
+ ])
2017
+
2018
+ dll.add_function('SetKernelObjectSecurity', 'BOOL',[
2019
+ ["DWORD","Handle","in"],
2020
+ ["PBLOB","SecurityInformation","in"],
2021
+ ["PBLOB","SecurityDescriptor","in"],
2022
+ ])
2023
+
2024
+ dll.add_function('SetPrivateObjectSecurity', 'BOOL',[
2025
+ ["PBLOB","SecurityInformation","in"],
2026
+ ["PBLOB","ModificationDescriptor","in"],
2027
+ ["PBLOB","ObjectsSecurityDescriptor","inout"],
2028
+ ["PBLOB","GenericMapping","in"],
2029
+ ["DWORD","Token","in"],
2030
+ ])
2031
+
2032
+ dll.add_function('SetPrivateObjectSecurityEx', 'BOOL',[
2033
+ ["PBLOB","SecurityInformation","in"],
2034
+ ["PBLOB","ModificationDescriptor","in"],
2035
+ ["PBLOB","ObjectsSecurityDescriptor","inout"],
2036
+ ["DWORD","AutoInheritFlags","in"],
2037
+ ["PBLOB","GenericMapping","in"],
2038
+ ["DWORD","Token","in"],
2039
+ ])
2040
+
2041
+ dll.add_function('SetSecurityDescriptorControl', 'BOOL',[
2042
+ ["PBLOB","pSecurityDescriptor","in"],
2043
+ ["WORD","ControlBitsOfInterest","in"],
2044
+ ["WORD","ControlBitsToSet","in"],
2045
+ ])
2046
+
2047
+ dll.add_function('SetSecurityDescriptorDacl', 'BOOL',[
2048
+ ["PBLOB","pSecurityDescriptor","inout"],
2049
+ ["BOOL","bDaclPresent","in"],
2050
+ ["PBLOB","pDacl","in"],
2051
+ ["BOOL","bDaclDefaulted","in"],
2052
+ ])
2053
+
2054
+ dll.add_function('SetSecurityDescriptorGroup', 'BOOL',[
2055
+ ["PBLOB","pSecurityDescriptor","inout"],
2056
+ ["PBLOB","pGroup","in"],
2057
+ ["BOOL","bGroupDefaulted","in"],
2058
+ ])
2059
+
2060
+ dll.add_function('SetSecurityDescriptorOwner', 'BOOL',[
2061
+ ["PBLOB","pSecurityDescriptor","inout"],
2062
+ ["PBLOB","pOwner","in"],
2063
+ ["BOOL","bOwnerDefaulted","in"],
2064
+ ])
2065
+
2066
+ dll.add_function('SetSecurityDescriptorRMControl', 'DWORD',[
2067
+ ["PBLOB","SecurityDescriptor","inout"],
2068
+ ["PBLOB","RMControl","in"],
2069
+ ])
2070
+
2071
+ dll.add_function('SetSecurityDescriptorSacl', 'BOOL',[
2072
+ ["PBLOB","pSecurityDescriptor","inout"],
2073
+ ["BOOL","bSaclPresent","in"],
2074
+ ["PBLOB","pSacl","in"],
2075
+ ["BOOL","bSaclDefaulted","in"],
2076
+ ])
2077
+
2078
+ dll.add_function('SetThreadToken', 'BOOL',[
2079
+ ["PDWORD","Thread","in"],
2080
+ ["DWORD","Token","in"],
2081
+ ])
2082
+
2083
+ dll.add_function('SetTokenInformation', 'BOOL',[
2084
+ ["DWORD","TokenHandle","in"],
2085
+ ["DWORD","TokenInformationClass","in"],
2086
+ ["PBLOB","TokenInformation","in"],
2087
+ ["DWORD","TokenInformationLength","in"],
2088
+ ])
2089
+
2090
+ dll.add_function('WriteEncryptedFileRaw', 'DWORD',[
2091
+ ["PBLOB","pfImportCallback","in"],
2092
+ ["PBLOB","pvCallbackContext","in"],
2093
+ ["PBLOB","pvContext","in"],
2094
+ ])
2095
+
2096
+ return dll
2097
+ end
2098
+ end
2099
+
2100
+ end; end; end; end; end; end; end
2101
+
2102
+