Click here to Skip to main content
15,895,192 members
Home / Discussions / C#
   

C#

 
AnswerRe: What am I doing wrong? Pin
Hum Dum8-Nov-11 17:09
Hum Dum8-Nov-11 17:09 
AnswerRe: What am I doing wrong? Pin
RobCroll8-Nov-11 17:09
RobCroll8-Nov-11 17:09 
QuestionAce OLE driver with Extended Properties Pin
Alaric_8-Nov-11 10:18
professionalAlaric_8-Nov-11 10:18 
AnswerRe: Ace OLE driver with Extended Properties Pin
Dave Kreskowiak8-Nov-11 13:28
mveDave Kreskowiak8-Nov-11 13:28 
GeneralRe: Ace OLE driver with Extended Properties Pin
Alaric_15-Nov-11 9:59
professionalAlaric_15-Nov-11 9:59 
QuestionRemoving Mutex and file lock using DLL injection (Guild Wars) in C# Pin
KairuByte8-Nov-11 8:06
KairuByte8-Nov-11 8:06 
GeneralRe: Removing Mutex and file lock using DLL injection (Guild Wars) in C# Pin
harold aptroot8-Nov-11 8:37
harold aptroot8-Nov-11 8:37 
GeneralRe: Removing Mutex and file lock using DLL injection (Guild Wars) in C# Pin
KairuByte8-Nov-11 8:50
KairuByte8-Nov-11 8:50 
I hand't thought of doing that actually... I was intending to hook every process run automatically without needing to start the process with my code at all. Though I suppose suspended state would just make sense till I get things running....

At the moment I detect process start by watching for it with ManagementEventWatcher like so:

C#
string queryString =
    "SELECT TargetInstance" +
    "  FROM __InstanceCreationEvent " +
    "WITHIN  " + 1 + " " +
    " WHERE TargetInstance ISA 'Win32_Process' " +
    "   AND TargetInstance.Name = '" + processName + "'";

// The dot in the scope means use the current machine
string scope = @"\\.\root\CIMV2";

// Create a watcher and listen for events
watcher.EventArrived += ProcessStarted;
watcher.Start();


I then hook using EasyHook:

Config.Register(
     "A FileMon like demo application.",
     "FileMon.exe",
     "FileMonInject.dll");

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

RemoteHooking.Inject(
     TargetPID,
     "FileMonInject.dll",
     "FileMonInject.dll",
     ChannelName);


modified 8-Nov-11 15:01pm.

GeneralRe: Removing Mutex and file lock using DLL injection (Guild Wars) in C# Pin
harold aptroot8-Nov-11 9:01
harold aptroot8-Nov-11 9:01 
GeneralRe: Removing Mutex and file lock using DLL injection (Guild Wars) in C# Pin
KairuByte8-Nov-11 9:06
KairuByte8-Nov-11 9:06 
GeneralRe: Removing Mutex and file lock using DLL injection (Guild Wars) in C# Pin
harold aptroot8-Nov-11 9:10
harold aptroot8-Nov-11 9:10 
GeneralRe: Removing Mutex and file lock using DLL injection (Guild Wars) in C# Pin
KairuByte8-Nov-11 9:16
KairuByte8-Nov-11 9:16 
GeneralRe: Removing Mutex and file lock using DLL injection (Guild Wars) in C# Pin
harold aptroot8-Nov-11 9:20
harold aptroot8-Nov-11 9:20 
GeneralRe: Removing Mutex and file lock using DLL injection (Guild Wars) in C# Pin
KairuByte8-Nov-11 9:26
KairuByte8-Nov-11 9:26 
GeneralRe: Removing Mutex and file lock using DLL injection (Guild Wars) in C# Pin
harold aptroot8-Nov-11 9:36
harold aptroot8-Nov-11 9:36 
GeneralRe: Removing Mutex and file lock using DLL injection (Guild Wars) in C# Pin
KairuByte8-Nov-11 9:40
KairuByte8-Nov-11 9:40 
GeneralRe: Removing Mutex and file lock using DLL injection (Guild Wars) in C# Pin
harold aptroot8-Nov-11 9:45
harold aptroot8-Nov-11 9:45 
GeneralRe: Removing Mutex and file lock using DLL injection (Guild Wars) in C# Pin
Dave Kreskowiak8-Nov-11 13:23
mveDave Kreskowiak8-Nov-11 13:23 
GeneralRe: Removing Mutex and file lock using DLL injection (Guild Wars) in C# Pin
KairuByte8-Nov-11 14:20
KairuByte8-Nov-11 14:20 
AnswerRe: Removing Mutex and file lock using DLL injection (Guild Wars) in C# Pin
djdanlib8-Nov-11 9:05
djdanlib8-Nov-11 9:05 
GeneralRe: Removing Mutex and file lock using DLL injection (Guild Wars) in C# Pin
KairuByte8-Nov-11 9:13
KairuByte8-Nov-11 9:13 
GeneralRe: Removing Mutex and file lock using DLL injection (Guild Wars) in C# Pin
jschell8-Nov-11 10:08
jschell8-Nov-11 10:08 
GeneralRe: Removing Mutex and file lock using DLL injection (Guild Wars) in C# Pin
KairuByte8-Nov-11 10:19
KairuByte8-Nov-11 10:19 
GeneralRe: Removing Mutex and file lock using DLL injection (Guild Wars) in C# Pin
jschell9-Nov-11 10:57
jschell9-Nov-11 10:57 
GeneralRe: Removing Mutex and file lock using DLL injection (Guild Wars) in C# Pin
KairuByte9-Nov-11 11:08
KairuByte9-Nov-11 11:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.