Home - Forums-.NET - Spices.Net - Console Edition: Absolute vs. Relative Referencing

Spices.Net

NET code security, tools to protect, obfuscate, tamper defense, code and data safety, recover, convert, optimize, explore, browse and analyze .Net software.

This forum related to following products: Spices.Net Suite, Spices.Net Obfuscator, Spices.Net Decompiler

Console Edition: Absolute vs. Relative Referencing
Link Posted: 29-May-2006 08:56
I'm trying to get the Console Edition of Spices.net Obfuscator working as a Post-Build event from Visual Studio.  In my command line experimenting, I seem to be discovering that all target files need to be local to C:\\Program Files\\9Rays.Net\\Spices5\\Bin    Is this the case?

Even when I provided an absolute path reference the program still indicated that it was looking for the file with the \"Bin\" folder.

To further elaborate, my assemblies reside here:

C:\\Documents and Settings\\Robert Werner\\My Documents\\Visual Studio Projects\\PocketPollster\\Desktop\\bin\\Debug

And I'd like to be able run Obfuscator much like this:

NRObfuscator.exe DPC458% /SRC=PP.exe;DataObjects.dll;DataTransfer.dll /OUT=Protected /PATHS=C:\\WINDOWS\\Microsoft.NET\\Framework\\v1.1.4322

where \"Protected\" =
C:\\Documents and Settings\\Robert Werner\\My Documents\\Visual Studio Projects\\PocketPollster\\Desktop\\bin\\Debug\\Protected


Is there a way to have a single command line to do this or do I have to create a Batch file that individually copies the 3 files in question into C:\\Program Files\\9Rays.Net\\Spices5\\Bin, process them, and then copy them back?
Link Posted: 29-May-2006 10:06
Further to my last posting, I've started building a Batch file to provide me a solution, at least in the interim.  It's getting hung up on a key line:

The line reads:

NRObfuscator.exe DPC458% SRC=PP\\WF\\PP.exe;PP\\WF\\DataTransfer.dll;PP\\WF\\DataObjects.dll /OUT=PP\\WF\\Protected /PATHS=C:\\WINDOWS\\Microsoft.NET\\Framework\\v1.1.4322

This works PERFECTLY if I run it from the command line.  But if in the batch file, here's the opening I get from the EXE:

9Rays.Spices.Obfuscator.Net Console 5.0.0.6
Copyright 9Rays.Net 2006. All rights reserved

Options:DPC458\\WINDOWS\\Microsoft.NET\\Framework\\v1.1.4322
Input:
Work directory:C:\\Program Files\\9Rays.Net\\Spices5\\Bin
Output:C:\\Program Files\\9Rays.Net\\Spices5\\Bin\\Obfuscated


How come?
Link Posted: 29-May-2006 11:23

The line reads:

NRObfuscator.exe DPC458% SRC=PP\\WF\\PP.exe;PP\\WF\\DataTransfer.dll;PP\\WF\\DataObjects.dll /OUT=PP\\WF\\Protected /PATHS=C:\\WINDOWS\\Microsoft.NET\\Framework\\v1.1.4322

This works PERFECTLY if I run it from the command line. But if in the batch file, here's the opening I get from the EXE:

9Rays.Spices.Obfuscator.Net Console 5.0.0.6
Copyright 9Rays.Net 2006. All rights reserved

Options:DPC458\\WINDOWS\\Microsoft.NET\\Framework\\v1.1.4322
Input:
Work directory:C:\\Program Files\\9Rays.Net\\Spices5\\Bin
Output:C:\\Program Files\\9Rays.Net\\Spices5\\Bin\\Obfuscated



At command line please define output directory and source files as absolute:
/OUT=c:\\MyFolder\\....
or relative to nrobfuscator.exe location.

If you will use Spices.Project you can use relative paths in Spices.Project, these paths will relative to Spices.Project location.
Link Posted: 29-May-2006 11:31

And I'd like to be able run Obfuscator much like this:

NRObfuscator.exe DPC458% /SRC=PP.exe;DataObjects.dll;DataTransfer.dll /OUT=Protected /PATHS=C:\\WINDOWS\\Microsoft.NET\\Framework\\v1.1.4322

where \"Protected\" =
C:\\Documents and Settings\\Robert Werner\\My Documents\\Visual Studio Projects\\PocketPollster\\Desktop\\bin\\Debug\\Protected


The problem in the current directory. If you using Spices.Obfuscator from .bat file current directory will directory of nrobfuscator.exe.
If you set current directory to location of your assemblies or place .bat file to their location and use:
c:\\Program files\\9Rays.Net\\Spices5\\Bin\\nrobfuscator.exe ....
command line, in this case current directory will correct to use /SRC=PP.exe.
Just recommend you to use Spices.Project for obfuscation, this way give more flexibility than using command line.
BTW, nearest version of Spices.Obfuscator comes with MSBuild integration that provide more flexibility to integrate obfuscation into build process. Unfortunately MSBuild integration not included into Spices.Obfuscator Console Edition.