Click or drag to resize

Config Class

Currently only provides a mechanism to register assemblies in the GAC.
Inheritance Hierarchy
SystemObject
  EasyHookConfig

Namespace:  EasyHook
Assembly:  EasyHook (in EasyHook.dll) Version: 2.7.6684.0 (2.7.6684.0)
Syntax
public class Config

The Config type exposes the following members.

Constructors
  NameDescription
Public methodConfig
Initializes a new instance of the Config class
Top
Properties
  NameDescription
Public propertyStatic memberDependencyPath
The path where dependant files, like EasyHook(32|64)Svc.exe are stored. Defaults to no path being specified.
Public propertyStatic memberHelperLibraryLocation
The path where helper files, like EasyHook(32|64).dll are stored. Defaults to the location of the assembly containing the Config type
Top
Methods
  NameDescription
Public methodStatic memberDebugPrint Obsolete.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodStatic memberGetDependantSvcExecutableName
Get the EasyHook SVC executable name with the custom dependency path prepended.
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodStatic memberGetProcessPath
Get the directory name of the current process, ending with a backslash.
Public methodStatic memberGetSvcExecutableName
Get the name of the EasyHook SVC executable. Automatically determine whether to use the 64-bit or the 32-bit version.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodStatic memberGetWOW64BypassExecutableName
Get the name of the EasyHook SVC executable to use for WOW64 bypass. If this process is 64-bit, return the 32-bit service executable and vice versa.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodStatic memberPrintComment Obsolete.
Public methodStatic memberPrintError Obsolete.
Public methodStatic memberPrintWarning Obsolete.
Public methodStatic memberRegister
REQUIRES ADMIN PRIVILEGES. Installs EasyHook and all given user NET assemblies into the GAC and ensures that all references are cleaned up if the installing application is shutdown. Cleanup does not depend on the calling application...
Public methodStatic memberRunCommand Obsolete.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Remarks
The following demonstrates how to use RemoteHooking and Config:
using System;
using System.Collections.Generic;
using System.Runtime.Remoting;
using System.Text;
using System.IO;
using EasyHook;

namespace FileMon
{
    public class FileMonInterface : MarshalByRefObject
    {
        public void IsInstalled(Int32 InClientPID)
        {
            Console.WriteLine("FileMon has been installed in target {0}.\r\n", InClientPID);
        }

        public void OnCreateFile(Int32 InClientPID, String[] InFileNames)
        {
            for (int i = 0; i < InFileNames.Length; i++)
            {
                Console.WriteLine(InFileNames[i]);
            }
        }

        public void ReportException(Exception InInfo)
        {
            Console.WriteLine("The target process has reported an error:\r\n" + InInfo.ToString());
        }

        public void Ping()
        {
        }
    }

    class Program
    {
        static String ChannelName = null;

        static void Main(string[] args)
        {
            try
            {
                Config.Register(
                    "A FileMon like demo application.",
                    "FileMon.exe",
                    "FileMonInject.dll");

                RemoteHooking.IpcCreateServer<FileMonInterface>(ref ChannelName, WellKnownObjectMode.SingleCall);

                RemoteHooking.Inject(
                    Int32.Parse(args[0]),
                    "FileMonInject.dll",
                    "FileMonInject.dll",
                    ChannelName);

                Console.ReadLine();
            }
            catch (Exception ExtInfo)
            {
                Console.WriteLine("There was an error while connecting to target:\r\n{0}", ExtInfo.ToString());
            }
        }
    }
}
See Also