Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

EasyHook.xml 118 KiB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146
  1. <?xml version="1.0"?>
  2. <doc>
  3. <assembly>
  4. <name>EasyHook</name>
  5. </assembly>
  6. <members>
  7. <member name="T:EasyHook.COMClassInfo">
  8. <summary>
  9. <para>A helper class for determining the address of COM object functions for hooking given a COM class id (CLSID) and COM interface id (IID), or COM class type and COM interface type.</para>
  10. </summary>
  11. <example>
  12. The following three examples result in the same output:
  13. <code>
  14. // 1. Use imported Class and Interface Types
  15. COMClassInfo cci1 = new COMClassInfo(typeof(CLSID_DirectInputDevice8), typeof(IID_IDirectInputDevice8W), "GetCapabilities");
  16. // 2. Use Guid from class and interface types
  17. COMClassInfo cci2 = new COMClassInfo(typeof(CLSID_DirectInputDevice8).GUID, typeof(IID_IDirectInputDevice8W).GUID, 3);
  18. // 3. Use class and interface Guids directly (no need to have class and interface types defined)
  19. COMClassInfo cci3 = new COMClassInfo(new Guid("25E609E5-B259-11CF-BFC7-444553540000"), new Guid("54D41081-DC15-4833-A41B-748F73A38179"), 3);
  20. // Will output False if dinput8.dll is not already loaded
  21. Console.WriteLine(cci1.IsModuleLoaded());
  22. cci1.Query();
  23. cci2.Query();
  24. cci3.Query();
  25. // Will output True as dinput8.dll will be loaded by .Query() if not already
  26. Console.WriteLine(cci1.IsModuleLoaded());
  27. // Output the function pointers we queried
  28. Console.WriteLine(cci1.FunctionPointers[0]);
  29. Console.WriteLine(cci2.FunctionPointers[0]);
  30. Console.WriteLine(cci3.FunctionPointers[0]);
  31. ...
  32. [ComVisible(true)]
  33. [Guid("25E609E5-B259-11CF-BFC7-444553540000")]
  34. public class CLSID_DirectInputDevice8
  35. {
  36. }
  37. [ComVisible(true)]
  38. [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
  39. [Guid("54D41081-DC15-4833-A41B-748F73A38179")]
  40. public interface IID_IDirectInputDevice8W
  41. {
  42. /*** IDirectInputDevice8W methods ***/
  43. int GetCapabilities(IntPtr deviceCaps); // fourth method due to IUnknown methods QueryInterface, AddRef and Release
  44. // other methods...
  45. }
  46. </code>
  47. </example>
  48. </member>
  49. <member name="M:EasyHook.COMClassInfo.#ctor(System.Type,System.Type,System.String[])">
  50. <summary>
  51. Creates a new COMClassInfo using the COM class and interface types. The function names to retrieve the addresses for should be provided as strings
  52. </summary>
  53. <param name="classtype">The COM object's class type</param>
  54. <param name="interfacetype">The COM object's interface type</param>
  55. <param name="methodNames">The methods to retrieve addresses for</param>
  56. </member>
  57. <member name="M:EasyHook.COMClassInfo.#ctor(System.Guid,System.Guid,System.Int32[])">
  58. <summary>
  59. Creates a new COMClassInfo instance using the COM class and interface Guids. The function indexes to retrieve the addresses for as defined by the order of the methods in the COM interface.
  60. </summary>
  61. <param name="clsid">The class id (CLSID) of the COM object</param>
  62. <param name="iid">The interface id (IID) of the COM interface. This interface MUST inherit from IUnknown.</param>
  63. <param name="vTableIndexes">One or more method indexes to retrieve the address for. Index 0 == QueryInterface, 1 == AddRef, 2 == Release, 3 == first method and so on, i.e. the order that the methods appear in the interface's C++ header file.</param>
  64. </member>
  65. <member name="P:EasyHook.COMClassInfo.MethodPointers">
  66. <summary>
  67. Will contain the method addresses after a call to <see cref="M:EasyHook.COMClassInfo.Query"/>. The index corresponds to the order method names / indexes are passed into <see cref="M:EasyHook.COMClassInfo.#ctor(System.Type,System.Type,System.String[])"/> or <see cref="M:EasyHook.COMClassInfo.#ctor(System.Guid,System.Guid,System.Int32[])"/>.
  68. </summary>
  69. </member>
  70. <member name="P:EasyHook.COMClassInfo.LibraryOfFunction">
  71. <summary>
  72. Retrieve the module for the COM class. Only available after a call to <see cref="M:EasyHook.COMClassInfo.Query"/>.
  73. </summary>
  74. </member>
  75. <member name="M:EasyHook.COMClassInfo.Query">
  76. <summary>
  77. Query the COM class for the specified method addresses. If not already loaded the COM module will be loaded.
  78. </summary>
  79. <returns>True if the COM class exists, False otherwise.</returns>
  80. <exception cref="T:System.AccessViolationException">Thrown if the method index extends beyond the interface and into protected memory.</exception>
  81. <exception cref="T:System.ArgumentException">If the provided interface type is not an interface, or the class type is not visible to COM.</exception>
  82. <exception cref="T:System.InvalidCastException">Thrown if the class instance does not support the specified interface.</exception>
  83. </member>
  84. <member name="M:EasyHook.COMClassInfo.IsModuleLoaded">
  85. <summary>
  86. Determines if the module containing the COM class is already loaded
  87. </summary>
  88. <returns>True if the module is loaded, otherwise False</returns>
  89. </member>
  90. <member name="T:EasyHook.Config">
  91. <summary>
  92. Currently only provides a mechanism to register assemblies in the GAC.
  93. </summary>
  94. <remarks>
  95. The following demonstrates how to use <see cref="T:EasyHook.RemoteHooking" /> and <see cref="T:EasyHook.Config" />:
  96. <code>
  97. using System;
  98. using System.Collections.Generic;
  99. using System.Runtime.Remoting;
  100. using System.Text;
  101. using System.IO;
  102. using EasyHook;
  103. namespace FileMon
  104. {
  105. public class FileMonInterface : MarshalByRefObject
  106. {
  107. public void IsInstalled(Int32 InClientPID)
  108. {
  109. Console.WriteLine("FileMon has been installed in target {0}.\r\n", InClientPID);
  110. }
  111. public void OnCreateFile(Int32 InClientPID, String[] InFileNames)
  112. {
  113. for (int i = 0; i &lt; InFileNames.Length; i++)
  114. {
  115. Console.WriteLine(InFileNames[i]);
  116. }
  117. }
  118. public void ReportException(Exception InInfo)
  119. {
  120. Console.WriteLine("The target process has reported an error:\r\n" + InInfo.ToString());
  121. }
  122. public void Ping()
  123. {
  124. }
  125. }
  126. class Program
  127. {
  128. static String ChannelName = null;
  129. static void Main(string[] args)
  130. {
  131. try
  132. {
  133. Config.Register(
  134. "A FileMon like demo application.",
  135. "FileMon.exe",
  136. "FileMonInject.dll");
  137. RemoteHooking.IpcCreateServer&lt;FileMonInterface&gt;(ref ChannelName, WellKnownObjectMode.SingleCall);
  138. RemoteHooking.Inject(
  139. Int32.Parse(args[0]),
  140. "FileMonInject.dll",
  141. "FileMonInject.dll",
  142. ChannelName);
  143. Console.ReadLine();
  144. }
  145. catch (Exception ExtInfo)
  146. {
  147. Console.WriteLine("There was an error while connecting to target:\r\n{0}", ExtInfo.ToString());
  148. }
  149. }
  150. }
  151. }
  152. </code>
  153. </remarks>
  154. </member>
  155. <member name="P:EasyHook.Config.DependencyPath">
  156. <summary>
  157. The path where dependant files, like EasyHook(32|64)Svc.exe are stored.
  158. Defaults to no path being specified.
  159. </summary>
  160. </member>
  161. <member name="P:EasyHook.Config.HelperLibraryLocation">
  162. <summary>
  163. The path where helper files, like EasyHook(32|64).dll are stored.
  164. Defaults to the location of the assembly containing the Config type
  165. </summary>
  166. </member>
  167. <member name="M:EasyHook.Config.GetProcessPath">
  168. <summary>
  169. Get the directory name of the current process, ending with a backslash.
  170. </summary>
  171. <returns>Directory name of the current process</returns>
  172. </member>
  173. <member name="M:EasyHook.Config.GetSvcExecutableName">
  174. <summary>
  175. Get the name of the EasyHook SVC executable.
  176. Automatically determine whether to use the 64-bit or the 32-bit version.
  177. </summary>
  178. <returns>Executable name</returns>
  179. </member>
  180. <member name="M:EasyHook.Config.GetWOW64BypassExecutableName">
  181. <summary>
  182. Get the name of the EasyHook SVC executable to use for WOW64 bypass.
  183. If this process is 64-bit, return the 32-bit service executable and vice versa.
  184. </summary>
  185. <returns></returns>
  186. </member>
  187. <member name="M:EasyHook.Config.GetDependantSvcExecutableName">
  188. <summary>
  189. Get the EasyHook SVC executable name with the custom dependency path prepended.
  190. </summary>
  191. <returns>Full path to the executable</returns>
  192. </member>
  193. <member name="M:EasyHook.Config.Register(System.String,System.String[])">
  194. <summary>
  195. REQUIRES ADMIN PRIVILEGES. Installs EasyHook and all given user NET assemblies into the GAC and
  196. ensures that all references are cleaned up if the installing application
  197. is shutdown. Cleanup does not depend on the calling application...
  198. </summary>
  199. <remarks>
  200. <para>
  201. ATTENTION: There are some problems when debugging processes whose libraries
  202. are added to the GAC. Visual Studio won't start the debug session! There is
  203. only one chance for you to workaround this issue if you want to install
  204. libraries AND debug them simultanously. This is simply to debug only one process
  205. which is the default setting of Visual Studio. Because the libraries are added
  206. to the GAC AFTER Visual Studio has initialized the debug session, there won't be
  207. any conflicts; at least so far...
  208. </para><para>
  209. In debug versions of EasyHook, you may also check the "Application" event log, which holds additional information
  210. about the GAC registration, after calling this method. In general this method works
  211. transactionally. This means if something goes wrong, the GAC state of all related libraries
  212. won't be violated!
  213. </para><para>
  214. The problem with NET assemblies is that the CLR only searches the GAC and
  215. directories starting with the application base directory for assemblies.
  216. To get injected assemblies working either all of them have to be located
  217. under the target base directory (which is not suitable in most cases) or
  218. reside in the GAC.
  219. </para><para>
  220. EasyHook provides a way to automatically register all of its own assemblies
  221. and custom ones temporarily in the GAC. It also ensures
  222. that all of these assemblies are removed if the installing process exists.
  223. So you don't need to care about and may write applications according to
  224. the XCOPY standard. If your application ships with an installer, you may
  225. statically install all of your assemblies and the ones of EasyHook into the
  226. GAC. In this case just don't call <see cref="M:EasyHook.Config.Register(System.String,System.String[])"/>.
  227. </para><para>
  228. Of course EasyHook does also take care of multiple processes using the same
  229. injection libraries. So if two processes are sharing some of those DLLs,
  230. a stable reference counter ensures that the libraries are kept in the GAC
  231. if one process is terminated while the other continues running and so continues
  232. holding a proper GAC reference.
  233. </para><para>
  234. Please note that in order to add your library to the GAC, it has to be a valid
  235. NET assembly and expose a so called "Strong Name". Assemblies without a strong
  236. name will be rejected by this method!
  237. </para>
  238. </remarks>
  239. <param name="InDescription">
  240. A description under which the installed files should be referenced.
  241. </param>
  242. <param name="InUserAssemblies">
  243. A list of user assemblies as relative or absolute paths.
  244. </param>
  245. <exception cref="T:System.IO.FileNotFoundException">
  246. At least one of the files specified could not be found!
  247. </exception>
  248. <exception cref="T:System.BadImageFormatException">
  249. Unable to load at least one of the given files for reflection.
  250. </exception>
  251. <exception cref="T:System.ArgumentException">
  252. At least one of the given files does not have a strong name.
  253. </exception>
  254. </member>
  255. <member name="T:EasyHook.LocalHook">
  256. <summary>
  257. This class will provide various static members to be used with local hooking and
  258. is also the instance class of a hook.
  259. </summary>
  260. <remarks>
  261. The following demonstrates how to use <see cref="T:EasyHook.LocalHook" />:
  262. <code>
  263. using System;
  264. using System.Collections.Generic;
  265. using System.Text;
  266. using System.Threading;
  267. using System.Runtime.InteropServices;
  268. using EasyHook;
  269. namespace FileMonInject
  270. {
  271. public class Main : EasyHook.IEntryPoint
  272. {
  273. FileMon.FileMonInterface Interface;
  274. LocalHook CreateFileHook;
  275. Stack&lt;String&gt; Queue = new Stack&lt;String&gt; ();
  276. public Main(
  277. RemoteHooking.IContext InContext,
  278. String InChannelName)
  279. {
  280. // connect to host...
  281. Interface = RemoteHooking.IpcConnectClient&lt;FileMon.FileMonInterface&gt;(InChannelName);
  282. // validate connection...
  283. Interface.Ping();
  284. }
  285. public void Run(
  286. RemoteHooking.IContext InContext,
  287. String InChannelName)
  288. {
  289. // install hook...
  290. try
  291. {
  292. CreateFileHook = LocalHook.Create(
  293. LocalHook.GetProcAddress("kernel32.dll", "CreateFileW"),
  294. new DCreateFile(CreateFile_Hooked),
  295. this);
  296. CreateFileHook.ThreadACL.SetExclusiveACL(new Int32[] { 0 });
  297. }
  298. catch (Exception ExtInfo)
  299. {
  300. Interface.ReportException(ExtInfo);
  301. return;
  302. }
  303. Interface.IsInstalled(RemoteHooking.GetCurrentProcessId());
  304. RemoteHooking.WakeUpProcess();
  305. // wait for host process termination...
  306. try
  307. {
  308. while (true)
  309. {
  310. Thread.Sleep(500);
  311. // transmit newly monitored file accesses...
  312. if (Queue.Count &gt; 0)
  313. {
  314. String[] Package = null;
  315. lock (Queue)
  316. {
  317. Package = Queue.ToArray();
  318. Queue.Clear();
  319. }
  320. Interface.OnCreateFile(RemoteHooking.GetCurrentProcessId(), Package);
  321. }
  322. else
  323. Interface.Ping();
  324. }
  325. }
  326. catch
  327. {
  328. // Ping() will raise an exception if host is unreachable
  329. }
  330. }
  331. [UnmanagedFunctionPointer(CallingConvention.StdCall,
  332. CharSet = CharSet.Unicode,
  333. SetLastError = true)]
  334. delegate IntPtr DCreateFile(
  335. String InFileName,
  336. UInt32 InDesiredAccess,
  337. UInt32 InShareMode,
  338. IntPtr InSecurityAttributes,
  339. UInt32 InCreationDisposition,
  340. UInt32 InFlagsAndAttributes,
  341. IntPtr InTemplateFile);
  342. // just use a P-Invoke implementation to get native API access from C# (this step is not necessary for C++.NET)
  343. [DllImport("kernel32.dll",
  344. CharSet = CharSet.Unicode,
  345. SetLastError = true,
  346. CallingConvention = CallingConvention.StdCall)]
  347. static extern IntPtr CreateFile(
  348. String InFileName,
  349. UInt32 InDesiredAccess,
  350. UInt32 InShareMode,
  351. IntPtr InSecurityAttributes,
  352. UInt32 InCreationDisposition,
  353. UInt32 InFlagsAndAttributes,
  354. IntPtr InTemplateFile);
  355. // this is where we are intercepting all file accesses!
  356. static IntPtr CreateFile_Hooked(
  357. String InFileName,
  358. UInt32 InDesiredAccess,
  359. UInt32 InShareMode,
  360. IntPtr InSecurityAttributes,
  361. UInt32 InCreationDisposition,
  362. UInt32 InFlagsAndAttributes,
  363. IntPtr InTemplateFile)
  364. {
  365. try
  366. {
  367. Main This = (Main)HookRuntimeInfo.Callback;
  368. lock (This.Queue)
  369. {
  370. This.Queue.Push("[" + RemoteHooking.GetCurrentProcessId() + ":" +
  371. RemoteHooking.GetCurrentThreadId() + "]: \"" + InFileName + "\"");
  372. }
  373. }
  374. catch
  375. {
  376. }
  377. // call original API...
  378. return CreateFile(
  379. InFileName,
  380. InDesiredAccess,
  381. InShareMode,
  382. InSecurityAttributes,
  383. InCreationDisposition,
  384. InFlagsAndAttributes,
  385. InTemplateFile);
  386. }
  387. }
  388. }
  389. </code>
  390. </remarks>
  391. </member>
  392. <member name="M:EasyHook.LocalHook.EnableRIPRelocation">
  393. <summary>
  394. RIP relocation is disabled by default. If you want to enable it,
  395. just call this method which will attach a debugger to the current
  396. process. There may be circumstances under which this might fail
  397. and this is why it is not done by default. On 32-Bit system this
  398. method will always succeed and do nothing...
  399. </summary>
  400. </member>
  401. <member name="M:EasyHook.LocalHook.GetThreadIdByHandle(System.IntPtr)">
  402. <summary>
  403. Tries to get the underlying thread ID for a given handle.
  404. </summary>
  405. <remarks>
  406. This is not always possible. The handle has to be opened with <c>THREAD_QUERY_INFORMATION</c>
  407. access.
  408. </remarks>
  409. <param name="InThreadHandle">A valid thread handle.</param>
  410. <returns>A valid thread ID associated with the given thread handle.</returns>
  411. <exception cref="T:System.AccessViolationException">
  412. The given handle was not opened with <c>THREAD_QUERY_INFORMATION</c> access.</exception>
  413. <exception cref="T:System.ArgumentException">
  414. The handle is invalid.
  415. </exception>
  416. <exception cref="T:System.NotSupportedException">
  417. Should never occur and just notifies you that a handle to thread ID conversion is not
  418. available on the current platform.
  419. </exception>
  420. </member>
  421. <member name="M:EasyHook.LocalHook.GetProcessIdByHandle(System.IntPtr)">
  422. <summary>
  423. Tries to get the underlying process ID for a given handle.
  424. </summary>
  425. <remarks>
  426. This is not always possible. The handle has to be opened with <c>PROCESS_QUERY_INFORMATION</c>
  427. access.
  428. </remarks>
  429. <param name="InProcessHandle">A valid process handle.</param>
  430. <returns>A valid process ID associated with the given process handle.</returns>
  431. <exception cref="T:System.AccessViolationException">
  432. The given handle was not opened with <c>PROCESS_QUERY_INFORMATION</c> access.</exception>
  433. <exception cref="T:System.ArgumentException">
  434. The handle is invalid.
  435. </exception>
  436. <exception cref="T:System.NotSupportedException">
  437. Should never occur and just notifies you that a handle to thread ID conversion is not
  438. available on the current platform.
  439. </exception>
  440. </member>
  441. <member name="M:EasyHook.LocalHook.GetNameByHandle(System.IntPtr)">
  442. <summary>
  443. Reads the kernel object name for a given windows usermode handle.
  444. Executes in approx. 100 micro secounds.
  445. </summary>
  446. <remarks><para>
  447. This allows you to translate a handle back to the associated filename for example.
  448. But keep in mind that such names are only valid for kernel service routines, like
  449. <c>NtCreateFile</c>. You won't have success when calling <c>CreateFile</c> on such
  450. object names! The regular windows user mode API has some methods that will allow
  451. you to convert such kernelmode names back into usermode names. I know this because I did it
  452. some years ago but I've already forgotten how it has to be done! I can only give you
  453. some hints: <c>FindFirstVolume()</c>, <c>FindFirstVolumeMountPoint()</c>,
  454. <c>QueryDosDevice()</c>, <c>GetVolumePathNamesForVolumeName()</c>
  455. </para>
  456. <param name="InHandle">A valid usermode handle.</param>
  457. </remarks>
  458. <returns>The kernel object name associated with the given handle.</returns>
  459. <exception cref="T:System.ArgumentException">
  460. The given handle is invalid or could not be accessed for unknown reasons.
  461. </exception>
  462. </member>
  463. <member name="M:EasyHook.LocalHook.Finalize">
  464. <summary>
  465. Ensures that each instance is always terminated with <see cref="M:EasyHook.LocalHook.Dispose"/>.
  466. </summary>
  467. </member>
  468. <member name="P:EasyHook.LocalHook.Callback">
  469. <summary>
  470. The callback passed to <see cref="M:EasyHook.LocalHook.Create(System.IntPtr,System.Delegate,System.Object)"/>.
  471. </summary>
  472. </member>
  473. <member name="P:EasyHook.LocalHook.ThreadACL">
  474. <summary>
  475. Returns the thread ACL associated with this hook. Refer to <see cref="M:EasyHook.LocalHook.IsThreadIntercepted(System.Int32)"/>
  476. for more information about access negotiation.
  477. </summary>
  478. <exception cref="T:System.ObjectDisposedException">
  479. The underlying hook is already disposed.
  480. </exception>
  481. </member>
  482. <member name="P:EasyHook.LocalHook.HookBypassAddress">
  483. <summary>
  484. Returns the trampoline bypass address associated with this hook.
  485. </summary>
  486. <exception cref="T:System.ObjectDisposedException">
  487. The underlying hook has been disposed.
  488. </exception>
  489. </member>
  490. <member name="M:EasyHook.LocalHook.IsThreadIntercepted(System.Int32)">
  491. <summary>
  492. Checks whether a given thread ID will be intercepted by the underlying hook.
  493. </summary>
  494. <remarks>
  495. <para>
  496. This method provides an interface to the internal negotiation algorithm.
  497. You may use it to check whether your ACL provides expected results.
  498. </para><para>
  499. The following is a pseudo code of how this method is implemented:
  500. <code>
  501. if(InThreadID == 0)
  502. InThreadID = GetCurrentThreadId();
  503. if(GlobalACL.Contains(InThreadID))
  504. {
  505. if(LocalACL.Contains(InThreadID))
  506. {
  507. if(LocalACL.IsExclusive)
  508. return false;
  509. }
  510. else
  511. {
  512. if(GlobalACL.IsExclusive)
  513. return false;
  514. if(!LocalACL.IsExclusive)
  515. return false;
  516. }
  517. }
  518. else
  519. {
  520. if(LocalACL.Contains(InThreadID))
  521. {
  522. if(LocalACL.IsExclusive)
  523. return false;
  524. }
  525. else
  526. {
  527. if(!GlobalACL.IsExclusive)
  528. return false;
  529. if(!LocalACL.IsExclusive)
  530. return false;
  531. }
  532. }
  533. return true;
  534. </code>
  535. </para>
  536. </remarks>
  537. <param name="InThreadID">A native OS thread ID; or zero if you want to check the current thread.</param>
  538. <returns><c>true</c> if the thread is intercepted, <c>false</c> otherwise.</returns>
  539. <exception cref="T:System.ObjectDisposedException">
  540. The underlying hook is already disposed.
  541. </exception>
  542. </member>
  543. <member name="P:EasyHook.LocalHook.GlobalThreadACL">
  544. <summary>
  545. Returns the gloabl thread ACL associated with ALL hooks. Refer to <see cref="M:EasyHook.LocalHook.IsThreadIntercepted(System.Int32)"/>
  546. for more information about access negotiation.
  547. </summary>
  548. </member>
  549. <member name="M:EasyHook.LocalHook.Dispose">
  550. <summary>
  551. If you want to immediately uninstall a hook, the only way is to dispose it. A disposed
  552. hook is guaranteed to never invoke your handler again but may still consume
  553. memory even for process life-time!
  554. </summary>
  555. <remarks>
  556. As we are living in a manged world, you don't have to dispose a hook because the next
  557. garbage collection will do it for you, assuming that your code does not reference it
  558. anymore. But there are times when you want to uninstall it excplicitly, with no delay.
  559. If you dispose a disposed or not installed hook, nothing will happen!
  560. </remarks>
  561. </member>
  562. <member name="M:EasyHook.LocalHook.Create(System.IntPtr,System.Delegate,System.Object)">
  563. <summary>
  564. Installs a managed hook. After this you'll have to activate it by setting a proper <see cref="P:EasyHook.LocalHook.ThreadACL"/>.
  565. </summary>
  566. <remarks>
  567. <para>
  568. Note that not all entry points are hookable! In general methods like <c>CreateFileW</c>
  569. won't cause any trouble. But there might be methods that are not hookable because their
  570. entry point machine code is not eligable to be hooked. You should test all hooks on
  571. common environments like "Windows XP x86/x64 SP2/SP3" and "Windows Vista x86/x64 (SP1)".
  572. This is the only way to ensure that your application will work well on most machines.
  573. </para><para>
  574. Your handler delegate has to use the <see cref="T:System.Runtime.InteropServices.UnmanagedFunctionPointerAttribute"/> and
  575. shall map to the same native method signature, otherwise the application will crash! The best
  576. way is to use predefined delegates used in related P-Invoke implementations usually found with Google.
  577. If you know how to write such native delegates you won't need internet resources of course.
  578. I recommend using C++.NET which allows you to just copy the related windows API to your managed
  579. class and thread it as delegate without any changes. This will also speed up the whole thing
  580. because no unnecessary marshalling is required! C++.NET is also better in most cases because you
  581. may access the whole native windows API from managed code without any effort what significantly eases
  582. writing of hook handlers.
  583. </para>
  584. <para>
  585. The given delegate is automatically prevented from being garbage collected until the hook itself
  586. is collected...
  587. </para>
  588. </remarks>
  589. <param name="InTargetProc">A target entry point that should be hooked.</param>
  590. <param name="InNewProc">A handler with the same signature as the original entry point
  591. that will be invoked for every call that has passed the Fiber Deadlock Barrier and various integrity checks.</param>
  592. <param name="InCallback">An uninterpreted callback that will later be available through <see cref="P:EasyHook.HookRuntimeInfo.Callback"/>.</param>
  593. <returns>
  594. A handle to the newly created hook.
  595. </returns>
  596. <exception cref="T:System.OutOfMemoryException">
  597. Not enough memory available to complete the operation. On 64-Bit this may also indicate
  598. that no memory can be allocated within a 31-Bit boundary around the given entry point.
  599. </exception>
  600. <exception cref="T:System.ArgumentException">
  601. The given function pointer does not map to executable memory (valid machine code) or
  602. you passed <c>null</c> as delegate.
  603. </exception>
  604. <exception cref="T:System.NotSupportedException">
  605. The given entry point contains machine code that can not be hooked.
  606. </exception>
  607. <exception cref="T:System.InsufficientMemoryException">
  608. The maximum amount of hooks has been installed. This is currently set to MAX_HOOK_COUNT (1024).
  609. </exception>
  610. </member>
  611. <member name="M:EasyHook.LocalHook.CreateUnmanaged(System.IntPtr,System.IntPtr,System.IntPtr)">
  612. <summary>
  613. Installs an unmanaged hook. After this you'll have to activate it by setting a proper <see cref="P:EasyHook.LocalHook.ThreadACL"/>.
  614. <see cref="T:EasyHook.HookRuntimeInfo"/> WON'T be supported! Refer to the native "LhBarrierXxx" APIs to
  615. access unmanaged hook runtime information.
  616. </summary>
  617. <remarks>
  618. <para>
  619. Note that not all entry points are hookable! In general methods like <c>CreateFileW</c>
  620. won't cause any trouble. But there may be methods that are not hookable because their
  621. entry point machine code is not eligable to be hooked. You should test all hooks on
  622. common environments like "Windows XP x86/x64 SP1/SP2/SP3" and "Windows Vista x86/x64 (SP1)".
  623. This is the only way to ensure that your application will work well on most machines.
  624. </para><para>
  625. Unmanaged hooks will require a native DLL which handles the requests. This way
  626. you will get a high-performance interface, because
  627. a switch from unmanaged to managed code seems to be rather time consuming without doing anything
  628. useful (at least nothing visible); so a hook omitting this switch will be handled one or two
  629. orders of magnitudes faster until finally your handler gains execution. But as a managed hook is still executed
  630. within at last 1000 nano-seconds, even the "slow" managed implementation will be fast enough in most
  631. cases. With C++.NET you would be able to provide such native high-speed hooks for frequently
  632. called API methods, while still using managed ones for usual API methods, within a single assembly!
  633. A pure unmanaged, empty hook executes in approx. 70 nano-seconds, which is incredible fast
  634. considering the thread deadlock barrier and thread ACL negotiation that are already included in this benchmark!
  635. </para>
  636. </remarks>
  637. <param name="InTargetProc">A target entry point that should be hooked.</param>
  638. <param name="InNewProc">A handler with the same signature as the original entry point
  639. that will be invoked for every call that has passed the Thread Deadlock Barrier and various integrity checks.</param>
  640. <param name="InCallback">An uninterpreted callback that will later be available through <c>LhBarrierGetCallback()</c>.</param>
  641. <returns>
  642. A handle to the newly created hook.
  643. </returns>
  644. <exception cref="T:System.OutOfMemoryException">
  645. Not enough memory available to complete the operation. On 64-Bit this may also indicate
  646. that no memory can be allocated within a 31-Bit boundary around the given entry point.
  647. </exception>
  648. <exception cref="T:System.ArgumentException">
  649. The given function pointer does not map to executable memory (valid machine code) or
  650. you passed <c>null</c> as delegate.
  651. </exception>
  652. <exception cref="T:System.NotSupportedException">
  653. The given entry point contains machine code that can not be hooked.
  654. </exception>
  655. <exception cref="T:System.InsufficientMemoryException">
  656. The maximum amount of hooks has been installed. This is currently set to MAX_HOOK_COUNT (1024).
  657. </exception>
  658. </member>
  659. <member name="M:EasyHook.LocalHook.GetProcAddress(System.String,System.String)">
  660. <summary>
  661. Will return the address for a given DLL export symbol. The specified
  662. module has to be loaded into the current process space and also export
  663. the given method.
  664. </summary>
  665. <remarks>
  666. If you wonder how to get native entry points in a managed environment,
  667. this is the anwser. You will only be able to hook native code from a managed
  668. environment if you have access to a method like this, returning the native
  669. entry point. Please note that you will also hook any managed code, which
  670. of course ultimately relies on the native windows API!
  671. </remarks>
  672. <param name="InModule">A system DLL name like "kernel32.dll" or a full qualified path to any DLL.</param>
  673. <param name="InSymbolName">An exported symbol name like "CreateFileW".</param>
  674. <returns>The entry point for the given API method.</returns>
  675. <exception cref="T:System.DllNotFoundException">
  676. The given module is not loaded into the current process.
  677. </exception>
  678. <exception cref="T:System.MissingMethodException">
  679. The given module does not export the desired method.
  680. </exception>
  681. </member>
  682. <member name="M:EasyHook.LocalHook.GetProcDelegate``1(System.String,System.String)">
  683. <summary>
  684. Will return a delegate for a given DLL export symbol. The specified
  685. module has to be loaded into the current process space and also export
  686. the given method.
  687. </summary>
  688. <remarks><para>
  689. This method is usually not useful to hook something but it allows you
  690. to dynamically load native API methods into your managed environment instead
  691. of using the static P-Invoke approach provided by <see cref="T:System.Runtime.InteropServices.DllImportAttribute"/>.
  692. </para></remarks>
  693. <typeparam name="TDelegate">A delegate using the <see cref="T:System.Runtime.InteropServices.UnmanagedFunctionPointerAttribute"/> and
  694. exposing the same method signature as the specified native symbol.</typeparam>
  695. <param name="InModule">A system DLL name like "kernel32.dll" or a full qualified path to any DLL.</param>
  696. <param name="InSymbolName">An exported symbol name like "CreateFileW".</param>
  697. <returns>The managed delegate wrapping around the given native symbol.</returns>
  698. <exception cref="T:System.DllNotFoundException">
  699. The given module is not loaded into the current process.
  700. </exception>
  701. <exception cref="T:System.MissingMethodException">
  702. The given module does not export the given method.
  703. </exception>
  704. </member>
  705. <member name="M:EasyHook.LocalHook.Release">
  706. <summary>
  707. Processes any pending hook removals. Warning! This method can be quite slow (1 second) under certain circumstances.
  708. </summary>
  709. <see cref="M:EasyHook.NativeAPI.LhWaitForPendingRemovals"/>
  710. </member>
  711. <member name="T:EasyHook.InjectionLoader.HostConnectionData">
  712. <summary>
  713. Wraps the data needed for the connection to the host.
  714. </summary>
  715. </member>
  716. <member name="P:EasyHook.InjectionLoader.HostConnectionData.State">
  717. <summary>
  718. Gets the state of the current <see cref="T:EasyHook.InjectionLoader.HostConnectionData"/>.
  719. </summary>
  720. </member>
  721. <member name="P:EasyHook.InjectionLoader.HostConnectionData.UnmanagedInfo">
  722. <summary>
  723. Gets the unmanaged data containing the pointer to the memory block containing <see cref="P:EasyHook.InjectionLoader.HostConnectionData.RemoteInfo"/>;
  724. </summary>
  725. </member>
  726. <member name="M:EasyHook.InjectionLoader.HostConnectionData.LoadData(System.IntPtr)">
  727. <summary>
  728. Loads <see cref="T:EasyHook.InjectionLoader.HostConnectionData"/> from the <see cref="T:System.IntPtr"/> specified.
  729. </summary>
  730. <param name="unmanagedInfoPointer"></param>
  731. </member>
  732. <member name="T:EasyHook.InjectionLoader.AllowAllAssemblyVersionsDeserializationBinder">
  733. <summary>
  734. When not using the GAC, the BinaryFormatter fails to recognise the InParam
  735. when attempting to deserialise.
  736. A custom DeserializationBinder works around this (see http://spazzarama.com/2009/06/25/binary-deserialize-unable-to-find-assembly/)
  737. </summary>
  738. </member>
  739. <member name="M:EasyHook.InjectionLoader.LoadUserLibrary(System.String,System.String,System.Object[],EasyHook.HelperServiceInterface)">
  740. <summary>
  741. Loads the user library (trying the strong name first, then the file name),
  742. creates an instance for the <see cref="T:EasyHook.IEntryPoint"/> specified in the library
  743. and invokes the Run() method specified in that instance.
  744. </summary>
  745. <param name="userLibraryStrongName">The assembly strong name provided by the user, located in the global assembly cache.</param>
  746. <param name="userLibraryFileName">The assembly file name provided by the user to be loaded.</param>
  747. <param name="paramArray">Array of parameters to use with the constructor and with the Run() method. Note that all but the first parameter should be binary encoded.</param>
  748. <param name="helperServiceInterface"><see cref="T:EasyHook.HelperServiceInterface"/> to use for reporting to the host side.</param>
  749. <returns>The exit code to be returned by the main() method.</returns>
  750. </member>
  751. <member name="M:EasyHook.InjectionLoader.FindEntryPoint(System.String,System.String)">
  752. <summary>
  753. Finds the <see cref="T:EasyHook.IEntryPoint"/> in the specified <see cref="T:System.Reflection.Assembly"/>.
  754. </summary>
  755. <exception cref="T:System.EntryPointNotFoundException">
  756. An <see cref="T:System.EntryPointNotFoundException"/> is thrown if the given user library does not export a proper type implementing
  757. the <see cref="T:EasyHook.IEntryPoint"/> interface.
  758. </exception>
  759. <param name="userAssemblyStrongName">The strong name of the assembly provided by the user.</param>
  760. <param name="userAssemblyFileName">The file name of the assembly provided by the user.</param>
  761. <returns>The <see cref="T:System.Type"/> functioning as <see cref="T:EasyHook.IEntryPoint"/> for the user provided <see cref="T:System.Reflection.Assembly"/>.</returns>
  762. </member>
  763. <member name="M:EasyHook.InjectionLoader.FindMatchingMethod(System.Type,System.String,System.Object[])">
  764. <summary>
  765. Finds a user defined Run() method in the specified <see cref="T:System.Type"/> matching the specified <paramref name="paramArray"/>.
  766. </summary>
  767. <param name="methodName">Name of the method to search.</param>
  768. <param name="objectType"><see cref="T:System.Type"/> to extract the method from.</param>
  769. <param name="paramArray">Array of parameters to match to the method's defined parameters.</param>
  770. <returns><see cref="T:System.Reflection.MethodInfo"/> for the matching method, if any.</returns>
  771. </member>
  772. <member name="M:EasyHook.InjectionLoader.InitializeInstance(System.Type,System.Object[])">
  773. <summary>
  774. Initializes an instance from the specified <see cref="T:System.Type"/> using the specified <paramref name="parameters"/>.
  775. </summary>
  776. <param name="objectType"></param>
  777. <param name="parameters"></param>
  778. <returns></returns>
  779. </member>
  780. <member name="M:EasyHook.InjectionLoader.MethodMatchesParameters(System.Reflection.MethodBase,System.Object[])">
  781. <summary>
  782. Returns whether the specified <paramref name="paramArray"/> can be used as parameters when invoking the specified <paramref name="method"/>.
  783. </summary>
  784. <param name="method"></param>
  785. <param name="paramArray"></param>
  786. <returns></returns>
  787. </member>
  788. <member name="M:EasyHook.InjectionLoader.ConstructMissingMethodExceptionMessage(System.String,System.Object[])">
  789. <summary>
  790. Constructs a message for a <see cref="T:System.MissingMethodException"/> containing more specific information about the expected paramaters.
  791. </summary>
  792. <param name="methodName">Name of the missing method.</param>
  793. <param name="paramArray">Array of the expected parameters.</param>
  794. <returns></returns>
  795. </member>
  796. <member name="T:EasyHook.HookAccessControl">
  797. <summary>
  798. Provides a managed interface to the native thread ACLs.
  799. </summary>
  800. <remarks>
  801. Refer to the official guide to learn more about why thread ACLs are useful.
  802. They can be used to exclude/include dedicated threads from interception or to dynamically
  803. apply different kind of hooks to different threads. Even if you could do this
  804. in managed code, it is not that easy to implement and also EasyHook evaluates
  805. those ACLs in unmanaged code. So if any thread is not intercepted, it will never
  806. enter the manged environment what will speed up things about orders of magnitudes.
  807. </remarks>
  808. </member>
  809. <member name="P:EasyHook.HookAccessControl.IsExclusive">
  810. <summary>
  811. Is this ACL an exclusive one? Refer to <see cref="M:EasyHook.HookAccessControl.SetExclusiveACL(System.Int32[])"/> for more information.
  812. </summary>
  813. </member>
  814. <member name="P:EasyHook.HookAccessControl.IsInclusive">
  815. <summary>
  816. Is this ACL an inclusive one? Refer to <see cref="M:EasyHook.HookAccessControl.SetInclusiveACL(System.Int32[])"/> for more information.
  817. </summary>
  818. </member>
  819. <member name="M:EasyHook.HookAccessControl.SetInclusiveACL(System.Int32[])">
  820. <summary>
  821. Sets an inclusive ACL. This means all threads that are enumerated through <paramref name="InACL"/>
  822. are intercepted while all others are NOT. Of course this will overwrite the existing ACL.
  823. </summary>
  824. <remarks>
  825. Please note that this is not necessarily the final
  826. negotiation result. Refer to <see cref="M:EasyHook.LocalHook.IsThreadIntercepted(System.Int32)"/> for more information.
  827. In general inclusive ACLs will restrict exclusive ACLs while local ACLs will overwrite the
  828. global ACL.
  829. </remarks>
  830. <param name="InACL">Threads to be explicitly included in negotiation.</param>
  831. <exception cref="T:System.ArgumentException">
  832. The limit of 128 access entries is exceeded!
  833. </exception>
  834. </member>
  835. <member name="M:EasyHook.HookAccessControl.SetExclusiveACL(System.Int32[])">
  836. <summary>
  837. Sets an exclusive ACL. This means all threads that are enumerated through <paramref name="InACL"/>
  838. are NOT intercepted while all others are. Of course this will overwrite the existing ACL.
  839. </summary>
  840. <remarks>
  841. Please note that this is not necessarily the final
  842. negotiation result. Refer to <see cref="M:EasyHook.LocalHook.IsThreadIntercepted(System.Int32)"/> for more information.
  843. In general inclusive ACLs will restrict exclusive ACLs while local ACLs will overwrite the
  844. global ACL.
  845. </remarks>
  846. <param name="InACL">Threads to be explicitly included in negotiation.</param>
  847. <exception cref="T:System.ArgumentException">
  848. The limit of 128 access entries is exceeded!
  849. </exception>
  850. </member>
  851. <member name="M:EasyHook.HookAccessControl.GetEntries">
  852. <summary>
  853. Creates a copy of the internal thread list associated with this ACL. You may freely
  854. modify it without affecting the internal entries.
  855. </summary>
  856. <returns>
  857. A copy of the internal thread entries.
  858. </returns>
  859. </member>
  860. <member name="T:EasyHook.HookRuntimeInfo">
  861. <summary>
  862. This class is intended to be used within hook handlers,
  863. to access associated runtime information.
  864. </summary>
  865. <remarks>
  866. Other hooking libraries on the market require that you keep track of
  867. such information yourself, what can be a burden.
  868. </remarks>
  869. </member>
  870. <member name="P:EasyHook.HookRuntimeInfo.IsHandlerContext">
  871. <summary>
  872. Is the current thread within a valid hook handler? This is only the case
  873. if your handler was called through the hooked entry point...
  874. Executes in max. one micro secound.
  875. </summary>
  876. </member>
  877. <member name="P:EasyHook.HookRuntimeInfo.Callback">
  878. <summary>
  879. The user callback initially passed to either <see cref="M:EasyHook.LocalHook.Create(System.IntPtr,System.Delegate,System.Object)"/> or <see cref="M:EasyHook.LocalHook.CreateUnmanaged(System.IntPtr,System.IntPtr,System.IntPtr)"/>.
  880. Executes in max. one micro secound.
  881. </summary>
  882. <exception cref="T:System.NotSupportedException"> The current thread is not within a valid hook handler. </exception>
  883. </member>
  884. <member name="P:EasyHook.HookRuntimeInfo.Handle">
  885. <summary>
  886. The hook handle initially returned by either <see cref="M:EasyHook.LocalHook.Create(System.IntPtr,System.Delegate,System.Object)"/> or <see cref="M:EasyHook.LocalHook.CreateUnmanaged(System.IntPtr,System.IntPtr,System.IntPtr)"/>.
  887. Executes in max. one micro secound.
  888. </summary>
  889. <exception cref="T:System.NotSupportedException"> The current thread is not within a valid hook handler. </exception>
  890. </member>
  891. <member name="M:EasyHook.HookRuntimeInfo.UpdateUnmanagedModuleList">
  892. <summary>
  893. Allows you to explicitly update the unmanaged module list which is required for
  894. <see cref="P:EasyHook.HookRuntimeInfo.CallingUnmanagedModule"/>, <see cref="P:EasyHook.HookRuntimeInfo.UnmanagedStackTrace"/> and <see cref="M:EasyHook.HookRuntimeInfo.PointerToModule(System.IntPtr)"/>.
  895. Normally this is not necessary, but if you hook a process that frequently loads/unloads modules, you
  896. may call this method in a <c>LoadLibrary</c> hook to always operate on the latest module list.
  897. </summary>
  898. </member>
  899. <member name="M:EasyHook.HookRuntimeInfo.PointerToModule(System.IntPtr)">
  900. <summary>
  901. Retrives the unmanaged module that contains the given pointer. If no module can be
  902. found, <c>null</c> is returned. This method will automatically update the unmanaged
  903. module list from time to time.
  904. Executes in less than one micro secound.
  905. </summary>
  906. <param name="InPointer"></param>
  907. <returns></returns>
  908. </member>
  909. <member name="P:EasyHook.HookRuntimeInfo.CallingUnmanagedModule">
  910. <summary>
  911. Determines the first unmanaged module on the current call stack. This is always the module
  912. that invoked the hook.
  913. Executes in max. 15 micro secounds.
  914. </summary>
  915. <remarks>
  916. The problem is that if the calling module is a NET assembly
  917. and invokes the hook through a P-Invoke binding, you will get
  918. "mscorwks.dll" as calling module and not the NET assembly. This is only an example
  919. but I think you got the idea. To solve this issue, refer to <see cref="P:EasyHook.HookRuntimeInfo.UnmanagedStackTrace"/>
  920. and <see cref="P:EasyHook.HookRuntimeInfo.ManagedStackTrace"/>!
  921. </remarks>
  922. </member>
  923. <member name="P:EasyHook.HookRuntimeInfo.CallingManagedModule">
  924. <summary>
  925. Determines the first managed module on the current call stack. This is always the module
  926. that invoked the hook.
  927. Executes in max. 40 micro secounds.
  928. </summary>
  929. <remarks>
  930. Imagine your hook targets CreateFile. A NET assembly will now invoke this hook through
  931. FileStream, for example. But because System.IO.FileStream invokes the hook, you will
  932. get "System.Core" as calling module and not the desired assembly.
  933. To solve this issue, refer to <see cref="P:EasyHook.HookRuntimeInfo.UnmanagedStackTrace"/>
  934. and <see cref="P:EasyHook.HookRuntimeInfo.ManagedStackTrace"/>!
  935. </remarks>
  936. </member>
  937. <member name="P:EasyHook.HookRuntimeInfo.ReturnAddress">
  938. <summary>
  939. Returns the address where execution is continued, after you hook has
  940. been completed. This is always the instruction behind the hook invokation.
  941. Executes in max. one micro secound.
  942. </summary>
  943. </member>
  944. <member name="P:EasyHook.HookRuntimeInfo.AddressOfReturnAddress">
  945. <summary>
  946. A stack address pointing to <see cref="P:EasyHook.HookRuntimeInfo.ReturnAddress"/>.
  947. Executes in max. one micro secound.
  948. </summary>
  949. </member>
  950. <member name="P:EasyHook.HookRuntimeInfo.UnmanagedStackTrace">
  951. <summary>
  952. Creates a call stack trace of the unmanaged code path that finally
  953. lead to your hook. To detect whether the desired module is within the
  954. call stack you will have to walk through the whole list!
  955. Executes in max. 20 micro secounds.
  956. </summary>
  957. <remarks>
  958. This method is not supported on Windows 2000 and will just return the
  959. calling unmanaged module wrapped in an array on that platform.
  960. </remarks>
  961. </member>
  962. <member name="P:EasyHook.HookRuntimeInfo.ManagedStackTrace">
  963. <summary>
  964. Creates a call stack trace of the managed code path that finally
  965. lead to your hook. To detect whether the desired module is within the
  966. call stack you will have to walk through the whole list!
  967. Executes in max. 80 micro secounds.
  968. </summary>
  969. </member>
  970. <member name="T:EasyHook.IEntryPoint">
  971. <summary>
  972. EasyHook will search in the injected user library for a class which implements
  973. this interface. You should only have one class exposing this interface, otherwise
  974. it is undefined which one will be chosen. See remarks for more details on how you should create this class.
  975. </summary>
  976. <remarks>
  977. <para>
  978. To implement this interface is not the only thing to do. The related class shall implement
  979. two methods. The first one is a constructor <c>ctor(IContext, ...)</c> which will let you initialize
  980. your library. You should immediately complete this call and only connect to your host
  981. application for further error reporting. This initialization method allows you to redirect
  982. all unhandled exceptions to your host application automatically. So even if all things in
  983. your library initialization would fail, you may still report exceptions! Such
  984. unhandled exceptions will be thrown by <see cref="M:EasyHook.RemoteHooking.Inject(System.Int32,EasyHook.InjectionOptions,System.String,System.String,System.Object[])"/> in your host. But
  985. make sure that you are using serializable exception objects only as all standard NET ones are,
  986. but not all custom ones. Otherwise you will only intercept a general exception with no specific
  987. information attached.
  988. </para><para>
  989. The second one is <c>Run(IContext, ...)</c> and should only exit/return when you want to unload your injected library.
  990. Unhandled exceptions WON'T be redirected automatically and are likely to crash the target process. As you are expected
  991. to connect to your host in the <c>ctor()</c>, you are now also expected to report errors by yourself.
  992. </para><para>
  993. The parameter list described by <c>(IContext, ...)</c> will always contain a <see cref="T:EasyHook.RemoteHooking.IContext"/>
  994. instance as the first parameter. All further parameters will depend on the arguments passed to <see cref="M:EasyHook.RemoteHooking.Inject(System.Int32,EasyHook.InjectionOptions,System.String,System.String,System.Object[])"/>
  995. at your injection host. <c>ctor()</c> and <c>Run()</c> must have the same custom parameter list
  996. as composed by the one passed to <c>Inject()</c>. Otherwise an exception will be thrown. For example
  997. if you call <see cref="M:EasyHook.RemoteHooking.Inject(System.Int32,EasyHook.InjectionOptions,System.String,System.String,System.Object[])"/> with <c>Inject(..., ..., ..., ..., "MyString1", "MyString2")</c>, you
  998. have supplied a custom argument list of the format <c>String, String</c> to <c>Inject</c>. This list
  999. will be converted to an object array and serialized. The injected library stub will later
  1000. deserialize this array and pass it to <c>ctor()</c> and <c>Run()</c>, both expected to have
  1001. a signature of <c>IContext, String, String</c> in our case. So <c>Run</c> will now be called with
  1002. <c>(IContext, "MyString1", "MyString2")</c>.
  1003. </para><para>
  1004. You should avoid using static fields or properties within such a class, as this might lead to
  1005. bugs in your code when multiple library instances are injected into the same target!
  1006. </para>
  1007. </remarks>
  1008. </member>
  1009. <member name="T:EasyHook.InjectionOptions">
  1010. <summary>
  1011. All supported options that will influence the way your library is injected.
  1012. </summary>
  1013. </member>
  1014. <member name="F:EasyHook.InjectionOptions.Default">
  1015. <summary>
  1016. Default injection procedure.
  1017. </summary>
  1018. </member>
  1019. <member name="F:EasyHook.InjectionOptions.NoService">
  1020. <summary>
  1021. Use of services is not permitted.
  1022. </summary>
  1023. </member>
  1024. <member name="F:EasyHook.InjectionOptions.NoWOW64Bypass">
  1025. <summary>
  1026. Use of WOW64 bypass is not permitted.
  1027. </summary>
  1028. </member>
  1029. <member name="F:EasyHook.InjectionOptions.DoNotRequireStrongName">
  1030. <summary>
  1031. Allow injection without a strong name (e.g. no GAC registration). This option requires that the full path to injected assembly be provided
  1032. </summary>
  1033. </member>
  1034. <member name="T:EasyHook.RemoteHooking">
  1035. <summary>
  1036. Provides all things related to library injection, inter-process-communication (IPC) and
  1037. helper routines for common remote tasks.
  1038. </summary>
  1039. <remarks>
  1040. The following demonstrates how to use <see cref="T:EasyHook.RemoteHooking" /> and <see cref="T:EasyHook.Config" />:
  1041. <code>
  1042. using System;
  1043. using System.Collections.Generic;
  1044. using System.Runtime.Remoting;
  1045. using System.Text;
  1046. using System.IO;
  1047. using EasyHook;
  1048. namespace FileMon
  1049. {
  1050. public class FileMonInterface : MarshalByRefObject
  1051. {
  1052. public void IsInstalled(Int32 InClientPID)
  1053. {
  1054. Console.WriteLine("FileMon has been installed in target {0}.\r\n", InClientPID);
  1055. }
  1056. public void OnCreateFile(Int32 InClientPID, String[] InFileNames)
  1057. {
  1058. for (int i = 0; i &lt; InFileNames.Length; i++)
  1059. {
  1060. Console.WriteLine(InFileNames[i]);
  1061. }
  1062. }
  1063. public void ReportException(Exception InInfo)
  1064. {
  1065. Console.WriteLine("The target process has reported an error:\r\n" + InInfo.ToString());
  1066. }
  1067. public void Ping()
  1068. {
  1069. }
  1070. }
  1071. class Program
  1072. {
  1073. static String ChannelName = null;
  1074. static void Main(string[] args)
  1075. {
  1076. try
  1077. {
  1078. Config.Register(
  1079. "A FileMon like demo application.",
  1080. "FileMon.exe",
  1081. "FileMonInject.dll");
  1082. RemoteHooking.IpcCreateServer&lt;FileMonInterface&gt;(ref ChannelName, WellKnownObjectMode.SingleCall);
  1083. RemoteHooking.Inject(
  1084. Int32.Parse(args[0]),
  1085. "FileMonInject.dll",
  1086. "FileMonInject.dll",
  1087. ChannelName);
  1088. Console.ReadLine();
  1089. }
  1090. catch (Exception ExtInfo)
  1091. {
  1092. Console.WriteLine("There was an error while connecting to target:\r\n{0}", ExtInfo.ToString());
  1093. }
  1094. }
  1095. }
  1096. }
  1097. </code>
  1098. </remarks>
  1099. </member>
  1100. <member name="T:EasyHook.RemoteHooking.IContext">
  1101. <summary>
  1102. A context contains some basic information about the environment
  1103. in which your library main method has been invoked. You will always
  1104. get an instance of this interface in your library <c>Run</c> method
  1105. and your library constructor.
  1106. </summary>
  1107. </member>
  1108. <member name="P:EasyHook.RemoteHooking.IContext.HostPID">
  1109. <summary>
  1110. Returns the process ID of the host that has injected this library.
  1111. </summary>
  1112. </member>
  1113. <member name="M:EasyHook.RemoteHooking.WakeUpProcess">
  1114. <summary>
  1115. If the library was injected with <see cref="M:EasyHook.RemoteHooking.CreateAndInject(System.String,System.String,System.Int32,EasyHook.InjectionOptions,System.String,System.String,System.Int32@,System.Object[])"/>, this will
  1116. finally start the current process. You should call this method in the library
  1117. <c>Run()</c> method after all hooks have been installed.
  1118. </summary>
  1119. </member>
  1120. <member name="P:EasyHook.RemoteHooking.IsAdministrator">
  1121. <summary>
  1122. <c>true</c> if we are running with administrative privileges, <c>false</c> otherwise.
  1123. </summary>
  1124. <remarks>
  1125. Due to UAC on Windows Vista, this property in general will be <c>false</c> even if the user is in
  1126. the builtin-admin group. As you can't hook without administrator privileges you
  1127. should just set the UAC level of your application to <c>requireAdministrator</c>.
  1128. </remarks>
  1129. </member>
  1130. <member name="M:EasyHook.RemoteHooking.IpcCreateServer``1(System.String@,System.Runtime.Remoting.WellKnownObjectMode,``0,System.Security.Principal.WellKnownSidType[])">
  1131. <summary>
  1132. Creates a globally reachable, managed IPC-Port.
  1133. </summary>
  1134. <remarks>
  1135. Because it is something tricky to get a port working for any constellation of
  1136. target processes, I decided to write a proper wrapper method. Just keep the returned
  1137. <see cref="T:System.Runtime.Remoting.Channels.Ipc.IpcChannel"/> alive, by adding it to a global list or static variable,
  1138. as long as you want to have the IPC port open.
  1139. </remarks>
  1140. <typeparam name="TRemoteObject">
  1141. A class derived from <see cref="T:System.MarshalByRefObject"/> which provides the
  1142. method implementations this server should expose.
  1143. </typeparam>
  1144. <param name="InObjectMode">
  1145. <see cref="F:System.Runtime.Remoting.WellKnownObjectMode.SingleCall"/> if you want to handle each call in an new
  1146. object instance, <see cref="F:System.Runtime.Remoting.WellKnownObjectMode.Singleton"/> otherwise. The latter will implicitly
  1147. allow you to use "static" remote variables.
  1148. </param>
  1149. <param name="RefChannelName">
  1150. Either <c>null</c> to let the method generate a random channel name to be passed to
  1151. <see cref="M:EasyHook.RemoteHooking.IpcConnectClient``1(System.String)"/> or a predefined one. If you pass a value unequal to
  1152. <c>null</c>, you shall also specify all SIDs that are allowed to connect to your channel!
  1153. </param>
  1154. <param name="ipcInterface">Provide a TRemoteObject object to be made available as a well known type on the server end of the channel.</param>
  1155. <param name="InAllowedClientSIDs">
  1156. If no SID is specified, all authenticated users will be allowed to access the server
  1157. channel by default. You must specify an SID if <paramref name="RefChannelName"/> is unequal to <c>null</c>.
  1158. </param>
  1159. <returns>
  1160. An <see cref="T:System.Runtime.Remoting.Channels.Ipc.IpcChannel"/> that shall be keept alive until the server is not needed anymore.
  1161. </returns>
  1162. <exception cref="T:System.Security.HostProtectionException">
  1163. If a predefined channel name is being used, you are required to specify a list of well known SIDs
  1164. which are allowed to access the newly created server.
  1165. </exception>
  1166. <exception cref="T:System.Runtime.Remoting.RemotingException">
  1167. The given channel name is already in use.
  1168. </exception>
  1169. </member>
  1170. <member name="M:EasyHook.RemoteHooking.IpcCreateServer``1(System.String@,System.Runtime.Remoting.WellKnownObjectMode,System.Security.Principal.WellKnownSidType[])">
  1171. <summary>
  1172. Creates a globally reachable, managed IPC-Port.
  1173. </summary>
  1174. <remarks>
  1175. Because it is something tricky to get a port working for any constellation of
  1176. target processes, I decided to write a proper wrapper method. Just keep the returned
  1177. <see cref="T:System.Runtime.Remoting.Channels.Ipc.IpcChannel"/> alive, by adding it to a global list or static variable,
  1178. as long as you want to have the IPC port open.
  1179. </remarks>
  1180. <typeparam name="TRemoteObject">
  1181. A class derived from <see cref="T:System.MarshalByRefObject"/> which provides the
  1182. method implementations this server should expose.
  1183. </typeparam>
  1184. <param name="InObjectMode">
  1185. <see cref="F:System.Runtime.Remoting.WellKnownObjectMode.SingleCall"/> if you want to handle each call in an new
  1186. object instance, <see cref="F:System.Runtime.Remoting.WellKnownObjectMode.Singleton"/> otherwise. The latter will implicitly
  1187. allow you to use "static" remote variables.
  1188. </param>
  1189. <param name="RefChannelName">
  1190. Either <c>null</c> to let the method generate a random channel name to be passed to
  1191. <see cref="M:EasyHook.RemoteHooking.IpcConnectClient``1(System.String)"/> or a predefined one. If you pass a value unequal to
  1192. <c>null</c>, you shall also specify all SIDs that are allowed to connect to your channel!
  1193. </param>
  1194. <param name="InAllowedClientSIDs">
  1195. If no SID is specified, all authenticated users will be allowed to access the server
  1196. channel by default. You must specify an SID if <paramref name="RefChannelName"/> is unequal to <c>null</c>.
  1197. </param>
  1198. <returns>
  1199. An <see cref="T:System.Runtime.Remoting.Channels.Ipc.IpcChannel"/> that shall be keept alive until the server is not needed anymore.
  1200. </returns>
  1201. <exception cref="T:System.Security.HostProtectionException">
  1202. If a predefined channel name is being used, you are required to specify a list of well known SIDs
  1203. which are allowed to access the newly created server.
  1204. </exception>
  1205. <exception cref="T:System.Runtime.Remoting.RemotingException">
  1206. The given channel name is already in use.
  1207. </exception>
  1208. </member>
  1209. <member name="M:EasyHook.RemoteHooking.IpcConnectClient``1(System.String)">
  1210. <summary>
  1211. Connects to a globally reachable, managed IPC port.
  1212. </summary>
  1213. <remarks>
  1214. All requests have to be made through the returned object instance.
  1215. Please note that even if you might think that managed IPC is quiet slow,
  1216. this is not usually the case. Internally a mechanism is being used to
  1217. directly continue execution within the server process, so that even if
  1218. your thread does nothing while dispatching the request, no CPU time is lost,
  1219. because the server thread seemlessly takes over exection. And to be true,
  1220. the rare conditions in which you will need high-speed IPC ports are not
  1221. worth the effort to break with NET's exciting IPC capabilities. In times
  1222. of Quad-Cores, managed marshalling isn't that slow anymore.
  1223. </remarks>
  1224. <typeparam name="TRemoteObject">
  1225. An object derived from <see cref="T:System.MarshalByRefObject"/> which provides the
  1226. method implementations this server should provide. Note that only calls through the
  1227. returned object instance will be redirected to the server process! ATTENTION: Static fields
  1228. and members are always processed locally only...
  1229. </typeparam>
  1230. <param name="InChannelName">
  1231. The name of the channel to connect to, usually obtained with <see cref="M:EasyHook.RemoteHooking.IpcCreateServer``1(System.String@,System.Runtime.Remoting.WellKnownObjectMode,``0,System.Security.Principal.WellKnownSidType[])"/>.
  1232. </param>
  1233. <returns>
  1234. An remote object instance which member accesses will be redirected to the server.
  1235. </returns>
  1236. <exception cref="T:System.ArgumentException">
  1237. Unable to create remote object or invalid channel name...
  1238. </exception>
  1239. </member>
  1240. <member name="M:EasyHook.RemoteHooking.Inject(System.Int32,EasyHook.InjectionOptions,System.String,System.String,System.Object[])">
  1241. <summary>
  1242. Injects the given user library into the target process. No memory leaks are left
  1243. in the target, even if injection fails for unknown reasons.
  1244. </summary>
  1245. <remarks>
  1246. <para>
  1247. There are two possible user library paths. The first one should map to
  1248. a 32-bit library, and the second one should map to 64-bit library. If your
  1249. code has been compiled for "AnyCPU", like it's the default for C#, you may
  1250. even specify one library path for both parameters. Please note that your
  1251. library including all of it's dependencies must be registered in the
  1252. Global Assembly Cache (GAC). Refer to <see cref="M:EasyHook.Config.Register(System.String,System.String[])"/> for more
  1253. information about how to get them there.
  1254. </para><para>
  1255. If you inject a library into any target process please keep in mind that
  1256. your working directory will be switched. EasyHook will automatically add
  1257. the directory of the injecting application as first directory of the target's PATH environment
  1258. variable. So make sure that all required dependencies are either located
  1259. within the injecting application's directory, a system directory or any directory already
  1260. contained in the PATH variable.
  1261. </para> <para>
  1262. EasyHook provides extensive error information during injection. Any kind of failure is
  1263. being caught and thrown as an exception by this method. If for example your library
  1264. does not expose a class implementing <see cref="T:EasyHook.IEntryPoint"/>, an exception will be
  1265. raised in the target process during injection. The exception will be redirected to this method
  1266. and you can catch it in a try-catch statement around <see cref="M:EasyHook.RemoteHooking.Inject(System.Int32,EasyHook.InjectionOptions,System.String,System.String,System.Object[])"/>.
  1267. </para> <para>
  1268. You will often have to pass parameters to your injected library. <see cref="T:System.Runtime.Remoting.Channels.Ipc.IpcChannel"/>
  1269. names are common, but also any other kind of data can be passed. You may add a custom list
  1270. of objects marked with the <see cref="T:System.SerializableAttribute"/>. All common NET classes
  1271. will be serializable by default, but if you are using your own classes you might have to provide
  1272. serialization by yourself. The custom parameter list will be passed unchanged to your injected
  1273. library entry points <c>Run</c> and <c>construcotr</c>. Verify that all required type libraries to deserialize
  1274. your parameter list are either registered in the GAC or otherwise accessible to your library by being in the same path.
  1275. </para><para>
  1276. It is supported to inject code into 64-bit processes from within 32-bit processes and
  1277. vice versa. It is also supported to inject code into other terminal sessions. Of course
  1278. this will require additional processes and services to be created, but as they are managed
  1279. internally, you won't notice them! There will be some delay when injecting the first library.
  1280. </para><para>
  1281. Even if it would technically be possible to inject a library for debugging purposes into
  1282. the current process, it will throw an exception. This is because it heavily depends on
  1283. your injected library whether the current process will be damaged. Any kind of communication
  1284. may lead into deadlocks if you hook the wrong APIs. Just use the capability of Visual Studio
  1285. to debug more than one process simultanously which will allow you to debug your library
  1286. as if it would be injected into the current process without running into any side-effects.
  1287. </para>
  1288. <para>
  1289. The given exceptions are those which are thrown by EasyHook code. The NET framework might throw
  1290. any other exception not listed here. Don't rely on the exception type. If you passed valid parameters,
  1291. the only exceptions you should explicitly check for are <see cref="T:System.NotSupportedException"/> and
  1292. <see cref="T:System.AccessViolationException"/>. All others
  1293. shall be caught and treated as bad environment or invalid parameter error.
  1294. </para>
  1295. </remarks>
  1296. <param name="InTargetPID">
  1297. The target process ID.
  1298. </param>
  1299. <param name="InOptions">
  1300. A valid combination of options.
  1301. </param>
  1302. <param name="InLibraryPath_x86">
  1303. A partially qualified assembly name or a relative/absolute file path of the 32-bit version of your library.
  1304. For example "MyAssembly, PublicKeyToken=248973975895496" or ".\Assemblies\MyAssembly.dll".
  1305. </param>
  1306. <param name="InLibraryPath_x64">
  1307. A partially qualified assembly name or a relative/absolute file path of the 64-bit version of your library.
  1308. For example "MyAssembly, PublicKeyToken=248973975895496" or ".\Assemblies\MyAssembly.dll".
  1309. </param>
  1310. <param name="InPassThruArgs">
  1311. A serializable list of parameters being passed to your library entry points <c>Run()</c> and
  1312. constructor (see <see cref="T:EasyHook.IEntryPoint"/>).
  1313. </param>
  1314. <exception cref="T:System.InvalidOperationException">
  1315. It is unstable to inject libraries into the same process. This exception is disabled in DEBUG mode.
  1316. </exception>
  1317. <exception cref="T:System.AccessViolationException">
  1318. Access to target process denied or the current user is not an administrator.
  1319. </exception>
  1320. <exception cref="T:System.ArgumentException">
  1321. The given process does not exist or unable to serialize/deserialize one or more pass thru arguments.
  1322. </exception>
  1323. <exception cref="T:System.IO.FileNotFoundException">
  1324. The given user library could not be found.
  1325. </exception>
  1326. <exception cref="T:System.OutOfMemoryException">
  1327. Unable to allocate unmanaged memory in current or target process.
  1328. </exception>
  1329. <exception cref="T:System.NotSupportedException">
  1330. It is not supported to inject into the target process. This is common on Windows Vista and Server 2008.
  1331. </exception>
  1332. <exception cref="T:System.TimeoutException">
  1333. Unable to wait for user library to be initialized. Check your library's <see cref="T:EasyHook.IEntryPoint"/> constructor.
  1334. </exception>
  1335. <exception cref="T:System.EntryPointNotFoundException">
  1336. The given user library does not export a class implementing the <see cref="T:EasyHook.IEntryPoint"/> interface.
  1337. </exception>
  1338. </member>
  1339. <member name="M:EasyHook.RemoteHooking.Inject(System.Int32,System.String,System.String,System.Object[])">
  1340. <summary>
  1341. See <see cref="M:EasyHook.RemoteHooking.Inject(System.Int32,EasyHook.InjectionOptions,System.String,System.String,System.Object[])"/> for more information.
  1342. </summary>
  1343. <param name="InTargetPID">
  1344. The target process ID.
  1345. </param>
  1346. <param name="InLibraryPath_x86">
  1347. A partially qualified assembly name or a relative/absolute file path of the 32-bit version of your library.
  1348. For example "MyAssembly, PublicKeyToken=248973975895496" or ".\Assemblies\MyAssembly.dll".
  1349. </param>
  1350. <param name="InLibraryPath_x64">
  1351. A partially qualified assembly name or a relative/absolute file path of the 64-bit version of your library.
  1352. For example "MyAssembly, PublicKeyToken=248973975895496" or ".\Assemblies\MyAssembly.dll".
  1353. </param>
  1354. <param name="InPassThruArgs">
  1355. A serializable list of parameters being passed to your library entry points <c>Run()</c> and
  1356. constructor (see <see cref="T:EasyHook.IEntryPoint"/>).
  1357. </param>
  1358. </member>
  1359. <member name="M:EasyHook.RemoteHooking.IsX64Process(System.Int32)">
  1360. <summary>
  1361. Determines if the target process is 64-bit or not. This will work only
  1362. if the current process has <c>PROCESS_QUERY_INFORMATION</c> access to the target.
  1363. </summary>
  1364. <remarks>
  1365. A typical mistake is to enumerate processes under system privileges and
  1366. calling this method later when required. This won't work in most cases because
  1367. you'll also need system privileges to run this method on processes in other sessions!
  1368. </remarks>
  1369. <param name="InTargetPID">The PID of the target process.</param>
  1370. <returns><c>true</c> if the given process is 64-bit, <c>false</c> otherwise.</returns>
  1371. <exception cref="T:System.AccessViolationException">
  1372. The given process is not accessible.
  1373. </exception>
  1374. <exception cref="T:System.ArgumentException">
  1375. The given process does not exist.
  1376. </exception>
  1377. </member>
  1378. <member name="M:EasyHook.RemoteHooking.GetProcessIdentity(System.Int32)">
  1379. <summary>
  1380. Returns the <see cref="T:System.Security.Principal.WindowsIdentity"/> of the user the target process belongs to.
  1381. You need <c>PROCESS_QUERY_INFORMATION</c> access to the target.
  1382. </summary>
  1383. <param name="InTargetPID">An accessible target process ID.</param>
  1384. <returns>The identity of the target owner.</returns>
  1385. <exception cref="T:System.AccessViolationException">
  1386. The given process is not accessible.
  1387. </exception>
  1388. <exception cref="T:System.ArgumentException">
  1389. The given process does not exist.
  1390. </exception>
  1391. </member>
  1392. <member name="M:EasyHook.RemoteHooking.GetCurrentProcessId">
  1393. <summary>
  1394. Returns the current native system process ID.
  1395. </summary>
  1396. <returns>The native system process ID.</returns>
  1397. </member>
  1398. <member name="M:EasyHook.RemoteHooking.GetCurrentThreadId">
  1399. <summary>
  1400. Returns the current native system thread ID.
  1401. </summary>
  1402. <remarks>
  1403. Even if currently each dedicated managed
  1404. thread (not a thread from a <see cref="T:System.Threading.ThreadPool"/>) exactly maps to one native
  1405. system thread, this behavior may change in future versions.
  1406. If you would like to have unintercepted threads, you should make sure that they are
  1407. dedicated ones, e.g. derived from <see cref="T:System.Threading.Thread"/>.
  1408. </remarks>
  1409. <returns>The native system thread ID.</returns>
  1410. </member>
  1411. <member name="M:EasyHook.RemoteHooking.ExecuteAsService``1(System.String,System.Object[])">
  1412. <summary>
  1413. Will execute the given static method under system privileges.
  1414. </summary>
  1415. <remarks>
  1416. <para>
  1417. For some tasks it is necessary to have unrestricted access to the windows API.
  1418. For example if you want to enumerate all running processes in all sessions. But
  1419. keep in mind that you only can access these information within the given static
  1420. method and only if it is called through this service.
  1421. </para><para>
  1422. To accomplish this task, your assembly is loaded into a system service which
  1423. executes the given static method in a remoted manner. This implies that the
  1424. return type shall be marked with <see cref="T:System.SerializableAttribute" />. All
  1425. handles or other process specific things obtained in the service, will be invalid
  1426. in your application after the call is completed! Also the service will use
  1427. a new instance of your class, so you should only rely on the given parameters
  1428. and avoid using any external variables.. Your method shall be threaded as isolated!
  1429. </para><para>
  1430. The next thing to mention is that all assemblies required for executing the method
  1431. shall either be in the GAC or in the directory of the related EasyHook-Library.
  1432. Otherwise the service won't be able to use your assembly!
  1433. </para><para>
  1434. All unhandled exceptions will be rethrown by the local <see cref="M:EasyHook.RemoteHooking.ExecuteAsService``1(System.String,System.Object[])" />.
  1435. </para>
  1436. </remarks>
  1437. <typeparam name="TClass">A class containing the given static method.</typeparam>
  1438. <param name="InMethodName">A public static method exposed by the given public class.</param>
  1439. <param name="InParams">A list of serializable parameters being passed to your static method.</param>
  1440. <returns>The same value your method is returning or <c>null</c> if a <c>void</c> method is called.</returns>
  1441. <exception cref="T:System.AccessViolationException">
  1442. The current user is not an administrator.
  1443. </exception>
  1444. <example>
  1445. <code>
  1446. private static void OnProcessUpdate(Object InCallback)
  1447. {
  1448. ProcessTimer.Change(Timeout.Infinite, Timeout.Infinite);
  1449. try
  1450. {
  1451. ProcessInfo[] Array = (ProcessInfo[])RemoteHooking.ExecuteAsService&lt;Form1&gt;("EnumProcesses");
  1452. SortedDictionary&lt;String, ProcessInfo&gt; Result = new SortedDictionary&lt;string, ProcessInfo&gt;();
  1453. // sort by name...
  1454. lock (ProcessList)
  1455. {
  1456. ActivePIDList.Clear();
  1457. for (int i = 0; i &lt; Array.Length; i++)
  1458. {
  1459. Result.Add(System.IO.Path.GetFileName(Array[i].FileName) + "____" + i, Array[i]);
  1460. ActivePIDList.Add(Array[i].Id);
  1461. }
  1462. Result.Values.CopyTo(Array, 0);
  1463. ProcessList.Clear();
  1464. ProcessList.AddRange(Array);
  1465. }
  1466. }
  1467. catch (AccessViolationException)
  1468. {
  1469. MessageBox.Show("This is an administrative task!", "Permission denied...", MessageBoxButtons.OK);
  1470. Process.GetCurrentProcess().Kill();
  1471. }
  1472. finally
  1473. {
  1474. ProcessTimer.Change(5000, 5000);
  1475. }
  1476. }
  1477. [Serializable]
  1478. public class ProcessInfo
  1479. {
  1480. public String FileName;
  1481. public Int32 Id;
  1482. public Boolean Is64Bit;
  1483. public String User;
  1484. }
  1485. public static ProcessInfo[] EnumProcesses()
  1486. {
  1487. List&lt;ProcessInfo&gt; Result = new List&lt;ProcessInfo&gt;();
  1488. Process[] ProcList = Process.GetProcesses();
  1489. for (int i = 0; i &lt; ProcList.Length; i++)
  1490. {
  1491. Process Proc = ProcList[i];
  1492. try
  1493. {
  1494. ProcessInfo Info = new ProcessInfo();
  1495. Info.FileName = Proc.MainModule.FileName;
  1496. Info.Id = Proc.Id;
  1497. Info.Is64Bit = RemoteHooking.IsX64Process(Proc.Id);
  1498. Info.User = RemoteHooking.GetProcessIdentity(Proc.Id).Name;
  1499. Result.Add(Info);
  1500. }
  1501. catch
  1502. {
  1503. }
  1504. }
  1505. return Result.ToArray();
  1506. }
  1507. </code>
  1508. </example>
  1509. </member>
  1510. <member name="M:EasyHook.RemoteHooking.CreateAndInject(System.String,System.String,System.Int32,EasyHook.InjectionOptions,System.String,System.String,System.Int32@,System.Object[])">
  1511. <summary>
  1512. Creates a new process which is started suspended until you call <see cref="M:EasyHook.RemoteHooking.WakeUpProcess"/>
  1513. from within your injected library <c>Run()</c> method. This allows you to hook the target
  1514. BEFORE any of its usual code is executed. In situations where a target has debugging and
  1515. hook preventions, you will get a chance to block those mechanisms for example...
  1516. </summary>
  1517. <remarks>
  1518. <para>
  1519. Please note that this method might fail when injecting into managed processes, especially
  1520. when the target is using the CLR hosting API and takes advantage of AppDomains. For example,
  1521. the Internet Explorer won't be hookable with this method. In such a case your only options
  1522. are either to hook the target with the unmanaged API or to hook it after (non-supended) creation
  1523. with the usual <see cref="M:EasyHook.RemoteHooking.Inject(System.Int32,EasyHook.InjectionOptions,System.String,System.String,System.Object[])"/> method.
  1524. </para>
  1525. <para>
  1526. See <see cref="M:EasyHook.RemoteHooking.Inject(System.Int32,EasyHook.InjectionOptions,System.String,System.String,System.Object[])"/> for more information. The exceptions listed here are additional
  1527. to the ones listed for <see cref="M:EasyHook.RemoteHooking.Inject(System.Int32,EasyHook.InjectionOptions,System.String,System.String,System.Object[])"/>.
  1528. </para>
  1529. </remarks>
  1530. <param name="InEXEPath">
  1531. A relative or absolute path to the desired executable.
  1532. </param>
  1533. <param name="InCommandLine">
  1534. Optional command line parameters for process creation.
  1535. </param>
  1536. <param name="InProcessCreationFlags">
  1537. Internally CREATE_SUSPENDED is already passed to CreateProcess(). With this
  1538. parameter you can add more flags like DETACHED_PROCESS, CREATE_NEW_CONSOLE or
  1539. whatever!
  1540. </param>
  1541. <param name="InOptions">
  1542. A valid combination of options.
  1543. </param>
  1544. <param name="InLibraryPath_x86">
  1545. A partially qualified assembly name or a relative/absolute file path of the 32-bit version of your library.
  1546. For example "MyAssembly, PublicKeyToken=248973975895496" or ".\Assemblies\\MyAssembly.dll".
  1547. </param>
  1548. <param name="InLibraryPath_x64">
  1549. A partially qualified assembly name or a relative/absolute file path of the 64-bit version of your library.
  1550. For example "MyAssembly, PublicKeyToken=248973975895496" or ".\Assemblies\\MyAssembly.dll".
  1551. </param>
  1552. <param name="OutProcessId">
  1553. The process ID of the newly created process.
  1554. </param>
  1555. <param name="InPassThruArgs">
  1556. A serializable list of parameters being passed to your library entry points <c>Run()</c> and
  1557. constructor (see <see cref="T:EasyHook.IEntryPoint"/>).
  1558. </param>
  1559. <exception cref="T:System.ArgumentException">
  1560. The given EXE path could not be found.
  1561. </exception>
  1562. </member>
  1563. <member name="M:EasyHook.RemoteHooking.CreateAndInject(System.String,System.String,System.Int32,System.String,System.String,System.Int32@,System.Object[])">
  1564. <summary>
  1565. Creates a new process which is started suspended until you call <see cref="M:EasyHook.RemoteHooking.WakeUpProcess"/>
  1566. from within your injected library <c>Run()</c> method. This allows you to hook the target
  1567. BEFORE any of its usual code is executed. In situations where a target has debugging and
  1568. hook preventions, you will get a chance to block those mechanisms for example...
  1569. </summary>
  1570. <remarks>
  1571. <para>
  1572. Please note that this method might fail when injecting into managed processes, especially
  1573. when the target is using the CLR hosting API and takes advantage of AppDomains. For example,
  1574. the Internet Explorer won't be hookable with this method. In such a case your only options
  1575. are either to hook the target with the unmanaged API or to hook it after (non-supended) creation
  1576. with the usual <see cref="M:EasyHook.RemoteHooking.Inject(System.Int32,EasyHook.InjectionOptions,System.String,System.String,System.Object[])"/> method.
  1577. </para>
  1578. <para>
  1579. See <see cref="M:EasyHook.RemoteHooking.Inject(System.Int32,EasyHook.InjectionOptions,System.String,System.String,System.Object[])"/> for more information. The exceptions listed here are additional
  1580. to the ones listed for <see cref="M:EasyHook.RemoteHooking.Inject(System.Int32,EasyHook.InjectionOptions,System.String,System.String,System.Object[])"/>.
  1581. </para>
  1582. </remarks>
  1583. <param name="InEXEPath">
  1584. A relative or absolute path to the desired executable.
  1585. </param>
  1586. <param name="InCommandLine">
  1587. Optional command line parameters for process creation.
  1588. </param>
  1589. <param name="InProcessCreationFlags">
  1590. Internally CREATE_SUSPENDED is already passed to CreateProcess(). With this
  1591. parameter you can add more flags like DETACHED_PROCESS, CREATE_NEW_CONSOLE or
  1592. whatever!
  1593. </param>
  1594. <param name="InLibraryPath_x86">
  1595. A partially qualified assembly name or a relative/absolute file path of the 32-bit version of your library.
  1596. For example "MyAssembly, PublicKeyToken=248973975895496" or ".\Assemblies\\MyAssembly.dll".
  1597. </param>
  1598. <param name="InLibraryPath_x64">
  1599. A partially qualified assembly name or a relative/absolute file path of the 64-bit version of your library.
  1600. For example "MyAssembly, PublicKeyToken=248973975895496" or ".\Assemblies\\MyAssembly.dll".
  1601. </param>
  1602. <param name="OutProcessId">
  1603. The process ID of the newly created process.
  1604. </param>
  1605. <param name="InPassThruArgs">
  1606. A serializable list of parameters being passed to your library entry points <c>Run()</c> and
  1607. constructor (see <see cref="T:EasyHook.IEntryPoint"/>).
  1608. </param>
  1609. <exception cref="T:System.ArgumentException">
  1610. The given EXE path could not be found.
  1611. </exception>
  1612. </member>
  1613. <member name="P:EasyHook.RemoteHooking.IsX64System">
  1614. <summary>
  1615. Returns <c>true</c> if the operating system is 64-Bit Windows, <c>false</c> otherwise.
  1616. </summary>
  1617. </member>
  1618. <member name="M:EasyHook.RemoteHooking.InstallSupportDriver">
  1619. <summary>
  1620. Installs the EasyHook support driver. After this step you may use
  1621. <see cref="M:EasyHook.RemoteHooking.InstallDriver(System.String,System.String)"/> to install your kernel mode hooking component.
  1622. </summary>
  1623. </member>
  1624. <member name="M:EasyHook.RemoteHooking.InstallDriver(System.String,System.String)">
  1625. <summary>
  1626. Loads the given driver into the kernel and immediately marks it for deletion.
  1627. The installed driver will be registered with the service control manager under the
  1628. <paramref name="InDriverName"/> you specify.
  1629. Please note that you should use <see cref="P:EasyHook.RemoteHooking.IsX64System"/> to find out which
  1630. driver to load. Even if your process is running on 32-Bit this does not mean,
  1631. that the OS kernel is running on 32-Bit!
  1632. </summary>
  1633. <param name="InDriverPath"></param>
  1634. <param name="InDriverName"></param>
  1635. </member>
  1636. <member name="T:System.GACManagedAccess.IAssemblyCache">
  1637. <summary>
  1638. The IAssemblyCache interface is the top-level interface that provides access to the GAC.
  1639. </summary>
  1640. </member>
  1641. <member name="T:System.GACManagedAccess.IAssemblyName">
  1642. <summary>
  1643. Represents an assembly name. An assembly name includes a predetermined set of name-value pairs. The assembly name is described in detail in the .NET Framework SDK.
  1644. </summary>
  1645. </member>
  1646. <member name="M:System.GACManagedAccess.IAssemblyName.SetProperty(System.GACManagedAccess.AssemblyNamePropertyIds,System.IntPtr,System.Int32)">
  1647. <summary>
  1648. The IAssemblyName::SetProperty method adds a name-value pair to the assembly name, or, if a name-value pair with the same name already exists, modifies or deletes the value of a name-value pair.
  1649. </summary>
  1650. <param name="PropertyId">The ID that represents the name part of the name-value pair that is to be added or to be modified. Valid property IDs are defined in the ASM_NAME enumeration.</param>
  1651. <param name="pvProperty">A pointer to a buffer that contains the value of the property.</param>
  1652. <param name="cbProperty">The length of the pvProperty buffer in bytes. If cbProperty is zero, the name-value pair is removed from the assembly name.</param>
  1653. <returns></returns>
  1654. </member>
  1655. <member name="M:System.GACManagedAccess.IAssemblyName.GetProperty(System.GACManagedAccess.AssemblyNamePropertyIds,System.IntPtr,System.Int32@)">
  1656. <summary>
  1657. The IAssemblyName::GetProperty method retrieves the value of a name-value pair in the assembly name that specifies the name.
  1658. </summary>
  1659. <param name="PropertyId">The ID that represents the name of the name-value pair whose value is to be retrieved. Specified property IDs are defined in the ASM_NAME enumeration.</param>
  1660. <param name="pvProperty">A pointer to a buffer that is to contain the value of the property.</param>
  1661. <param name="pcbProperty">The length of the pvProperty buffer, in bytes.</param>
  1662. <returns></returns>
  1663. </member>
  1664. <member name="M:System.GACManagedAccess.IAssemblyName.Finalize">
  1665. <summary>
  1666. The IAssemblyName::Finalize method freezes an assembly name. Additional calls to IAssemblyName::SetProperty are unsuccessful after this method has been called.
  1667. </summary>
  1668. <returns></returns>
  1669. </member>
  1670. <member name="M:System.GACManagedAccess.IAssemblyName.GetDisplayName(System.Text.StringBuilder,System.Int32@,System.Int32)">
  1671. <summary>
  1672. The IAssemblyName::GetDisplayName method returns a string representation of the assembly name.
  1673. </summary>
  1674. <param name="pDisplayName">A pointer to a buffer that is to contain the display name. The display name is returned in Unicode.</param>
  1675. <param name="pccDisplayName">The size of the buffer in characters (on input). The length of the returned display name (on return).</param>
  1676. <param name="displayFlags">One or more of the bits defined in the ASM_DISPLAY_FLAGS enumeration: <see cref="T:System.GACManagedAccess.AssemblyNameDisplayFlags"/></param>
  1677. <returns></returns>
  1678. </member>
  1679. <member name="T:System.GACManagedAccess.IAssemblyEnum">
  1680. <summary>
  1681. Enumerates the assemblies in the GAC.
  1682. </summary>
  1683. </member>
  1684. <member name="M:System.GACManagedAccess.IAssemblyEnum.GetNextAssembly(System.IntPtr,System.GACManagedAccess.IAssemblyName@,System.Int32)">
  1685. <summary>
  1686. Enumerates the assemblies in the GAC.
  1687. </summary>
  1688. <param name="pvReserved">Must be null</param>
  1689. <param name="ppName">Pointer to a memory location that is to receive the interface pointer to the assembly name of the next assembly that is enumerated.</param>
  1690. <param name="flags">Must be zero.</param>
  1691. <returns></returns>
  1692. </member>
  1693. <member name="T:System.GACManagedAccess.IInstallReferenceItem">
  1694. <summary>
  1695. The IInstallReferenceItem interface represents a reference that has been set on an assembly in the GAC. Instances of IInstallReferenceIteam are returned by the <see cref="T:System.GACManagedAccess.IInstallReferenceEnum"/> interface.
  1696. </summary>
  1697. </member>
  1698. <member name="M:System.GACManagedAccess.IInstallReferenceItem.GetReference(System.IntPtr@,System.Int32,System.IntPtr)">
  1699. <summary>
  1700. Returns a FUSION_INSTALL_REFERENCE structure, <see cref="T:System.GACManagedAccess.InstallReference"/>.
  1701. </summary>
  1702. <param name="pRefData">A pointer to a FUSION_INSTALL_REFERENCE structure.
  1703. The memory is allocated by the GetReference method and is freed when
  1704. <see cref="T:System.GACManagedAccess.IInstallReferenceItem"/> is released. Callers must not hold a reference to this
  1705. buffer after the IInstallReferenceItem object is released.
  1706. To avoid allocation issues with the interop layer, the <see cref="T:System.GACManagedAccess.InstallReference"/> is not marshaled directly - therefore use of out IntPtr</param>
  1707. <param name="flags"></param>
  1708. <param name="pvReserced"></param>
  1709. <returns></returns>
  1710. </member>
  1711. <member name="T:System.GACManagedAccess.IInstallReferenceEnum">
  1712. <summary>
  1713. <para>The IInstllReferenceEnum interface enumerates all references that are set on an assembly in the GAC.</para>
  1714. <para>Note: references that belong to the assembly are locked for changes while those references are being enumerated.</para>
  1715. </summary>
  1716. </member>
  1717. <member name="M:System.GACManagedAccess.IInstallReferenceEnum.GetNextInstallReferenceItem(System.GACManagedAccess.IInstallReferenceItem@,System.Int32,System.IntPtr)">
  1718. <summary>
  1719. Returns the next reference information for an assembly
  1720. </summary>
  1721. <param name="ppRefItem">Pointer to a memory location that receives the IInstallReferenceItem pointer.</param>
  1722. <param name="flags">Must be zero.</param>
  1723. <param name="pvReserced">Must be null.</param>
  1724. <returns>Return values are as follows: S_OK: - The next item is returned successfully. S_FALSE: - No more items.</returns>
  1725. </member>
  1726. <member name="T:System.GACManagedAccess.AssemblyCommitFlags">
  1727. <summary>
  1728. Install assembly commit flags (mutually exclusive)
  1729. </summary>
  1730. </member>
  1731. <member name="F:System.GACManagedAccess.AssemblyCommitFlags.Default">
  1732. <summary>
  1733. If the assembly is already installed in the gAC and the file version numbers of the assembly being installed are the same or later, the files are replaced.
  1734. </summary>
  1735. </member>
  1736. <member name="F:System.GACManagedAccess.AssemblyCommitFlags.Force">
  1737. <summary>
  1738. The files of an existing assembly are overwritten regardless of their version number.
  1739. </summary>
  1740. </member>
  1741. <member name="T:System.GACManagedAccess.AssemblyCacheUninstallDisposition">
  1742. <summary>
  1743. The uninstall action taken
  1744. </summary>
  1745. </member>
  1746. <member name="F:System.GACManagedAccess.AssemblyCacheUninstallDisposition.Unknown">
  1747. <summary>
  1748. Unknown
  1749. </summary>
  1750. </member>
  1751. <member name="F:System.GACManagedAccess.AssemblyCacheUninstallDisposition.Uninstalled">
  1752. <summary>
  1753. The assembly files have been removed from the GAC
  1754. </summary>
  1755. </member>
  1756. <member name="F:System.GACManagedAccess.AssemblyCacheUninstallDisposition.StillInUse">
  1757. <summary>
  1758. An application is using the assembly.
  1759. </summary>
  1760. </member>
  1761. <member name="F:System.GACManagedAccess.AssemblyCacheUninstallDisposition.AlreadyUninstalled">
  1762. <summary>
  1763. The assembly does not exist in the GAC
  1764. </summary>
  1765. </member>
  1766. <member name="F:System.GACManagedAccess.AssemblyCacheUninstallDisposition.DeletePending">
  1767. <summary>
  1768. Not used.
  1769. </summary>
  1770. </member>
  1771. <member name="F:System.GACManagedAccess.AssemblyCacheUninstallDisposition.HasInstallReference">
  1772. <summary>
  1773. The assembly has not been removed from the GAC because another application reference exists.
  1774. </summary>
  1775. </member>
  1776. <member name="F:System.GACManagedAccess.AssemblyCacheUninstallDisposition.ReferenceNotFound">
  1777. <summary>
  1778. The <see cref="T:System.GACManagedAccess.InstallReference"/> that was specified is not found in the GAC.
  1779. </summary>
  1780. </member>
  1781. <member name="T:System.GACManagedAccess.AssemblyCacheFlags">
  1782. <summary>
  1783. The ASM_CACHE_FLAGS enumeration used in <see cref="M:System.GACManagedAccess.Utils.CreateAssemblyEnum(System.GACManagedAccess.IAssemblyEnum@,System.IntPtr,System.GACManagedAccess.IAssemblyName,System.GACManagedAccess.AssemblyCacheFlags,System.IntPtr)"/>.
  1784. </summary>
  1785. </member>
  1786. <member name="F:System.GACManagedAccess.AssemblyCacheFlags.ZAP">
  1787. <summary>
  1788. Enumerates the cache of precompiled assemblies by using Ngen.exe.
  1789. </summary>
  1790. </member>
  1791. <member name="F:System.GACManagedAccess.AssemblyCacheFlags.GAC">
  1792. <summary>
  1793. Enumerates the GAC.
  1794. </summary>
  1795. </member>
  1796. <member name="F:System.GACManagedAccess.AssemblyCacheFlags.DOWNLOAD">
  1797. <summary>
  1798. Enumerates the assemblies that have been downloaded on-demand or that have been shadow-copied.
  1799. </summary>
  1800. </member>
  1801. <member name="T:System.GACManagedAccess.CreateAssemblyNameObjectFlags">
  1802. <summary>
  1803. The CREATE_ASM_NAME_OBJ_FLAGS enumeration, used in <see cref="M:System.GACManagedAccess.Utils.CreateAssemblyNameObject(System.GACManagedAccess.IAssemblyName@,System.String,System.GACManagedAccess.CreateAssemblyNameObjectFlags,System.IntPtr)"/>
  1804. </summary>
  1805. </member>
  1806. <member name="F:System.GACManagedAccess.CreateAssemblyNameObjectFlags.CANOF_DEFAULT">
  1807. <summary>
  1808. If this flag is specified, the szAssemblyName parameter is a full assembly name and is parsed to the individual properties. If the flag is not specified, szAssemblyName is the "Name" portion of the assembly name.
  1809. </summary>
  1810. </member>
  1811. <member name="F:System.GACManagedAccess.CreateAssemblyNameObjectFlags.CANOF_PARSE_DISPLAY_NAME">
  1812. <summary>
  1813. If this flag is specified, certain properties, such as processor architecture, are set to their default values.
  1814. </summary>
  1815. </member>
  1816. <member name="T:System.GACManagedAccess.AssemblyNamePropertyIds">
  1817. <summary>
  1818. The ASM_NAME enumeration property ID describes the valid names of the name-value pairs in an assembly name. See the .NET Framework SDK for a description of these properties.
  1819. </summary>
  1820. </member>
  1821. <member name="T:System.GACManagedAccess.AssemblyNameDisplayFlags">
  1822. <summary>
  1823. ASM_DISPLAY_FLAGS: <see cref="M:System.GACManagedAccess.IAssemblyName.GetDisplayName(System.Text.StringBuilder,System.Int32@,System.Int32)"/>.
  1824. </summary>
  1825. </member>
  1826. <member name="F:System.GACManagedAccess.AssemblyNameDisplayFlags.VERSION">
  1827. <summary>
  1828. Includes the version number as part of the display name.
  1829. </summary>
  1830. </member>
  1831. <member name="F:System.GACManagedAccess.AssemblyNameDisplayFlags.CULTURE">
  1832. <summary>
  1833. Includes the culture.
  1834. </summary>
  1835. </member>
  1836. <member name="F:System.GACManagedAccess.AssemblyNameDisplayFlags.PUBLIC_KEY_TOKEN">
  1837. <summary>
  1838. Includes the public key token.
  1839. </summary>
  1840. </member>
  1841. <member name="F:System.GACManagedAccess.AssemblyNameDisplayFlags.PUBLIC_KEY">
  1842. <summary>
  1843. Includes the public key.
  1844. </summary>
  1845. </member>
  1846. <member name="F:System.GACManagedAccess.AssemblyNameDisplayFlags.CUSTOM">
  1847. <summary>
  1848. Includes the custom part of the assembly name.
  1849. </summary>
  1850. </member>
  1851. <member name="F:System.GACManagedAccess.AssemblyNameDisplayFlags.PROCESSORARCHITECTURE">
  1852. <summary>
  1853. Includes the processor architecture.
  1854. </summary>
  1855. </member>
  1856. <member name="F:System.GACManagedAccess.AssemblyNameDisplayFlags.LANGUAGEID">
  1857. <summary>
  1858. Includes the language ID.
  1859. </summary>
  1860. </member>
  1861. <member name="F:System.GACManagedAccess.AssemblyNameDisplayFlags.ALL">
  1862. <summary>
  1863. Include all attributes.
  1864. </summary>
  1865. </member>
  1866. <member name="T:System.GACManagedAccess.InstallReference">
  1867. <summary>
  1868. The FUSION_INSTALL_REFERENCE structure represents a reference that is made when an application has installed an assembly in the GAC.
  1869. </summary>
  1870. </member>
  1871. <member name="M:System.GACManagedAccess.InstallReference.#ctor(System.Guid,System.String,System.String)">
  1872. <summary>
  1873. Create a new InstallReference
  1874. </summary>
  1875. <param name="guid">Possible values for the guidScheme field can be one of the following (<see cref="T:System.GACManagedAccess.InstallReferenceGuid"/>):
  1876. <list type="table">
  1877. <item>
  1878. <term>FUSION_REFCOUNT_MSI_GUID</term>
  1879. <description>The assembly is referenced by an application that has been installed by using Windows Installer. The szIdentifier field is set to MSI, and szNonCannonicalData is set to Windows Installer. This scheme must only be used by Windows Installer itself.</description>
  1880. </item>
  1881. <item>
  1882. <term>FUSION_REFCOUNT_UNINSTALL_SUBKEY_GUID</term>
  1883. <description>The assembly is referenced by an application that appears in Add/Remove Programs. The szIdentifier field is the token that is used to register the application with Add/Remove programs.</description>
  1884. </item>
  1885. <item>
  1886. <term>FUSION_REFCOUNT_FILEPATH_GUID</term>
  1887. <description>The assembly is referenced by an application that is represented by a file in the file system. The szIdentifier field is the path to this file.</description>
  1888. </item>
  1889. <item>
  1890. <term>FUSION_REFCOUNT_OPAQUE_STRING_GUID</term>
  1891. <description>The assembly is referenced by an application that is only represented by an opaque string. The szIdentifier is this opaque string. The GAC does not perform existence checking for opaque references when you remove this.</description>
  1892. </item>
  1893. </list>
  1894. </param>
  1895. <param name="id">A unique string that identifies the application that installed the assembly.</param>
  1896. <param name="data">A string that is only understood by the entity that adds the reference. The GAC only stores this string.</param>
  1897. </member>
  1898. <member name="P:System.GACManagedAccess.InstallReference.GuidScheme">
  1899. <summary>
  1900. The entity that adds the reference.
  1901. </summary>
  1902. </member>
  1903. <member name="P:System.GACManagedAccess.InstallReference.Identifier">
  1904. <summary>
  1905. A unique string that identifies the application that installed the assembly.
  1906. </summary>
  1907. </member>
  1908. <member name="P:System.GACManagedAccess.InstallReference.Description">
  1909. <summary>
  1910. A string that is only understood by the entity that adds the reference. The GAC only stores this string.
  1911. </summary>
  1912. </member>
  1913. <member name="F:System.GACManagedAccess.InstallReference.cbSize">
  1914. <summary>
  1915. The size of the structure in bytes.
  1916. </summary>
  1917. </member>
  1918. <member name="F:System.GACManagedAccess.InstallReference.flags">
  1919. <summary>
  1920. Reserved, must be zero.
  1921. </summary>
  1922. </member>
  1923. <member name="T:System.GACManagedAccess.InstallReferenceGuid">
  1924. <summary>
  1925. Possible values for the guidScheme for <see cref="T:System.GACManagedAccess.InstallReference"/>.
  1926. </summary>
  1927. </member>
  1928. <member name="M:System.GACManagedAccess.InstallReferenceGuid.IsValidGuidScheme(System.Guid)">
  1929. <summary>
  1930. Ensures that the provided Guid is one of the valid reference guids defined in <see cref="T:System.GACManagedAccess.InstallReferenceGuid"/> (excluding <see cref="F:System.GACManagedAccess.InstallReferenceGuid.MsiGuid"/> and <see cref="F:System.GACManagedAccess.InstallReferenceGuid.OsInstallGuid"/>).
  1931. </summary>
  1932. <param name="guid">The Guid to validate</param>
  1933. <returns>True if the Guid is <see cref="F:System.GACManagedAccess.InstallReferenceGuid.UninstallSubkeyGuid"/>, <see cref="F:System.GACManagedAccess.InstallReferenceGuid.FilePathGuid"/>, <see cref="F:System.GACManagedAccess.InstallReferenceGuid.OpaqueGuid"/> or <see cref="F:System.Guid.Empty"/>.</returns>
  1934. </member>
  1935. <member name="F:System.GACManagedAccess.InstallReferenceGuid.UninstallSubkeyGuid">
  1936. <summary>
  1937. FUSION_REFCOUNT_UNINSTALL_SUBKEY_GUID - The assembly is referenced by an application that appears in Add/Remove Programs. The szIdentifier field is the token that is used to register the application with Add/Remove programs.
  1938. </summary>
  1939. </member>
  1940. <member name="F:System.GACManagedAccess.InstallReferenceGuid.FilePathGuid">
  1941. <summary>
  1942. FUSION_REFCOUNT_FILEPATH_GUID - The assembly is referenced by an application that is represented by a file in the file system. The szIdentifier field is the path to this file.
  1943. </summary>
  1944. </member>
  1945. <member name="F:System.GACManagedAccess.InstallReferenceGuid.OpaqueGuid">
  1946. <summary>
  1947. FUSION_REFCOUNT_OPAQUE_STRING_GUID - The assembly is referenced by an application that is only represented by an opaque string. The szIdentifier is this opaque string. The GAC does not perform existence checking for opaque references when you remove this.
  1948. </summary>
  1949. </member>
  1950. <member name="F:System.GACManagedAccess.InstallReferenceGuid.MsiGuid">
  1951. <summary>
  1952. This GUID cannot be used for installing into GAC. FUSION_REFCOUNT_MSI_GUID - The assembly is referenced by an application that has been installed by using Windows Installer. The szIdentifier field is set to MSI, and szNonCannonicalData is set to Windows Installer. This scheme must only be used by Windows Installer itself.
  1953. </summary>
  1954. </member>
  1955. <member name="F:System.GACManagedAccess.InstallReferenceGuid.OsInstallGuid">
  1956. <summary>
  1957. This GUID cannot be used for installing into GAC.
  1958. </summary>
  1959. </member>
  1960. <member name="T:System.GACManagedAccess.AssemblyCache">
  1961. <summary>
  1962. Provides methods to install or remove assemblies from the Global Assembly Cache (GAC)
  1963. </summary>
  1964. </member>
  1965. <member name="M:System.GACManagedAccess.AssemblyCache.InstallAssembly(System.String,System.GACManagedAccess.InstallReference,System.GACManagedAccess.AssemblyCommitFlags)">
  1966. <summary>
  1967. Install assembly into GAC
  1968. </summary>
  1969. <param name="assemblyPath"></param>
  1970. <param name="reference"></param>
  1971. <param name="flags"></param>
  1972. </member>
  1973. <member name="M:System.GACManagedAccess.AssemblyCache.InstallAssemblies(System.String[],System.GACManagedAccess.InstallReference,System.GACManagedAccess.AssemblyCommitFlags)">
  1974. <summary>
  1975. Install the provided assemblies to GAC
  1976. </summary>
  1977. <param name="assemblyPaths"></param>
  1978. <param name="reference"></param>
  1979. <param name="flags"></param>
  1980. </member>
  1981. <member name="M:System.GACManagedAccess.AssemblyCache.UninstallAssembly(System.String,System.GACManagedAccess.InstallReference,System.GACManagedAccess.AssemblyCacheUninstallDisposition@)">
  1982. <summary>
  1983. Uninstall an assembly from the GAC. <paramref name="assemblyName"/> has to be fully specified name. E.g., for v1.0/v1.1 assemblies, it should be "name, Version=xx, Culture=xx, PublicKeyToken=xx". For v2.0+ assemblies, it should be "name, Version=xx, Culture=xx, PublicKeyToken=xx, ProcessorArchitecture=xx". If <paramref name="assemblyName"/> is not fully specified, a random matching assembly could be uninstalled.
  1984. </summary>
  1985. <param name="assemblyName"></param>
  1986. <param name="reference"></param>
  1987. <param name="disp"></param>
  1988. </member>
  1989. <member name="M:System.GACManagedAccess.AssemblyCache.UninstallAssemblies(System.String[],System.GACManagedAccess.InstallReference,System.GACManagedAccess.AssemblyCacheUninstallDisposition[]@)">
  1990. <summary>
  1991. Uninstall the provided assembly names from the GAC. <paramref name="assemblyNames"/> have to be fully specified names. E.g., for v1.0/v1.1 assemblies, it should be "name, Version=xx, Culture=xx, PublicKeyToken=xx". For v2.0+ assemblies, it should be "name, Version=xx, Culture=xx, PublicKeyToken=xx, ProcessorArchitecture=xx". If <paramref name="assemblyNames"/> is not fully specified, a random matching assembly could be uninstalled.
  1992. </summary>
  1993. <param name="assemblyNames"></param>
  1994. <param name="reference"></param>
  1995. <param name="disp"></param>
  1996. </member>
  1997. <member name="M:System.GACManagedAccess.AssemblyCache.QueryAssemblyInfo(System.String)">
  1998. <summary>
  1999. Query an assembly in the GAC. <paramref name="assemblyName"/> has to be a fully specified name. E.g., for v1.0/v1.1 assemblies, it should be "name, Version=xx, Culture=xx, PublicKeyToken=xx". For v2.0+ assemblies, it should be "name, Version=xx, Culture=xx, PublicKeyToken=xx, ProcessorArchitecture=xx". If <paramref name="assemblyName"/> is not fully specified, a random matching assembly may be found.
  2000. </summary>
  2001. <param name="assemblyName"></param>
  2002. <returns></returns>
  2003. </member>
  2004. <member name="T:System.GACManagedAccess.AssemblyCacheEnum">
  2005. <summary>
  2006. Enumerate assemblies within the Global Assembly Cache (GAC)
  2007. </summary>
  2008. </member>
  2009. <member name="M:System.GACManagedAccess.AssemblyCacheEnum.#ctor(System.String)">
  2010. <summary>
  2011. Enumerate assemblies in the GAC
  2012. </summary>
  2013. <param name="assemblyName">null means enumerate all the assemblies</param>
  2014. </member>
  2015. <member name="M:System.GACManagedAccess.AssemblyCacheEnum.GetNextAssembly">
  2016. <summary>
  2017. Get the next assembly within the enumerator.
  2018. </summary>
  2019. <returns></returns>
  2020. </member>
  2021. <member name="T:System.GACManagedAccess.AssemblyCacheInstallReferenceEnum">
  2022. <summary>
  2023. Enumerate referenced assemblies installed in the global assembly cache.
  2024. </summary>
  2025. </member>
  2026. <member name="M:System.GACManagedAccess.AssemblyCacheInstallReferenceEnum.#ctor(System.String)">
  2027. <summary>
  2028. Create enumerator for provided assembly name
  2029. </summary>
  2030. <param name="assemblyName"><paramref name="assemblyName"/> has to be a fully specified name. E.g., for v1.0/v1.1 assemblies, it should be "name, Version=xx, Culture=xx, PublicKeyToken=xx". For v2.0+ assemblies, it should be "name, Version=xx, Culture=xx, PublicKeyToken=xx, ProcessorArchitecture=xx".</param>
  2031. </member>
  2032. <member name="M:System.GACManagedAccess.AssemblyCacheInstallReferenceEnum.GetNextReference">
  2033. <summary>
  2034. Get next reference
  2035. </summary>
  2036. <returns></returns>
  2037. </member>
  2038. <member name="T:System.GACManagedAccess.Utils">
  2039. <summary>
  2040. Fusion DllImports
  2041. </summary>
  2042. </member>
  2043. <member name="M:System.GACManagedAccess.Utils.CreateAssemblyEnum(System.GACManagedAccess.IAssemblyEnum@,System.IntPtr,System.GACManagedAccess.IAssemblyName,System.GACManagedAccess.AssemblyCacheFlags,System.IntPtr)">
  2044. <summary>
  2045. To obtain an instance of the <see cref="T:System.GACManagedAccess.IAssemblyEnum"/> API, call the CreateAssemblyEnum API
  2046. </summary>
  2047. <param name="ppEnum">Pointer to a memory location that contains the IAssemblyEnum pointer.</param>
  2048. <param name="pUnkReserved">Must be null.</param>
  2049. <param name="pName">An assembly name that is used to filter the enumeration. Can be null to enumerate all assemblies in the GAC.</param>
  2050. <param name="flags">Exactly one item from the ASM_CACHE_FLAGS enumeration, <see cref="T:System.GACManagedAccess.AssemblyCacheFlags"/>.</param>
  2051. <param name="pvReserved">Must be NULL.</param>
  2052. <returns></returns>
  2053. </member>
  2054. <member name="M:System.GACManagedAccess.Utils.CreateAssemblyNameObject(System.GACManagedAccess.IAssemblyName@,System.String,System.GACManagedAccess.CreateAssemblyNameObjectFlags,System.IntPtr)">
  2055. <summary>
  2056. An instance of <see cref="T:System.GACManagedAccess.IAssemblyName"/> is obtained by calling the CreateAssemblyNameObject API
  2057. </summary>
  2058. <param name="ppAssemblyNameObj">Pointer to a memory location that receives the IAssemblyName pointer that is created.</param>
  2059. <param name="szAssemblyName">A string representation of the assembly name or of a full assembly reference that is determined by dwFlags. The string representation can be null.</param>
  2060. <param name="flags">Zero or more of the bits that are defined in the CREATE_ASM_NAME_OBJ_FLAGS enumeration, <see cref="T:System.GACManagedAccess.CreateAssemblyNameObjectFlags"/>.</param>
  2061. <param name="pvReserved">Must be null.</param>
  2062. <returns></returns>
  2063. </member>
  2064. <member name="M:System.GACManagedAccess.Utils.CreateAssemblyCache(System.GACManagedAccess.IAssemblyCache@,System.Int32)">
  2065. <summary>
  2066. To obtain an instance of the <see cref="T:System.GACManagedAccess.IAssemblyCache"/> API, call the CreateAssemblyCache API
  2067. </summary>
  2068. <param name="ppAsmCache">Pointer to return <see cref="T:System.GACManagedAccess.IAssemblyCache"/></param>
  2069. <param name="reserved">Must be zero.</param>
  2070. <returns></returns>
  2071. </member>
  2072. <member name="M:System.GACManagedAccess.Utils.CreateInstallReferenceEnum(System.GACManagedAccess.IInstallReferenceEnum@,System.GACManagedAccess.IAssemblyName,System.Int32,System.IntPtr)">
  2073. <summary>
  2074. To obtain an instance of the <see cref="T:System.GACManagedAccess.IInstallReferenceEnum"/> API, call the CreateInstallReferenceEnum API
  2075. </summary>
  2076. <param name="ppRefEnum">A pointer to a memory location that receives the IInstallReferenceEnum pointer.</param>
  2077. <param name="pName">The assembly name for which the references are enumerated.</param>
  2078. <param name="dwFlags">Must be zero.</param>
  2079. <param name="pvReserved">Must be null.</param>
  2080. <returns></returns>
  2081. </member>
  2082. </members>
  2083. </doc>