Quantcast
Channel: Obfuscar, The Open Source Obfuscation Tool for .NET Assemblies
Viewing all 249 articles
Browse latest View live

Commented Unassigned: Unhandled Exception: System.ArgumentException: Illegal characters in path. [9]

$
0
0
Hi.

Thank you for Obfuscar 2.0 rc7.

Windows 7 x64 SP1

From within a command prompt, running:
Obfuscar.Console.exe /?

Causes the following output:
Obfuscar is available at http://obfuscar.codeplex.com.
(C) 2007-2014, Ryan Williams and other contributors.

Loading project...
Unhandled Exception: System.ArgumentException: Illegal characters in path.
at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)

at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, I
nt32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions o
ptions, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolea
n useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access,
FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean
bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access,
FileShare share)
at Obfuscar.Obfuscator..ctor(String projfile)
at Obfuscar.Program.Main(String[] args)

And produces the following dialog to appear:
[Window Title]
Obfuscar Console Utility

[Main Instruction]
Obfuscar Console Utility has stopped working

[Content]
A problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available.

[Debug] [Close program]


I expected to see "usage" information for the console application command line parameters/options instead of a crash.

Thank you.
Comments: Fixed in 2.0.2 beta.

Closed Unassigned: Unhandled Exception: System.ArgumentException: Illegal characters in path. [9]

$
0
0
Hi.

Thank you for Obfuscar 2.0 rc7.

Windows 7 x64 SP1

From within a command prompt, running:
Obfuscar.Console.exe /?

Causes the following output:
Obfuscar is available at http://obfuscar.codeplex.com.
(C) 2007-2014, Ryan Williams and other contributors.

Loading project...
Unhandled Exception: System.ArgumentException: Illegal characters in path.
at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)

at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, I
nt32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions o
ptions, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolea
n useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access,
FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean
bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access,
FileShare share)
at Obfuscar.Obfuscator..ctor(String projfile)
at Obfuscar.Program.Main(String[] args)

And produces the following dialog to appear:
[Window Title]
Obfuscar Console Utility

[Main Instruction]
Obfuscar Console Utility has stopped working

[Content]
A problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available.

[Debug] [Close program]


I expected to see "usage" information for the console application command line parameters/options instead of a crash.

Thank you.

Updated Wiki: Documentation

$
0
0
Obfuscar is a basic obfuscator for .NET assemblies. It uses massive overloading to rename metadata in .NET assemblies (including the names of methods, properties, events, fields, types and namespaces) to a minimal set, distinguishable in most cases only by signature.

For example, if a class contains only methods that accept different parameters, they can all be renamed 'A'. If another method is added to the class that accepts the same parameters as an existing method, it could be named 'a'.

It makes decompiled code very difficult to follow. The wiki has more details about What It Does.

The current release is Obfuscar 2.0 RC5. This is a port of Obfuscar 1.5.4 to the latest Mono.Cecil library. By using this new library Obfuscar now supports .NET 4.0 assemblies. Because there are a lot of subtle changes in Cecil's new API and patched merged from different sources, this release of Obfuscar must be considered unstable.

Note: Since version 1.5 the attrib attribute is evaluated correctly. Be sure to check if there are any unintended attrib values from the example in your configuration file.

Obfuscar works its magic with the help of Jb Evain's fantastic Cecil library.

The documentation section includes the following topics,

Updated Wiki: FAQ

$
0
0

How to troubleshoot TypeLoadException?

After obfuscation, the application might not work and TypeLoadException is quite common a case. One such case is

http://stackoverflow.com/questions/24058302/obfuscar-2-0-could-not-load-type-from-assembly

There can be other similar cases, where either explicitly or implicitly the application code itself requires an instance to be initialized at runtime by reflection. Since reflection requires metadata, which obfuscation manipulates heavily, such initialization could fail.

The workaround is to skip such types or methods in obfuscation, so that reflection can still find them out.

