0

It should be possible to get an class object from an dll without the corresponding dll header file!? But how can I make the typedef of the class for GetProcAddress without known type from header file?

Have you an example?!

Thanks and greets,

leon22

leon22
  • 5,280
  • 19
  • 62
  • 100
  • Do you mean the class definition instead? With a `typedef` you define a new name for an existing type or an aggregate of types, like `typedef int Array[3];` – harper Apr 06 '11 at 11:07

3 Answers3

0

GetProcAddress gives you the address of a function. When you have the full decorated name of a C++ class member function, you can get the address of it. With the same information you can get the signature of the method with the undname utility.

But you will need the header file to get class definition itself.

harper
  • 13,345
  • 8
  • 56
  • 105
0

If you don't know the types involved, you can't call a function, and that's pretty much the end of that.

Puppy
  • 144,682
  • 38
  • 256
  • 465
0

If I understand your question correctly, you want the address of an object (i.e. an instance) in the DLL. GetProcAddr won't give you that, but it can give you the address of a function that can, in turn, give you the address of the object, if such a function exists in the DLL. if that function has extern "C" linkage, there won't be any name mangling either.

rlc
  • 2,808
  • 18
  • 23
  • I have already that dll function and it works fine, but when we make any changes in the header file we must recompile the whole project! – leon22 Apr 06 '11 at 11:41