Skip to content

external hooking/subclassing

Viewing 15 posts - 1 through 15 (of 23 total)
  • Author
    Posts
  • #191323
    nooob
    Member

    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

    #191345

    that’s a subject no fucking moron on here can help you 😆 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

    🙄 and that subject has been discussed on google search 8)

    #191344
    nooob
    Member

    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

    #191343

    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 😈

    #191342
    nooob
    Member

    🙂 man vbnet is ok….it goes
    but vb6 <<<– i hate it 2.. 😯

    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 😉

    #191341
    Dody
    Member

    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

    #191340
    nooob
    Member

    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

    #191339
    Dody
    Member

    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

    #191338

    so you know what is SetWindowHookEx and SetWindowLong, now we can discuss about hooking 😉

    #191337
    nooob
    Member

    lol..nano..i guess now i do 😛

    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

    #191336

    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

    #191335
    Dody
    Member

    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…

    #191334

    @nanomachine007 wrote:

    so you know what is SetWindowHookEx and SetWindowLong, now we can discuss about hooking 😉

    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.

    #191333
    Dody
    Member

    @nanomachine007 wrote:

    @nanomachine007 wrote:

    so you know what is SetWindowHookEx and SetWindowLong, now we can discuss about hooking 😉

    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

    #191332
    nooob
    Member

    lol…nooob is creating problems…. 😆

    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”….?

Viewing 15 posts - 1 through 15 (of 23 total)
  • You must be logged in to reply to this topic.