Injecting a DLL via EasyHook menu

Shout-Out

User Tag List

Results 1 to 1 of 1
  1. #1
    Viano's Avatar Active Member
    Reputation
    37
    Join Date
    May 2008
    Posts
    172
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Injecting a DLL via EasyHook

    Hi everyone,

    I am trying to learn about how to use EasyHook but I am not even able to run the example provided. I seem to have all files in my "Debug" (FileMonInject.dll) directory but I'm still getting exceptions about missing files.

    The following is my code.

    Code:
    namespace Hooking
    {
    
        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 Hooking
        {
            static String ChannelName = null;
    
    
            public Hooking() 
            {
                hook();
            }
    
            static public void hook() {
                try
                {
                    Config.Register(
                    "A FileMon like demo application.",
                    "FileMon.exe",
                    "FileMonInject.dll");
    
                    Console.WriteLine("Registered!");
    
                    RemoteHooking.IpcCreateServer<FileMonInterface>(ref
    ChannelName, WellKnownObjectMode.SingleCall);
    
                    RemoteHooking.Inject(2776, "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());
                }
            }
        }
    }
    So RemoteHooking.Inject(...) is failing with the following Exception.

    Code:
    There was an error while connecting to target:
    System.IO.FileNotFoundException: File or Assembly "FileMonInject, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d34a061f079be347" or its dependency cannot be found. The system cannot find the file.
    I hope in this section I will not get flamed to death

    Update:

    No idea why, but now I am getting something completely else.

    Code:
    There was an error while connecting to target:
    System.Reflection.TargetInvocationException: Target has thrown exception. ---> System.Runtime.Remoting.RemotingException: Tried to call method of type "FileMon.FileMonInterface" declared in "Hooking.FileMonInterface".
    Update 2:

    System.Runtime.Remoting.RemotingException: Failed to connect to an IPC Port: Access is denied.

    Any clue on this one?

    EDIT:
    Just ignore this, I managed to inject a DLL via EasyHook into WoW
    Last edited by Viano; 07-28-2009 at 01:32 AM. Reason: Solved
    Viano

    Injecting a DLL via EasyHook

Similar Threads

  1. Properly setting a hardware breakpoint via dll injection
    By noctural in forum WoW Memory Editing
    Replies: 7
    Last Post: 08-22-2022, 03:48 AM
  2. HadesMem: Creating a Process and Injecting a DLL
    By GliderPro in forum WoW Memory Editing
    Replies: 3
    Last Post: 12-20-2010, 02:31 AM
  3. [Hack] V3.3.5->EasyHook dll injection will be banned instantly!
    By zys924 in forum WoW Memory Editing
    Replies: 14
    Last Post: 07-03-2010, 03:36 PM
  4. exit/unload injected .net dll
    By YetiHunter in forum Programming
    Replies: 5
    Last Post: 02-28-2010, 06:57 AM
  5. Using DLL's to inject values without CE.
    By Matsy in forum World of Warcraft Bots and Programs
    Replies: 7
    Last Post: 06-29-2007, 02:26 PM
All times are GMT -5. The time now is 08:45 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search