Skip to content

Commit

Permalink
Add external modules to the resolver cache
Browse files Browse the repository at this point in the history
Without this change, the external modules are not properly resolved.
  • Loading branch information
mkaring committed Feb 10, 2021
1 parent 51e8401 commit 2ddf9d3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Confuser.Core/Marker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,9 @@ protected internal virtual MarkerResult MarkProject(ConfuserProject proj, Confus
var extModules = new List<byte[]>();
foreach (ProjectModule module in proj) {
if (module.IsExternal) {
extModules.Add(module.LoadRaw(proj.BaseDirectory));
var rawModule = module.LoadRaw(proj.BaseDirectory);
extModules.Add(rawModule);
context.InternalResolver.AddToCache(ModuleDefMD.Load(rawModule, context.InternalResolver.DefaultModuleContext));
continue;
}

Expand Down
4 changes: 3 additions & 1 deletion Confuser.Core/ObfAttrMarker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,9 @@ protected internal override MarkerResult MarkProject(ConfuserProject proj, Confu
var modules = new List<Tuple<ProjectModule, ModuleDefMD>>();
foreach (ProjectModule module in proj) {
if (module.IsExternal) {
extModules.Add(module.LoadRaw(proj.BaseDirectory));
var rawModule = module.LoadRaw(proj.BaseDirectory);
extModules.Add(rawModule);
context.InternalResolver.AddToCache(ModuleDefMD.Load(rawModule, context.InternalResolver.DefaultModuleContext));
continue;
}

Expand Down

0 comments on commit 2ddf9d3

Please sign in to comment.