Page 1 of 1

PInvoke is safe?

Posted: Tue Aug 29, 2017 7:26 pm
by bigguy
Hello, I am wondering if it is safe to virtualize a Export method and then PInvoke from C# UI program?

Also from my testing if "GetStatusCode" is not virtualized it cannot access other virtualized functions :D

Example:

C++

Code: Select all

extern "C"
{
   __declspec(dllexport) int __cdecl GetStatusCode();
}

// Virtualized.
int GetStatusCode() {
   return ProtectMethod(); // Virtualized also
}

Re: PInvoke is safe?

Posted: Wed Aug 30, 2017 4:02 am
by Admin
Please notice that any function called from C# isn't safe because a cracker can change the result in your .NET application without modification of the protected DLL.

Re: PInvoke is safe?

Posted: Thu Aug 31, 2017 5:38 pm
by bigguy
Doesn't matter if they modify the C# application since it only processes and displays data through the protected DLL. They would need to modify the DLL for them to do some damage.

My question is if Exported functions that are protected are as safe as normal ones.

Edit: also doesn't matter if they change the real data in c# app since it would be useless and just a fake screen since most requests are processed by a server.

Re: PInvoke is safe?

Posted: Sat Sep 02, 2017 4:57 am
by Admin
My question is if Exported functions that are protected are as safe as normal ones.

Yes, it's also safe.