how hook in my .exe without use one dll?

delphi package - getting into other processes
Post Reply
break
Posts: 8
Joined: Fri May 23, 2008 1:37 pm

how hook in my .exe without use one dll?

Post by break »

I would example

tkssssss:)
iconic
Site Admin
Posts: 1027
Joined: Wed Jun 08, 2005 5:08 am

Post by iconic »

This is the madRemote section of the forum, I think you want to visit the madCodeHook area. Anyhow, do you mean hook in your own process executable? If this is the case madCodeHook.HookAPI() and madCodeHook.HookCode() is all you need.

--Iconic
break
Posts: 8
Joined: Fri May 23, 2008 1:37 pm

oh sorry icon

Post by break »

Friend..

the examples of madshi are all with dll ok?

I need only how change to hook in my own .exe

only my .exe to never killed

I need protect my program com terminateprocess e exitprocess whithout dll
only :)


Do u have one example?
tks
madshi
Site Admin
Posts: 10527
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

Sorry for the late reply!

In the NT family doing API hooking only ever affects the current process. But if the user e.g. uses the task manager to terminate your application then TerminateProcess is called in the context of the task manager and NOT in the context of your process. So in order to stop the user from doing that you'd need to hook the TerminateProcess API in the context of the task manager. Now it's theoretically possible to do this without using a dll, but it'd be difficult as hell. So you better stop thinking about realizing this without using a dll.
iftijafar
Posts: 1
Joined: Thu Dec 23, 2010 7:16 pm
Contact:

Re: how hook in my .exe without use one dll?

Post by iftijafar »

By the way, you can have many global hooks, not just one. The biggest consideration is that the hook code needs to be very fast/efficient because it is getting control for every keystrok
Post Reply