Skip to content

Commit

Permalink
Fixed broken password extractor
Browse files Browse the repository at this point in the history
  • Loading branch information
ash47 committed Feb 15, 2018
1 parent af8b89d commit 738bd67
Showing 1 changed file with 37 additions and 9 deletions.
46 changes: 37 additions & 9 deletions ZXCheckGenerator/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,20 +136,48 @@ public static void extractPassword(string pathToSaveFile)
{
try
{
Type ZXGame = theyAreBillionsAssembly.GetType("#=zK5tycTRduhzAxpfPdw==");
MethodInfo getFlag = ZXGame.GetMethod("#=zAzPszW639sG8fJMh$g==", BindingFlags.Static | BindingFlags.NonPublic);
foreach(Type possibleType in theyAreBillionsAssembly.GetTypes())
{
MethodInfo sigMatch = possibleType.GetMethod("ProcessSpecialKeys_KeyUp", BindingFlags.Instance | BindingFlags.NonPublic);
if (sigMatch == null) continue;

foreach (MethodInfo possibleFlag in possibleType.GetMethods(BindingFlags.NonPublic | BindingFlags.Static))
{
string retTurn = possibleFlag.ReturnType.FullName;

if (retTurn != "System.Int32") continue;

ParameterInfo[] flagParams = possibleFlag.GetParameters();
if (flagParams.Length != 1) continue;
if (flagParams[0].ParameterType.FullName != "System.String") continue;

int flag = (int)possibleFlag.Invoke(null, new object[] { pathToSaveFile });

int flag = (int)getFlag.Invoke(null, new object[] { pathToSaveFile });
foreach (MethodInfo possibleHelper in possibleType.GetMethods(BindingFlags.NonPublic | BindingFlags.Static))
{
ParameterInfo[] helperParams = possibleHelper.GetParameters();

if (helperParams.Length != 3) continue;
if (helperParams[0].ParameterType.FullName != "System.String") continue;
if (helperParams[1].ParameterType.FullName != "System.Int32") continue;
if (helperParams[2].ParameterType.FullName != "System.Boolean") continue;

if(possibleHelper.ReturnType.FullName != "System.Void") continue;

possibleHelper.Invoke(null, new object[] { pathToSaveFile, flag, true });

MethodInfo unknownMethod = ZXGame.GetMethod("#=zGHHSYp7Uos74rBHHhg==", BindingFlags.Static | BindingFlags.NonPublic);
object activeZip = propActiveZip.GetValue(null, null);
string thePassword = (string)propPassword.GetValue(activeZip);

unknownMethod.Invoke(null, new object[] { pathToSaveFile, flag, true });
// Did we find the password?
if (thePassword == null || thePassword.Length <= 0) continue;

object activeZip = propActiveZip.GetValue(null, null);
string thePassword = (string)propPassword.GetValue(activeZip);
Console.WriteLine("Found password = " + thePassword);
System.IO.File.AppendAllText("_passwords.txt", "Password = " + thePassword + Environment.NewLine);
}

Console.WriteLine("Found password = " + thePassword);
System.IO.File.AppendAllText("_passwords.txt", "Password = " + thePassword + Environment.NewLine);
}
}
}
catch
{
Expand Down

0 comments on commit 738bd67

Please sign in to comment.