PInvoke is safe?

Discussion of other issues
Post Reply
bigguy
Posts: 10
Joined: Thu Feb 09, 2017 3:21 pm
Location: Pyongyang, North Korea

PInvoke is safe?

Post 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
}
Admin
Site Admin
Posts: 2562
Joined: Mon Aug 21, 2006 8:19 pm
Location: Russia, E-burg
Contact:

Re: PInvoke is safe?

Post 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.
bigguy
Posts: 10
Joined: Thu Feb 09, 2017 3:21 pm
Location: Pyongyang, North Korea

Re: PInvoke is safe?

Post 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.
Admin
Site Admin
Posts: 2562
Joined: Mon Aug 21, 2006 8:19 pm
Location: Russia, E-burg
Contact:

Re: PInvoke is safe?

Post by Admin »

My question is if Exported functions that are protected are as safe as normal ones.
Yes, it's also safe.
Post Reply