Skip to content

Commit

Permalink
Allow for manual specification of Code and Metadata Registration addr…
Browse files Browse the repository at this point in the history
…esses if we fail to find them
  • Loading branch information
Sam Byass committed Jul 26, 2020
1 parent a0d2289 commit 7212daf
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Cpp2IL/PE/PE.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
Expand Down Expand Up @@ -538,6 +539,21 @@ public bool PlusSearch(int methodCount, int typeDefinitionsCount)
}

bailout:

if (codeRegistration == 0)
{
Console.Write("Couldn't identify a CodeRegistration address. If you know it, enter it now, otherwise enter nothing or zero to fail: ");
var crInput = Console.ReadLine();
ulong.TryParse(crInput, NumberStyles.HexNumber, null, out codeRegistration);
}

if (metadataRegistration == 0)
{
Console.Write("Couldn't identify a MetadataRegistration address. If you know it, enter it now, otherwise enter nothing or zero to fail: ");
var mrInput = Console.ReadLine();
ulong.TryParse(mrInput, NumberStyles.HexNumber, null, out metadataRegistration);
}

Console.WriteLine("Initializing with located addresses:");
return AutoInit(codeRegistration, metadataRegistration);
}
Expand Down

0 comments on commit 7212daf

Please sign in to comment.