Skip to content
This repository has been archived by the owner on Jul 1, 2024. It is now read-only.

AssemblyUnhollower deobfuscation map generation | Fix for MissingKeyException and Type comparison #94

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

CamelCaseName
Copy link

When trying to generate a map for House Party, I experienced the following error:
Unhandled Exception: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary. at System.ThrowHelper.ThrowKeyNotFoundException() at System.Collections.Generic.Dictionary'2.get_Item(TKey key) at AssemblyUnhollower.Contexts.RewriteGlobalContext.GetNewAssemblyForOriginal(AssemblyDefinition oldAssembly) in F:\Lenny\source\repos\Il2CppAssemblyUnhollower\AssemblyUnhollower\Contexts\RewriteGlobalContext.cs:line 61 at AssemblyUnhollower.Contexts.AssemblyRewriteContext.RewriteTypeRef(TypeReference typeRef) in F:\Lenny\source\repos\Il2CppAssemblyUnhollower\AssemblyUnhollower\Contexts\AssemblyRewriteContext.cs:line 113 at AssemblyUnhollower.Passes.Pass12FillTypedefs.DoPass(RewriteGlobalContext context) in F:\Lenny\source\repos\Il2CppAssemblyUnhollower\AssemblyUnhollower\Passes\Pass12FillTypedefs.cs:line 36 at AssemblyUnhollower.DeobfuscationMapGenerator.GenerateDeobfuscationMap(UnhollowerOptions options) in F:\Lenny\source\repos\Il2CppAssemblyUnhollower\AssemblyUnhollower\DeobfuscationMapGenerator.cs:line 65 at AssemblyUnhollower.Program.Main(String[] args) in F:\Lenny\source\repos\Il2CppAssemblyUnhollower\AssemblyUnhollower\Program.cs:line 168

  • I fixed this and a logic flaw(or a side effect of my fix, not sure) in the comparison as well so that maps are now generated correctly.
  • Added more fallback if an assembly could not be found, at all times it was either mscorlib or Il2Cppmscorlib, so I added special cases.
  • Removed the leading dot on missing empty namespaces so it looks more clean
  • added handling for the System.Object

This shouldn't change anything about the main Unhollower functionality, only deobfuscation map generation.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant