TheSwamp

Code Red => .NET => Topic started by: jmaeding on September 19, 2016, 12:02:06 PM

Title: Packer/obfuscator recommendation?
Post by: jmaeding on September 19, 2016, 12:02:06 PM
I saw the post with a big list, and wanted to use .net reactor.
I tried the trial and it would not protect my dll because it could not find the acad managed dll's in my assembly folder.
Those are false for "Copy Local" so not in the folder of course.
Anyone got .net reactor to work for acad?

Also, I do a lot of serialization, and some code uses reflection.
I read that causes problems, and I want my xml to be human readable so it can be checked and hacked if needed.
Has anyone spent some time on this and compared and come up with their favorite?

I know all can be deobfuscated, btw.
Title: Re: Packer/obfuscator recommendation?
Post by: Keith Brown on September 19, 2016, 12:33:12 PM
.NET Reactor works just fine for ACAD.  As I mentioned in the post on the official forums (http://forums.autodesk.com/t5/net/using-net-reactor-product-to-protect-code/m-p/6567388#M50223) all you need to do if you want to keep your Copy Local equal to false is copy the AutoCAD dlls to the folder where you have the dll to be obsfucated.  It is as easy as that.  .NET Reactor just needs to find the referenced dlls, it does not interact with them.  Your other option is to set your Copy Local equal to true and then set your working directory to the AutoCAD Directory as shown below.  When you netload your dll it will use the installed AutoCAD dlls instead.


I have been using this setup for 1.5 years and the company I have been working for has been using it for many more beyond that without any issues.

(https://c5.staticflickr.com/9/8897/29757177396_7aa1a94b18_b.jpg)


I serialize to xml all of the time and have no issues.  My main custom settings files use xml and it is human readable and editable without any problems.  In addition, I serialize many classes and then add them as xdata to entities in the extension dictionary.  For me it is easier to do then to create XData.   I have a flag that I use to also save the xml to disk so that I can make sure that everything saves correctly.
Title: Re: Packer/obfuscator recommendation?
Post by: jmaeding on September 19, 2016, 05:46:43 PM
Indeed, I totally missed your reply which is rare for me as I always watch email for replies.
Marked it as the solution, fed it to me like a baby :)
thanks a bunch!

Title: Re: Packer/obfuscator recommendation?
Post by: jmaeding on September 19, 2016, 05:54:52 PM
btw, one thing I do is add a script to the startup params, like:
/nologo /p "HA_C3D2015" /product C3D /b "C:\Programming\DotNet\myprog\Load Myprog.scr"

and the Load Myprog.scr is like:
netload
"C:\\Programming\\DotNet\\myprog\\bin\\Debug\\R20\\myassembly.dll"

So I don't have to do  a manual netload.
Curious why you don't do the same, I think that trick is fairly well known.
Title: Re: Packer/obfuscator recommendation?
Post by: Keith Brown on September 19, 2016, 08:52:20 PM
My Dlls auto register themselves after the first run so it's not needed.  I work with several different versions of the same dll so when I need to change the version I just need to run net load again.
Title: Re: Packer/obfuscator recommendation?
Post by: Jeff_M on September 19, 2016, 11:08:12 PM
I have my dll's build into a .bundle folder so they always autoload.
Title: Re: Packer/obfuscator recommendation?
Post by: nobody on September 25, 2016, 01:37:48 AM
I'm not clear on everything the question encompasses but I've been using Eazfuscator for a while and have not experienced any problems.
Title: Re: Packer/obfuscator recommendation?
Post by: CADbloke on October 04, 2016, 09:36:22 PM
http://stackoverflow.com/a/5488752/492 is a great rant about the downsides of obfuscation etc.

Also: http://www.offbyzero.com/resources/software_protection_licensing

and http://www.codeproject.com/Articles/7312/Piracy-and-Unconventional-Wisdom
Title: Re: Packer/obfuscator recommendation?
Post by: CADbloke on October 07, 2016, 08:24:33 AM
I just tried https://github.com/yck1509/ConfuserEx on a simple .NET AutoCAD plugin and it seems to work well. I opened it in DotPeek and the code looked even more unfathomable than when I wrote it. I didn't try any ILDASM or Anti-tampering stuff yet. It's worth a look at, although that repo was recently abandoned - https://yck1509.github.io/ConfuserEx/2016/07/01/confuserex-discontinue . Upside, it has been forked 357 times (https://github.com/yck1509/ConfuserEx/network) and this repo looks active (https://github.com/ennerperez/ConfuserEx). Also, it works (so far) and it's free.

It was easy enough to use but it did want to see local copies of the usual .NET AutoCAD DLL triad. It didn't obfuscate them but it wanted to see them.

... see attached pic - de4dot can't do much with it. That's encouraging.