Note that it is rarely a bug of Obfuscar.

Updated Wiki: FAQ

$
0
0

How to troubleshoot TypeLoadException during reflection?

After obfuscation, the application might not work and TypeLoadException is quite common a case. One such case is

http://stackoverflow.com/questions/24058302/obfuscar-2-0-could-not-load-type-from-assembly

There can be other similar cases, where either explicitly or implicitly the application code itself requires an instance to be initialized at runtime by reflection. Since reflection requires metadata, which obfuscation manipulates heavily, such initialization could fail.

The workaround is to skip such types or methods in obfuscation, so that reflection can still find them out.

Note that it is rarely a bug of Obfuscar.

How to troubleshoot TypeLoadException if a method does not have an implementation?

One such case is

https://github.com/lextm/obfuscar/issues/47

It is very likely a bug of Obfuscar, where it mistakenly renames a virtual function, so that at runtime CLR cannot find the expected method from the type.

The workaround is to skip such methods in obfuscation explicitly. A bug report can also be fired at GitHub or CodePlex.

Created Unassigned: Obfuscar doesn't obfuscating anything [27]

$
0
0
Greetings! I tried obfuscar with simple configuration file:

```
<?xml version='1.0'?>
<Obfuscator>
<Var name="InPath" value=".\Obfuscator_Input" />
<Var name="OutPath" value=".\Obfuscator_Output" />

<Module file="$(InPath)\WindowsFormsApplication1.exe" />
</Obfuscator>
```
But when i opened result .exe with ILspy i saw that the code is still the same, except that some functions name was changed to "A". Application is created with VS2013 and .NET 4.5. What am i doing wrong? Any help or advice would be appreciated. Thank you!

Closed Unassigned: Issues in Naming [5]

$
0
0
I've trouble when processing executable created in VB.Net

Error message is similar to
"name ej is already assigned now instructed to assign Ej"...

I think that VB is a non case sensitive lang, and so there may be such error.


Comments: More info is required to reproduce it.

Closed Unassigned: Exception during using of anonymous types [18]

$
0
0
Hi.
When i try to execute code like that:
```
var elems = LastResults.SelectMany(cl => new[]
{
new
{
refno = cl.Element1,
db = cl.DbElement1,
},
new
{
refno = cl.Element2,
db = cl.DbElement2,
}
});
```
in runtime i've got an exception:
```
System.ArgumentException: Метод ' . `2[System.String,<Another_Full_Class_Name>.DbElement]. ' не является средством доступа к свойству
в System.Linq.Expressions.Expression.GetProperty(MethodInfo mi)
в System.Linq.Expressions.Expression.Property(Expression expression, MethodInfo propertyAccessor)
в <Some_Full_Class_Name>.Engine. ()
```
Not obfuscated code works well. And after i've added name to the type, the code has executed well with obfuscar.
Comments: More info is required.

Closed Unassigned: ERROR: item has already been added. [23]

$
0
0
givin this error when execute target exe file
item has already been added. Key in dictionary: 'A' Key being added: 'a'

Closed Unassigned: Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object. [25]

$
0
0
Getting exception right out of the gate. I just attempted to use SmartAssembly from RedGate and it was choking on compiler generated code from the use of _async_ and _await_ keywords. I'm guessing this tool has the same issue?

```
Loading project...Processing assembly: MyAssembly.Owin, Version=1.3.0.0, Culture=neutral, PublicKeyToken=null
Loading assemblies...Extra framework folders: Trying to resolve dependency: mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5
c561934e089
Trying to resolve dependency: mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Done.
Renaming: fields...parameters...properties...events...methods...types...
Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at Obfuscar.TypeKey.Matches(TypeReference type)
at Obfuscar.Obfuscator.RenameType(AssemblyInfo info, TypeDefinition type, TypeKey oldTypeKey, TypeKey newTypeKey, TypeKey unrenamedTypeKe
y)
at Obfuscar.Obfuscator.RenameTypes()
at Obfuscar.Obfuscator.RunRules()
at Obfuscar.Program.Main(String[] args)
```

```
<?xml version='1.0'?>
<Obfuscator>
<Var name="InPath" value=".\input" />
<Var name="OutPath" value=".\Obfuscator_Output" />

