| Author |
Message |
Ben1628
Joined: 01 Jul 2010 Posts: 9
|
Posted: Thu Jul 01, 2010 3:44 pm Post subject: Plugin |
|
|
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 |
|
 |
Paul.Martin
Joined: 03 Feb 2010 Posts: 83 Location: Cambridgeshire
|
Posted: Thu Jul 01, 2010 5:03 pm Post subject: |
|
|
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 |
|
 |
Paul.Martin
Joined: 03 Feb 2010 Posts: 83 Location: Cambridgeshire
|
Posted: Thu Jul 01, 2010 5:04 pm Post subject: |
|
|
|
|
| Back to top |
|
 |
|
|
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