getprocaddress

Posts 1–6 of 6 · Page 1 of 1
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?
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
so CreateInterface is the exported function of client.dll?
Quote Originally Posted by kibbles18 View Post
so CreateInterface is the exported function of client.dll?
Probably yes, unless that function fails.
one last question :P - is an exported function a function that the main program imported or w/e to use from client.dll?
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.
Posts 1–6 of 6 · Page 1 of 1

Post a Reply

Tags for this Thread

None

Talk with us