external hooking/subclassing

Here you can talk about C++ And C# And Other languages programming.

external hooking/subclassing

Postby nooob » Thu Nov 23, 2006 3:49 am


hi all

does anyone have the time and skills to show a simple example of external hooking or subclassing in c#?

plz help if you do
:?

nooob
Water can make holes in rocks!
nooob
imFiles Junior
imFiles Junior
 
Posts: 52
Joined: Sun Jul 23, 2006 10:23 am

Postby BattleStar-Galactica » Sun Nov 26, 2006 1:49 am

that's a subject no f****ng moron on here can help you :lol: sure except me

but first I will ask you do you know c++ cuz you need that to create your dll or just look around google search for dll has been created for a generic hook like keyboard or mouse or cbtproc etc.


an advice you have to go to c sharp forum ask for help and read tutorial on that. that's an advanced subject and you have to read some tuto before coding a test app.

It's take too a lot time to explain you from a to z so I cannot help you


:roll: and that subject has been discussed on google search 8)
Big math problem
2 - 1 = 0 = without you I'm nothing
User avatar
BattleStar-Galactica
imFiles Master
imFiles Master
 
Posts: 565
Joined: Tue Sep 20, 2005 12:19 am
Location: safest place to hide

Postby nooob » Mon Nov 27, 2006 2:48 am

lol..ok dude...ty for your reply

i m getting a book about this hooking and subclassing thing...so hopefully i will get it....


but is it not possible to write that dll in c# instead of c++?

i will be able to write in c++ after some reading...tho*


ty nano...always appreciate your help


nooob
Water can make holes in rocks!
nooob
imFiles Junior
imFiles Junior
 
Posts: 52
Joined: Sun Jul 23, 2006 10:23 am

Postby BattleStar-Galactica » Mon Nov 27, 2006 3:19 am

I dont know and I never try to understand if it can be done in c#

I always create my dll in c++ and use MFC to do the hooking.

btw I love c# and I hate vb6 or vbnet :twisted:
Big math problem
2 - 1 = 0 = without you I'm nothing
User avatar
BattleStar-Galactica
imFiles Master
imFiles Master
 
Posts: 565
Joined: Tue Sep 20, 2005 12:19 am
Location: safest place to hide

Postby nooob » Mon Nov 27, 2006 8:02 am

:) man vbnet is ok....it goes
but vb6 <<<-- i hate it 2.. :shock:

ty man

probably i will get the book today....then i will see what i can do

BIG EDIT: I LOVE VB6 ....lol......no seriously i do :wink:
Last edited by nooob on Mon Dec 11, 2006 4:38 am, edited 1 time in total.
Water can make holes in rocks!
nooob
imFiles Junior
imFiles Junior
 
Posts: 52
Joined: Sun Jul 23, 2006 10:23 am

Postby Dody » Sun Dec 10, 2006 3:30 pm

as long as you can create you .dll call back function, then it doesn't matter if you use c++ or c# to hook it inside the target process
I have done something similar with Messenger (WLM) to hook its create window function and install my own menu there, and filters the WM_COMMAND messages and fire up my events once it has been applied from the menu

it is kinda fun, I encourge you to do some test

good luck
User avatar
Dody
imFiles Senior
imFiles Senior
 
Posts: 177
Joined: Tue Jan 04, 2005 2:44 pm

Postby nooob » Mon Dec 11, 2006 4:36 am

thx Dody....that was something i was desperate to find out but got no direct answer...then i got the book "Subclassing and hooking with visual basic"...so i got the concepts of hooking and subclassing..but the book doesnt talk about external hooking (which i wanted). but luckily i found a good example of external hooking (the dll is in c++ and the and this dll is used from within visual basic 6)....but i have another laptop (the old had a problem) and i havent got vb6 on this pc...lol....damn many problems

i tried that dll from vc# 2005...but doesnt work...the hook doesnt get set...

i started a new thread to see if someone can help me with getting a free copy of vb6


thx again dody for your time


nooob
Water can make holes in rocks!
nooob
imFiles Junior
imFiles Junior
 
Posts: 52
Joined: Sun Jul 23, 2006 10:23 am

Postby Dody » Mon Dec 11, 2006 6:17 am

you seem to be confused, so let me break it up to you...

first of all you create your .dll hook and make sure your call back function it exportable

then import tha .dll into your project and import the callback function using GetProcAddress into the hook process, then use SetWindowsHookEx to hook the .dll into the target process

I hope that will make it clear for you, otherwise ask again, because I have a little time these days (just passed my MySQL course)

good luck
User avatar
Dody
imFiles Senior
imFiles Senior
 
Posts: 177
Joined: Tue Jan 04, 2005 2:44 pm

Postby BattleStar-Galactica » Mon Dec 11, 2006 11:43 am

so you know what is SetWindowHookEx and SetWindowLong, now we can discuss about hooking :wink:
Big math problem
2 - 1 = 0 = without you I'm nothing
User avatar
BattleStar-Galactica
imFiles Master
imFiles Master
 
Posts: 565
Joined: Tue Sep 20, 2005 12:19 am
Location: safest place to hide

Postby nooob » Mon Dec 11, 2006 1:05 pm

lol..nano..i guess now i do :P

dody ty man...i got it...based on that example i got from a site...but i can develope on it----hopefully

nano..its just because...i havent programmed in c/c++....so all these "bad notations" like _tmain...(something*)..etc lol....they scare me


but seems like...i am getting something


nooob
Water can make holes in rocks!
nooob
imFiles Junior
imFiles Junior
 
Posts: 52
Joined: Sun Jul 23, 2006 10:23 am

Postby BattleStar-Galactica » Mon Dec 11, 2006 1:21 pm

where are you stuck and what do you want to do, give us some point we can help you if you understand hooking and subclassing

what kind of hooking do you want to do
Big math problem
2 - 1 = 0 = without you I'm nothing
User avatar
BattleStar-Galactica
imFiles Master
imFiles Master
 
Posts: 565
Joined: Tue Sep 20, 2005 12:19 am
Location: safest place to hide

Postby Dody » Mon Dec 11, 2006 4:06 pm

SetWindowHookEx is just the start of the hooking... the advance hooking is done by detours... check it out ;)
and yes I know what SetWindowHookEx, c++ is my study and my job :)

good luck nooob, I am glad you got it...
User avatar
Dody
imFiles Senior
imFiles Senior
 
Posts: 177
Joined: Tue Jan 04, 2005 2:44 pm

Postby BattleStar-Galactica » Mon Dec 11, 2006 5:04 pm

nanomachine007 wrote:so you know what is SetWindowHookEx and SetWindowLong, now we can discuss about hooking :wink:



that was for noob not for you dody, yep setwindowhookex is just a starting point of hook and if it combined with setwindowlong is became very interesting.
Big math problem
2 - 1 = 0 = without you I'm nothing
User avatar
BattleStar-Galactica
imFiles Master
imFiles Master
 
Posts: 565
Joined: Tue Sep 20, 2005 12:19 am
Location: safest place to hide

Postby Dody » Mon Dec 11, 2006 7:57 pm

nanomachine007 wrote:
nanomachine007 wrote:so you know what is SetWindowHookEx and SetWindowLong, now we can discuss about hooking :wink:



that was for noob not for you dody, yep setwindowhookex is just a starting point of hook and if it combined with setwindowlong is became very interesting.


I apologize for my misunderstanding, and I am sorry if my post was offensive, I didn't mean to hurt anyone I was trying to clear up... I apologize once again nanomachine...

best wishes to both of you guys
User avatar
Dody
imFiles Senior
imFiles Senior
 
Posts: 177
Joined: Tue Jan 04, 2005 2:44 pm

Postby nooob » Tue Dec 12, 2006 3:39 am

lol...nooob is creating problems.... :lol:

thx guys.....dody and nano...

i was trying to get WH_GETMESSAGE hook implemented...to hook the notepad.

now that i have a complete example....hopefullly i can elaborate on it...also i have a book that has an example on the 15 (or 16) types of hooks..and also example of subclassing...

i apprecitae your help ...nano and oddy ...thank you

how can you find out if a message is "sent" or "posted"....?
Water can make holes in rocks!
nooob
imFiles Junior
imFiles Junior
 
Posts: 52
Joined: Sun Jul 23, 2006 10:23 am

Next

Return to C++, C# And Others Programming

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 0 guests