Help❓ (C++) Prototype class from foreign DLL

Posts 1–4 of 4 · Page 1 of 1
❓ (C++) Prototype class from foreign DLL
My specific help request is this:

I have a certain DLL file which I've loaded with LoadLibrary, and it works fine.

I can call a function CalcLpqCheckSum just fine, parameters are CalcLpqCheckSum(void*, int)

However, other functions all appear to be classes:

[IMG]kingofkings4.000webhostapp.com/ida_mpgh_q.png[/IMG]

I can reference them just fine in my code but when I call the function my application freezes and crashes.
Depending on what I do, I get various 32bit return values.

[IMG]kingofkings4.000webhostapp.com/ida_mpgh_q2.png[/IMG]

How do I properly create a prototype of a class from a foreign DLL in my program?

Also, can anyone tell me what is going on in the first picture? I lack the understanding of how these functions are designed and how to prototype them.

Even if I prototype directly from a function address I still can't call the LpqSystem function with or without parameters. It crashes regardless.
Quote Originally Posted by VXP View Post
My specific help request is this:

I have a certain DLL file which I've loaded with LoadLibrary, and it works fine.

I can call a function CalcLpqCheckSum just fine, parameters are CalcLpqCheckSum(void*, int)

However, other functions all appear to be classes:

[IMG]kingofkings4.000webhostapp.com/ida_mpgh_q.png[/IMG]

I can reference them just fine in my code but when I call the function my application freezes and crashes.
Depending on what I do, I get various 32bit return values.

[IMG]kingofkings4.000webhostapp.com/ida_mpgh_q2.png[/IMG]

How do I properly create a prototype of a class from a foreign DLL in my program?

Also, can anyone tell me what is going on in the first picture? I lack the understanding of how these functions are designed and how to prototype them.

Even if I prototype directly from a function address I still can't call the LpqSystem function with or without parameters. It crashes regardless.

I am a bit confused as to what you're doing. If I understand your post correctly, you have some DLL file, and you are unpacking that file using some library called "LoadLibrary", and then you would like to construct the protoype for a specific class? What exactly are you trying to do? Maybe explain the bigger picture, so that way it will easier for others to chime in and help.
Quote Originally Posted by VXP View Post
-snip-
If you say the parameters are a void pointer and an int, why do you call it like LpqSystem(void*)?
The void* is also certain the this pointer, so the current object.

Attach the debugger to CalcLpqCheckSum and check out what variables are passed to LpqSystem, if the void* parameter is the pointer to the current object then that's great and you don't have to call the function with that parameter.
Quote Originally Posted by Azuki View Post
Attach the debugger to CalcLpqCheckSum and check out what variables are passed to LpqSystem, if the void* parameter is the pointer to the current object then that's great and you don't have to call the function with that parameter.
So if I called LpqSystem(this*); it should work?
Sorry for asking I just don't have the time at the moment to mess around, I'll come back to this.
Posts 1–4 of 4 · Page 1 of 1

Post a Reply

Similar Threads

Talk with us