-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Port generator to use AsmResolver (#124)
- Loading branch information
Showing
72 changed files
with
2,321 additions
and
2,026 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,14 @@ | ||
using Mono.Cecil; | ||
using AsmResolver.DotNet; | ||
|
||
namespace Il2CppInterop; | ||
|
||
internal static class Utils | ||
{ | ||
public static List<AssemblyDefinition> LoadAssembliesFrom(DirectoryInfo directoryInfo) | ||
{ | ||
var resolver = new BasicResolver(); | ||
var inputAssemblies = directoryInfo.EnumerateFiles("*.dll").Select(f => AssemblyDefinition.ReadAssembly( | ||
f.FullName, | ||
new ReaderParameters { AssemblyResolver = resolver })).ToList(); | ||
foreach (var assembly in inputAssemblies) | ||
{ | ||
resolver.Register(assembly); | ||
} | ||
var inputAssemblies = directoryInfo.EnumerateFiles("*.dll").Select(f => AssemblyDefinition.FromFile( | ||
f.FullName)).ToList(); | ||
|
||
return inputAssemblies; | ||
} | ||
|
||
private class BasicResolver : DefaultAssemblyResolver | ||
{ | ||
public void Register(AssemblyDefinition ad) => RegisterAssembly(ad); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.