Thread: getprocaddress

Results 1 to 6 of 6
  1. #1
    kibbles18's Avatar
    Join Date
    Oct 2008
    Gender
    male
    Location
    US
    Posts
    860
    Reputation
    5
    Thanks
    127

    getprocaddress

    what is this used for? in this example it is used like this as a hook:
    Code:
    ClientFactory = (CreateInterfaceFn)GetProcAddress(GetModuleHandle("client.dll"),"CreateInterface");
    also, how did this person know what CreateInterface was?

  2. #2
    .::SCHiM::.'s Avatar
    Join Date
    Sep 2010
    Gender
    male
    Posts
    733
    Reputation
    180
    Thanks
    880
    My Mood
    Twisted
    Quote Originally Posted by kibbles18 View Post
    what is this used for? in this example it is used like this as a hook:
    Code:
    ClientFactory = (CreateInterfaceFn)GetProcAddress(GetModuleHandle("client.dll"),"CreateInterface");
    also, how did this person know what CreateInterface was?
    GetProcAddress finds the base address of an exported function inside a dll. That base address is found by GetModuleHandle() (although Microsoft calls it a HANDLE)

    This looks like it came from a hack for games operating on valve's source engine. To answer your second question: This person probably had access to the source SDK (which is available for free) or (if he had too much time on his hands) reversed the classes and structs and used those.

    I hope that answers your questions

    I'm SCHiM

    Morals derive from the instinct to survive. Moral behavior is survival behavior above the individual level.

    Polymorphic engine
    Interprocess callback class
    SIN
    Infinite-precision arithmetic
    Hooking dynamic linkage
    (sloppy)Kernel mode Disassembler!!!

    Semi debugger




  3. The Following 3 Users Say Thank You to .::SCHiM::. For This Useful Post:

    Hell_Demon (06-30-2011),kibbles18 (06-30-2011),whit (06-30-2011)

  4. #3
    kibbles18's Avatar
    Join Date
    Oct 2008
    Gender
    male
    Location
    US
    Posts
    860
    Reputation
    5
    Thanks
    127
    so CreateInterface is the exported function of client.dll?

  5. #4
    .::SCHiM::.'s Avatar
    Join Date
    Sep 2010
    Gender
    male
    Posts
    733
    Reputation
    180
    Thanks
    880
    My Mood
    Twisted
    Quote Originally Posted by kibbles18 View Post
    so CreateInterface is the exported function of client.dll?
    Probably yes, unless that function fails.

    I'm SCHiM

    Morals derive from the instinct to survive. Moral behavior is survival behavior above the individual level.

    Polymorphic engine
    Interprocess callback class
    SIN
    Infinite-precision arithmetic
    Hooking dynamic linkage
    (sloppy)Kernel mode Disassembler!!!

    Semi debugger




  6. The Following User Says Thank You to .::SCHiM::. For This Useful Post:

    kibbles18 (07-01-2011)

  7. #5
    kibbles18's Avatar
    Join Date
    Oct 2008
    Gender
    male
    Location
    US
    Posts
    860
    Reputation
    5
    Thanks
    127
    one last question :P - is an exported function a function that the main program imported or w/e to use from client.dll?

  8. #6
    Nico's Avatar
    Join Date
    Jan 2011
    Gender
    male
    Location
    Germany :D
    Posts
    15,918
    Reputation
    1121
    Thanks
    8,617
    Quote Originally Posted by kibbles18 View Post
    one last question :P - is an exported function a function that the main program imported or w/e to use from client.dll?
    The main program (in this case a source engine game) uses the CreateInterface from different dlls (client.dll, server.dll, ...) to get access to interfaces provided by them. For example the engine or the gui.