.NET Dotfuscator or something else?
-
- KVRian
- 522 posts since 19 Jul, 2007 from Netherlands
PInvoke is great if you want to call out to static unmanaged API functions (like Win32 API) from within your managed code (C#/VB.NET).
However, to be a VST Plugin you have to implement C++ function pointers and manage unmanaged memory (at the interface level, not the class(es) you get in the SDK). That is not something you can do with PInvoke, so I used managed C++. There is another trick you can use, but that involves rewriting the assembly after it has been built.
In VST.NET the Interop assemlby uses the managed C++ extension to marshal from unmanaged to managed and visa versa. For instance, there is code in there to load an unmanaged plugin if you want to write a managed Host -or- to 'fake' an unmanaged plugin in order to be loaded into an unmanaged host.
However, to be a VST Plugin you have to implement C++ function pointers and manage unmanaged memory (at the interface level, not the class(es) you get in the SDK). That is not something you can do with PInvoke, so I used managed C++. There is another trick you can use, but that involves rewriting the assembly after it has been built.
In VST.NET the Interop assemlby uses the managed C++ extension to marshal from unmanaged to managed and visa versa. For instance, there is code in there to load an unmanaged plugin if you want to write a managed Host -or- to 'fake' an unmanaged plugin in order to be loaded into an unmanaged host.
-
- KVRist
- 327 posts since 13 Nov, 2002 from Germany, Darmstadt
People really still use managed C++ when there is C++/CLI? __gc, __box ... everywhere. It was so ugly. OK, C++ generally tends to be ugly but managed C++ was even far worse.
-
Stupid American Pig Stupid American Pig https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=4753
- KVRAF
- 7065 posts since 25 Nov, 2002 from not sure
Maybe its my puny brain, but it sounds like writing the managed extension is an order of magnitude more difficult than just writing the plugin in C++.
So what is your day to day job obiwan?
So what is your day to day job obiwan?
-
- KVRian
- 522 posts since 19 Jul, 2007 from Netherlands
Writing the library to allow devs to write managed plugin is more complex, but writing the plugin itself, is way more simpler and faster (dev time).Stupid American Pig wrote:Maybe its my puny brain, but it sounds like writing the managed extension is an order of magnitude more difficult than just writing the plugin in C++.
So what is your day to day job obiwan?
I am a Solutions Architect/Lead developer working for a Dutch IT company specializing in Microsoft technology. I'm specialized in system integration solutions.
-
- KVRAF
- Topic Starter
- 6427 posts since 22 Jan, 2005 from Sweden
Indeed it helped. Looks cool. Thanks a lot.obiwanjacobi wrote:I've used http://code.google.com/p/obfuscar/ in the past in combination with ILMerge (MS research). Its perfect to discourage prying eyes.
If you want the full fledged battle ship you might like .NET Reactor. http://www.eziriz.com/ They say they've never been cracked...
Hope it helps.
-
- KVRer
- 1 posts since 18 Apr, 2014
The Dotfuscator that comes with Visual Studio is pretty basic while the Pro edition is quite expensive. Some others like Crypto Obfuscator offer good protection and is reasonably priced.