A forum for reverse engineering, OS internals and malware analysis 

Discussion on reverse-engineering and debugging.
 #4054  by Mehdi
 Sat Dec 18, 2010 7:05 am
Hi
I am forwarding an exported function of a DLL to another function in my DLL. I use ExpX64 for editing the export table of the DLL.
(for example I forward the ?MyFunc@MyClass@@SAJJAEAUMyStruct@@@Z to myDLL.?MyFunc@MyClass@@SAJJAEAUMyStruct@@@Z)
My problem is that my target function is a member of a class and in runtime, forwarding that generates a COMException (An object has ceased to exist)
What do you think I'm doing wrong? (Calling conventions? And there should be a difference between forwarding a regular function and a class-member one.)
I implement MyFunc like this:
Code: Select all
__declspec(dllexport) LONG MyClass::MyFunc (long a,struct MyStruct& b)
ps: I can also use a DLL proxy (create a proxy DLL that implements the target function I want and forward all other functions to the original DLL, but the problem that my function is part of a class, still remains)

Thanks
 #4063  by Mehdi
 Sun Dec 19, 2010 9:04 am
Hi
Thank you. You're right it was a problem with calling convention which I solved