<Module file="$(InPath)\MyAssembly.Owin.dll" />
</Obfuscator>
```

```
[CompilerGenerated]
private struct <ApplyResponseGrantAsync>d__46 : IAsyncStateMachine
{
public int <>1__state;
public AynonymousIdentityHandler <>4__this;
public AsyncTaskMethodBuilder <>t__builder;
private object <>t__stack;
private TaskAwaiter <>u__$awaiter4b;
public CookieOptions <cookieOptions>5__47;
public IdentityCreatedContext <createdContext>5__4a;
public bool <removeAnonymousCookie>5__49;
public AuthenticationResponseRevoke <revoke>5__48;

private void MoveNext();
[DebuggerHidden]
private void SetStateMachine(IAsyncStateMachine param0);
}
```
Comments: More info is required.

Commented Unassigned: Obfuscar doesn't obfuscating anything [27]

$
0
0
Greetings! I tried obfuscar with simple configuration file:

```
<?xml version='1.0'?>
<Obfuscator>
<Var name="InPath" value=".\Obfuscator_Input" />
<Var name="OutPath" value=".\Obfuscator_Output" />

<Module file="$(InPath)\WindowsFormsApplication1.exe" />
</Obfuscator>
```
But when i opened result .exe with ILspy i saw that the code is still the same, except that some functions name was changed to "A". Application is created with VS2013 and .NET 4.5. What am i doing wrong? Any help or advice would be appreciated. Thank you!
Comments: https://obfuscar.codeplex.com/wikipage?title=Configuration Please take a look at all the options.

Closed Unassigned: Obfuscar doesn't obfuscating anything [27]

$
0
0
Greetings! I tried obfuscar with simple configuration file:

```
<?xml version='1.0'?>
<Obfuscator>
<Var name="InPath" value=".\Obfuscator_Input" />
<Var name="OutPath" value=".\Obfuscator_Output" />

