Using VMProtect in C# DllExport

Issues related to VMProtect
Post Reply
MaxCDN
Posts: 4
Joined: Tue Mar 15, 2022 4:10 am

Using VMProtect in C# DllExport

Post by MaxCDN »

I'm currently using https://github.com/3F/DllExport to compile C# into a DLL and export functions for use by other applications.

When I try to protect the compiled DLL with VMProtect, other programs cannot use this VMProtect protected DLL normally (eg. C# System.AccessViolationException)

I don't know how to fix this, I need help
Attachments
Release.7z
(244.29 KiB) Downloaded 112 times
CsharpDLL.7z
project files
(2.87 MiB) Downloaded 92 times
Admin
Site Admin
Posts: 2566
Joined: Mon Aug 21, 2006 8:19 pm
Location: Russia, E-burg
Contact:

Re: Using VMProtect in C# DllExport

Post by Admin »

You have to switch off the packing feature.
MaxCDN
Posts: 4
Joined: Tue Mar 15, 2022 4:10 am

Re: Using VMProtect in C# DllExport

Post by MaxCDN »

it looks like the source code can be viewed directly by dnSpy as long as I turn off the Packing feature.
Admin
Site Admin
Posts: 2566
Joined: Mon Aug 21, 2006 8:19 pm
Location: Russia, E-burg
Contact:

Re: Using VMProtect in C# DllExport

Post by Admin »

It seems you don't know how to use our software properly. The packing feature doesn't protect anything!
MaxCDN
Posts: 4
Joined: Tue Mar 15, 2022 4:10 am

Re: Using VMProtect in C# DllExport

Post by MaxCDN »

Oh, shit. I manually added the VMProtect.BeginUltra flag to the function to be protected and it worked, although dnSpy can still view the source code directly, but it's very hard to read (I can't read it)

It seems my previous usage has been wrong, I didn't use VMProtect SDK to mark functions before, I simply used VMProtect to package the output file

Sorry for the delay, our problem has been solved
Admin
Site Admin
Posts: 2566
Joined: Mon Aug 21, 2006 8:19 pm
Location: Russia, E-burg
Contact:

Re: Using VMProtect in C# DllExport

Post by Admin »

We recommend to use [Obfuscation(Feature = "ultra", Exclude = false)] instead of VMProtect.BeginUltra.
MaxCDN
Posts: 4
Joined: Tue Mar 15, 2022 4:10 am

Re: Using VMProtect in C# DllExport

Post by MaxCDN »

Thanks for the tip !

However, we have chosen to use VMProtect.BeginUltra

Our obfuscator removes the System.Reflection.Obfuscation flag
Admin
Site Admin
Posts: 2566
Joined: Mon Aug 21, 2006 8:19 pm
Location: Russia, E-burg
Contact:

Re: Using VMProtect in C# DllExport

Post by Admin »

Don't use other obfusactor/protector before VMProtect.
Post Reply