Red Gate forums :: View topic - Plugin
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SmartAssembly 5
SmartAssembly 5 forum

Plugin

Search in SmartAssembly 5 forum
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.
Jump to:  
Author Message
Ben1628



Joined: 01 Jul 2010
Posts: 9

PostPosted: Thu Jul 01, 2010 3:44 pm    Post subject: Plugin Reply with quote

Are we able to obsfuscate plugins that are called by the main exe?

What do we need to do to make sure the interface is visible to the main exe?

While we're on this subject, is there anyway we can embed or merge the plugin using smartassembly. Currently, the main exe is loading the dll from a directory, we would like to change it so it is loading it from the embed assembly instead.
Back to top
View user's profile Send private message
Paul.Martin



Joined: 03 Feb 2010
Posts: 83
Location: Cambridgeshire

PostPosted: Thu Jul 01, 2010 5:03 pm    Post subject: Reply with quote

You can obfuscate any pure .NET assembly, you just need to create a new SmartAssembly project for the plugin assembly and build it with the protection you want to apply.

If your plugin is a library (.dll) then SmartAssembly will leave all public interfaces, types and methods visible.
If your plugin is an executable (.exe) then SmartAssembly will obfuscate (effectively hiding) everything by default.
You can override the default behavior by using the <ExcludePublicMembers> attribute in the SmartAssembly project file (*.saproj). This enables you to treat EXE files in a similar way to DLL files.

To exclude public members from obfuscation, specify a value of '1' for the project file:
Code:

<Obfuscation ExcludePublicMembers="1" Obfuscate="1">...
</Obfuscation>



As long as your main exe references the plugin you can embed or merge the plugin.

If you don't have a reference to the plugin in the executable and can't add one (for instance if you want dynamically choose which plugins to load at runtime) then it is not currently possible to embed or merge the the plugin using SmartAssembly.
If you can't embed the plugin you can manually do it, see http://www.codeproject.com/KB/DLL/EmbedAssemblyAsResource.aspx, although this is more of a pain to do and doesn't do any encryption or compression on the embedded plugin assembly.


Last edited by Paul.Martin on Thu Jul 01, 2010 5:10 pm; edited 1 time in total
Back to top
View user's profile Send private message
Paul.Martin



Joined: 03 Feb 2010
Posts: 83
Location: Cambridgeshire

PostPosted: Thu Jul 01, 2010 5:04 pm    Post subject: Reply with quote

Back to top
View user's profile Send private message
Display posts from previous:   
This topic is locked: you cannot edit posts or make replies. All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group