<Module file="$(InPath)\WindowsFormsApplication1.exe" />
</Obfuscator>
```
But when i opened result .exe with ILspy i saw that the code is still the same, except that some functions name was changed to "A". Application is created with VS2013 and .NET 4.5. What am i doing wrong? Any help or advice would be appreciated. Thank you!

Created Unassigned: Error when internal class overrides protected member from public abstract class [28]

$
0
0
Steps to reproduce the issue.

1. Create a Class Library Project and create a public abstract class. Add a protected abstract member in that class. Example:

public abstract class Parent
{
protected abstract string MyProperty { get; }
}

2. Create a Console Project and create an internal class that inherits from the previous. Example:

internal class Child : Parent
{
internal string AnyStuff()
{
return this.MyProperty;
}

protected override string MyProperty
{
get
{
return "TextValue";
}
}
}

3. Add a simple code to create an instance of the last class and invoke any member of it.

After I obfuscate both projects, the application will crash.

Commented Unassigned: Error when internal class overrides protected member from public abstract class [28]

$
0
0
Steps to reproduce the issue.

1. Create a Class Library Project and create a public abstract class. Add a protected abstract member in that class. Example:

public abstract class Parent
{
protected abstract string MyProperty { get; }
}

2. Create a Console Project and create an internal class that inherits from the previous. Example:

internal class Child : Parent
{
internal string AnyStuff()
{
return this.MyProperty;
}

protected override string MyProperty
{
get
{
return "TextValue";
}
}
}

3. Add a simple code to create an instance of the last class and invoke any member of it.

After I obfuscate both projects, the application will crash.
Comments: Can you also share the config file?

Commented Unassigned: Error when internal class overrides protected member from public abstract class [28]

$
0
0
Steps to reproduce the issue.

1. Create a Class Library Project and create a public abstract class. Add a protected abstract member in that class. Example:

public abstract class Parent
{
protected abstract string MyProperty { get; }
}

2. Create a Console Project and create an internal class that inherits from the previous. Example:

internal class Child : Parent
{
internal string AnyStuff()
{
return this.MyProperty;
}

protected override string MyProperty
{
get
{
return "TextValue";
}
}
}

3. Add a simple code to create an instance of the last class and invoke any member of it.

After I obfuscate both projects, the application will crash.
Comments: I can share you the solution I used to test this. The config file is in the Console project.

Commented Unassigned: Error when internal class overrides protected member from public abstract class [28]

$
0
0
Steps to reproduce the issue.

1. Create a Class Library Project and create a public abstract class. Add a protected abstract member in that class. Example:

public abstract class Parent
{
protected abstract string MyProperty { get; }
}

2. Create a Console Project and create an internal class that inherits from the previous. Example:

internal class Child : Parent
{
internal string AnyStuff()
{
return this.MyProperty;
}

protected override string MyProperty
{
get
{
return "TextValue";
}
}
}

3. Add a simple code to create an instance of the last class and invoke any member of it.

After I obfuscate both projects, the application will crash.
Comments: Thanks. Currently it is by design, as the obfuscation code does not check if a property is overridden or not. The workaround is to manually skip the overridden properties in configuration. I will see if there is a way to automate the check.

Created Unassigned: Unhandled Exception: Mono.Cecil.ResolutionException [29]

$
0
0
I get the following error when running obsfuscator:

Saving assemblies...
Unhandled Exception: Mono.Cecil.ResolutionException: Failed to resolve Eurosoft.
CORE.Native.CoreStrings/StringIDs
at Mono.Cecil.SignatureWriter.WriteCustomAttributeEnumValue(TypeReference enu
m_type, Object value)
at Mono.Cecil.SignatureWriter.WriteCustomAttributeElement(TypeReference type,
CustomAttributeArgument argument)
at Mono.Cecil.SignatureWriter.WriteCustomAttributeFixedArgument(TypeReference
type, CustomAttributeArgument argument)
at Mono.Cecil.SignatureWriter.WriteCustomAttributeConstructorArguments(Custom
Attribute attribute)
at Mono.Cecil.MetadataBuilder.GetCustomAttributeSignature(CustomAttribute att
ribute)
at Mono.Cecil.MetadataBuilder.AddCustomAttributes(ICustomAttributeProvider ow
ner)
at Mono.Cecil.MetadataBuilder.AddProperty(PropertyDefinition property)
at Mono.Cecil.MetadataBuilder.AddProperties(TypeDefinition type)
at Mono.Cecil.MetadataBuilder.AddType(TypeDefinition type)
at Mono.Cecil.MetadataBuilder.AddTypeDefs()
at Mono.Cecil.MetadataBuilder.BuildTypes()
at Mono.Cecil.MetadataBuilder.BuildModule()
at Mono.Cecil.ModuleWriter.<BuildMetadata>b__0(MetadataBuilder builder, Metad
ataReader _)
at Mono.Cecil.ModuleDefinition.Read[TItem,TRet](TItem item, Func`3 read)
at Mono.Cecil.ModuleWriter.WriteModuleTo(ModuleDefinition module, Stream stre
am, WriterParameters parameters)
at Mono.Cecil.ModuleDefinition.Write(String fileName, WriterParameters parame
ters)
at Obfuscar.Obfuscator.SaveAssemblies()
at Obfuscar.Obfuscator.RunRules()
at Obfuscar.Program.Main(String[] args)

Attached is my project file.

Thanks

Closed Unassigned: Unhandled Exception: Mono.Cecil.ResolutionException [29]

$
0
0
I get the following error when running obsfuscator:

