Hey guys! So if anyone's been keeping up to date with my thread they'll know that I recently had a major breakthrough.
My thing is this,
Early on I declare a function pointer of type unsigned __int32 with __cdecl calling convention
Code:
typedef unsigned __int32 (__cdecl *ICalcLpqChecksum)(void*, unsigned __int32);
** I used LoadLibrary btw**
Then later on I initialize it to GetProcAddress of one of the functions inside of LagerPacket.dll
Code:
ICalcLpqChecksum CalcLpqChecksum = (ICalcLpqChecksum)GetProcAddress(hLagerDLL, "?CalcLpqChecksum@@YAKPAXK@Z");
And this works just fine. I can create a void pointer and assign it to the & of a string which allows me to successfully call the function and return an unsigned __int32.
However, that's just for a plain function. I need to reference a class inside the DLL from my main program. I can't seem to do it. Yes, I've tried Google and every possible keyword combination I could think of, and it's possible that I don't know what to ask so I'm not getting the result I need.
This is my problem:
There's a class called ILagerPacket (there's other classes too but I just need to learn how to access one obviously)
So inside IDA I get this:
ILagerPacket::ILagerPacket(void)
ILagerPacket::~ILagerPacket(void)
ILagerPacket::ILagerPacket(ILagerPacket const &)
If I try referring to the constructor, it fails, same for the destructor. However I'm not sure what the third reference is. Another constructor?
Also, if a constructor isn't a function (which I think it is??) then how do I reference it so I can call the constructor?
IDA disassembly view of ILagerPacket::ILagerPacket(void)
Code:
; _DWORD __thiscall ILagerPacket::ILagerPacket(ILagerPacket *__hidden this)
public ??0ILagerPacket@@QAE@XZ
??0ILagerPacket@@QAE@XZ proc near ; DATA XREF: .rdata:off_3CDF28o
mov eax, ecx
mov dword ptr [eax], offset ??_7ILagerPacket@@6B@ ; const ILagerPacket::`vftable'
retn
??0ILagerPacket@@QAE@XZ endp
IDA disassembly view of ILagerPacket::~ILagerPacket(void)
Code:
; _DWORD __thiscall ILagerPacket::~ILagerPacket(ILagerPacket *__hidden this)
public ??1ILagerPacket@@UAE@XZ
??1ILagerPacket@@UAE@XZ proc near ; CODE XREF: sub_3C98C0+3j
; sub_3C9920+3j ...
dword ptr [ecx], offset ??_7ILagerPacket@@6B@ ; const ILagerPacket::`vftable'
retn
??1ILagerPacket@@UAE@XZ endp
IDA disassembly view of ILagerPacket::ILagerPacket(ILagerPacket const &)
Code:
; public: __thiscall ILagerPacket::ILagerPacket(class ILagerPacket const &)
public ??0ILagerPacket@@QAE@ABV0@@Z
??0ILagerPacket@@QAE@ABV0@@Z proc near ; DATA XREF: .rdata:off_3CDF28o
mov eax, ecx
mov dword ptr [eax], offset ??_7ILagerPacket@@6B@ ; const ILagerPacket::`vftable'
retn 4
??0ILagerPacket@@QAE@ABV0@@Z endp
Funny enough, there's a function inside of class CLpqPatcher called CreatePatchFile(void). I can reference it and call it, however I haven't figured out the proper parameters yet so it crashes on me. But I can't reference the constructor.
Help please...