Driver instalation, infm cat files

c++ / delphi package - dll injection and api hooking
Post Reply
pinya
Posts: 18
Joined: Tue Feb 05, 2013 4:39 am

Driver instalation, infm cat files

Post by pinya »

Can you explain how the driver is installed on the system?

What inside mystery function InstallInjectionDriver ?
What I shoud do with inf and cat file? I have it after signing the driver.
pinya
Posts: 18
Joined: Tue Feb 05, 2013 4:39 am

Re: Driver instalation, infm cat files

Post by pinya »

ver. 3.2.1

and I can't find any sample for InstallInjectionDriver...

My problem:

IsInjectionDriverInstalled(L"mydrv") and StartInjectionDriver(L"mydrv") return true
but
InjectLibrary failed, GetLastError return 0.
madshi
Site Admin
Posts: 10764
Joined: Sun Mar 21, 2004 5:25 pm

Re: Driver instalation, infm cat files

Post by madshi »

InstallInjectionDriver internally uses the win32 API "CreateService". You don't need the inf and cat files.

Your process which calls InjectLibrary, does it have admin rights? And did you call InitializeMadCHook() before injecting? Which exact value is InjectLibrary returning? 0?
pinya
Posts: 18
Joined: Tue Feb 05, 2013 4:39 am

Re: Driver instalation, infm cat files

Post by pinya »

i do call InitializeMadCHook();

InjectLibrary return 0.

I try put all in the same dir, but have same result.

How can I check configuration of my driver?

madConfigDrv.exe return nothing.

first I sign dll, then call madConfigDrv.exe, then sign driver.

Now OS is WinXP 32 bit. admin rights.
Last edited by pinya on Tue Feb 05, 2013 8:37 am, edited 1 time in total.
madshi
Site Admin
Posts: 10764
Joined: Sun Mar 21, 2004 5:25 pm

Re: Driver instalation, infm cat files

Post by madshi »

Please show me the configuration command line, the sign command line, and all your injection related code (Install/LoadInjectionDriver, InjectLibrary etc).
pinya
Posts: 18
Joined: Tue Feb 05, 2013 4:39 am

Re: Driver instalation, infm cat files

Post by pinya »

seems I made mistake in madConfigDrv.exe params..
pinya
Posts: 18
Joined: Tue Feb 05, 2013 4:39 am

Re: Driver instalation, infm cat files

Post by pinya »

from docs:
// installing the same driver twice fails succeeds and updates all parameters

but I try to call InstallInjectionDriver then driver already installed, it reruns 0. Why?
madshi
Site Admin
Posts: 10764
Joined: Sun Mar 21, 2004 5:25 pm

Re: Driver instalation, infm cat files

Post by madshi »

Are you calling it with the same parameters? If the parameters are different, madCodeHook tries to stop the driver, change the parameters, then restart it. The stopping might fail if the driver is configured to not allow stopping. In that case InstallInjectionDriver will return 0.
pinya
Posts: 18
Joined: Tue Feb 05, 2013 4:39 am

Re: Driver instalation, infm cat files

Post by pinya »

ok.

How can I update my driver? Simple replace .sys file? Does it work on 64bit system?
madshi
Site Admin
Posts: 10764
Joined: Sun Mar 21, 2004 5:25 pm

Re: Driver instalation, infm cat files

Post by madshi »

If the driver is loaded (or installed and running), simply replacing the sys file will have no effect until the next time the PC is rebooted. If you want to update it immediately, you need to replace the sys file and then additionally stop and restart (or stop and reload) the driver. Whether you can stop the driver and under which conditions you can stop the driver depends on how you configured it (see documentation).
Post Reply