Saving assemblies...
Unhandled Exception: Mono.Cecil.ResolutionException: Failed to resolve Eurosoft.
CORE.Native.CoreStrings/StringIDs
at Mono.Cecil.SignatureWriter.WriteCustomAttributeEnumValue(TypeReference enu
m_type, Object value)
at Mono.Cecil.SignatureWriter.WriteCustomAttributeElement(TypeReference type,
CustomAttributeArgument argument)
at Mono.Cecil.SignatureWriter.WriteCustomAttributeFixedArgument(TypeReference
type, CustomAttributeArgument argument)
at Mono.Cecil.SignatureWriter.WriteCustomAttributeConstructorArguments(Custom
Attribute attribute)
at Mono.Cecil.MetadataBuilder.GetCustomAttributeSignature(CustomAttribute att
ribute)
at Mono.Cecil.MetadataBuilder.AddCustomAttributes(ICustomAttributeProvider ow
ner)
at Mono.Cecil.MetadataBuilder.AddProperty(PropertyDefinition property)
at Mono.Cecil.MetadataBuilder.AddProperties(TypeDefinition type)
at Mono.Cecil.MetadataBuilder.AddType(TypeDefinition type)
at Mono.Cecil.MetadataBuilder.AddTypeDefs()
at Mono.Cecil.MetadataBuilder.BuildTypes()
at Mono.Cecil.MetadataBuilder.BuildModule()
at Mono.Cecil.ModuleWriter.<BuildMetadata>b__0(MetadataBuilder builder, Metad
ataReader _)
at Mono.Cecil.ModuleDefinition.Read[TItem,TRet](TItem item, Func`3 read)
at Mono.Cecil.ModuleWriter.WriteModuleTo(ModuleDefinition module, Stream stre
am, WriterParameters parameters)
at Mono.Cecil.ModuleDefinition.Write(String fileName, WriterParameters parame
ters)
at Obfuscar.Obfuscator.SaveAssemblies()
at Obfuscar.Obfuscator.RunRules()
at Obfuscar.Program.Main(String[] args)

Attached is my project file.

Thanks
Comments: Without accessing to the assemblies, it is impossible to reproduce with such little info. If you like, you can share the assemblies with me via support@lextm.com.

Updated Wiki: Home

$
0
0
The project logo comes from Legendora Icon by Teekatas Suwannakrua.

Maintained and supported by LeXtudio.

Project Description
Obfuscar is an open source .NET obfuscator released under MIT license. It provides basic obfuscation features that help secure secrets in a .NET assembly.

Obfuscation Example

News

  • Sept 6, 2015 Obfuscar 2.0.2 Beta 2 is available at NuGet.org.
  • April 17, 2015 Obfuscar 2.0.2 Beta 1 is available at NuGet.org.
  • April 14, 2015 Obfuscar 2.0.1 is officially released as a NuGet package.
  • March 1, 2014 Obfuscar 2.0 is officially released. It is also available as a NuGet package.
  • Feb 2, 2014 Discussion board is going to be shut down. Please post questions to StackOverflow using obfuscar tag.

Get Started

Documentation section contains most information you need, and also a detailed history of this project all through the years.

The source repository for this project is at GitHub.

This tool has been heavily in Lex Li's personal project (#SNMP Pro).

Issues

If you have a patch to contribute, a feature to request, or a bug to report, please post to the Issue Tracker.

Support Services

Please contact LeXtudio for support services.

Donation

If you find this project useful and want to donate to my efforts on this project, please use the following link,

Donate

Released: 2.0.2 (Beta 2) (Sep 06, 2015)

$
0
0
This release is available at NuGet.org,

https://www.nuget.org/packages/Obfuscar/2.0.2-beta2
  • Fixed GitHub issue 47. Generic support is enhanced so that F# assemblies can be obfuscated properly.
  • Fixed GitHub issue 55. Nested types now honors parent type's obfuscation attribute.
Viewing all 249 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>