Comments (14)
Could you upload the sample you're testing on?
from eazfixer.
https://drive.google.com/file/d/1SXhRaZKmSwbwthJdghcS0zP19R1YKsFU/view?usp=sharing
from eazfixer.
The problem occurs while resolving types through reflection, but I'm not sure why.
Although, something else that I noticed is that I was unable to enumerate Assembly.DefinedTypes because it could not resolve System.Runtime (yet dnSpy has no problems with it). I did some checking and it turns out that it is a .NET Core dll. Perhaps the problem lies there.
from eazfixer.
The real problem is probably that the tool uses .NET 4.6.x, while your DLL uses .NET Core 2.0. So, .NET will get confused while trying to resolve the referenced assembly and not look in the .NET Core assembly locations (C:\Program Files\dotnet\shared\Microsoft.NETCore.App
). Adding a custom AssemblyResolver will probably fix it.
from eazfixer.
Cool that makes sense! If I have time, I'll try forking the project and add a custom resolver like this https://stackoverflow.com/questions/1561806/looking-for-net-assembly-in-a-different-place.
I have done something similar in the past though I don't really remember clearly, it has been like 3 years :P
from eazfixer.
Don't worry, I'm on it. There will be a problem if the .NET Core runtimes aren't installed though.
from eazfixer.
Looks like you are unable to load System.Private.CoreLib (which the other .NET Core runtimes rely on) through Assembly.LoadFile, meaning no .NET Core assemblies can actually be loaded from the .NET Framework.
The natural fix would be to compile the tool itself for .NET Core, but Harmony doesn't have support for it yet so the anti-invoke protection would not be removed. I would suggest you take a look at de4dot, but that didn't seem to work for me either.
If you want to try to find a fix yourself using assembly resolving, my code is below. Simply call it at the start of the program.
public static void AddNetCoreResolvers()
{
AppDomain.CurrentDomain.AssemblyResolve += OnNetCoreResolve;
}
private static Assembly OnNetCoreResolve(object sender, ResolveEventArgs args)
{
var an = new AssemblyName(args.Name);
var pf = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);
//dotnet\shared\Microsoft.NETCore.App\2.0.0-preview2-25407-01
var masterFolder = Path.Combine(pf, "dotnet", "shared", "Microsoft.NETCore.App");
//TODO: perhaps check snk too?
var asmName = Directory.EnumerateFiles(masterFolder, $"{an.Name}.dll", SearchOption.AllDirectories)
.Reverse()
.FirstOrDefault();
if (asmName == null) return null;
else return Assembly.LoadFile(asmName);
//return asmName != null ? Assembly.LoadFile(asmName) : null;
}
from eazfixer.
I have already tried de4dot and also tried the different params but no luck. :/ I managed to debug it with dnSpy and got it working that way :P Thanks anyway!
from eazfixer.
Alright, glad to hear that :)
I'll keep this issue open, in case Harmony updates.
from eazfixer.
Hi Holly, i've the very same problem on a .NET 3.5 dll
Could u suggest me a fix to try your library?
Thx!
A.
from eazfixer.
Your assembly was probably protected with an older version of Eazfuscator. Try de4dot.
from eazfixer.
Please, help me with an error. thank
https://drive.google.com/open?id=1pcAxZ1T7TmB2WsCwtyVPQycWADrlq0OT
from eazfixer.
This is an issue related to reflection resolving, not a support thread.
from eazfixer.
Closing since EazFixer now targets both .NET Framework 4.7.2 and .NET Core 3.1, and Harmony has been updated to v2.x.
from eazfixer.
Related Issues (20)
- sample packed exe for eazdevirt HOT 6
- Add CI
- dnlib folder is empty HOT 1
- String DeObfuscation HOT 5
- Unhandled Exception: System.Exception: Unable to find crypto stream TypeDef #8 HOT 2
- Maybe new version of Eazfuscator? HOT 1
- Target .NET Core exclusively HOT 1
- Create issue templates
- build HOT 2
- Entrypoint obfuscation HOT 1
- Use proper cli parsing
- Use Echo to work after control flow obfuscation
- Use emulation HOT 2
- unpacked problem HOT 1
- Allow passing only file path instead of requiring --file
- Releases HOT 1
- Virtualization obfuscation HOT 1
- AssemblyResolver component is broken for samples from latest version.
- ResourceResolver and AssemblyResolver Failed (Init error: Could not find resolver type) HOT 6
- Exception error HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eazfixer.