Skip to content

Commit

Permalink
Compatibility update for A10.3 B12.
Browse files Browse the repository at this point in the history
  • Loading branch information
DerPopo committed Dec 13, 2014
1 parent 2085e02 commit c5cf280
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 11 deletions.
27 changes: 19 additions & 8 deletions ManualDeobfuscator/ManualPatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,27 @@ public static void applyManualPatches (ModuleDefinition mainModule)
field => HasType (field.FieldType, "System.Collections.Generic.Dictionary") && HasGenericParams (field.FieldType, "Vector3i", "PersistentPlayerData"),
MakeFieldPublicAction, RenameAction<FieldDefinition> ("positionToLPBlockOwner"));


/*{
FieldDefinition usersToIdsField = Find ("AuthenticationServer.usersToIDs", mainModule.GetType ("AuthenticationServer").Fields,
field => HasType (field.FieldType, "System.Collections.Generic.Dictionary"));
MakeFieldPublicAction (usersToIdsField);
RenameAction<FieldDefinition> ("usersToIDs") (usersToIdsField);
GenericInstanceType genType = (GenericInstanceType)usersToIdsField.FieldType;
TypeReference subClassRef = genType.GenericArguments [1];
TypeDefinition subClass = subClassRef.Resolve ();
subClass.IsPublic = true;//MakeTypePublicAction (subClass);
subClass.IsNotPublic = false;
subClass.IsPublic = true;
RenameAction<TypeDefinition> ("SteamUserInfo") (subClass);
}
OnElement("Authenticator.SteamUserInfo", mainModule.GetType("AuthenticationServer").NestedTypes,
type => type.Name.Equals("scl0000"),
type => type.IsPublic = true, RenameAction<TypeDefinition>("SteamUserInfo"));
OnElement ("Authenticator.usersToIDs", mainModule.GetType ("AuthenticationServer").Fields,
field => HasType (field.FieldType, "System.Collections.Generic.Dictionary") && HasGenericParams (field.FieldType, "System.String", "scl0000"),
MakeFieldPublicAction, RenameAction<FieldDefinition> ("usersToIDs"), field => {
TypeDefinition steamUserInfo = ((GenericInstanceType)field.FieldType).GenericArguments[1].Resolve();
RenameAction<TypeDefinition>("SteamUserInfo")(steamUserInfo);
steamUserInfo.IsPublic = true;
return true;
}
);
MakeFieldPublicAction, RenameAction<FieldDefinition> ("usersToIDs")
);*/

OnElement ("PlayerDataFile.inventory", mainModule.GetType ("PlayerDataFile").Fields,
field => field.Name.Equals ("inventory") && field.FieldType.IsArray,
Expand Down
6 changes: 3 additions & 3 deletions NetworkPatcher/PatchMisc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -282,11 +282,11 @@ public static void Patch(Logger logger, AssemblyDefinition asmCSharp)
//--------------------------AuthenticatePlayer--------------------------

HelperClass.executeActions<MethodDefinition>(module, "GameManager", new HelperClass.GenericFuncContainer<MethodDefinition, bool>[]{
HelperClass.MethodParametersComparer("UnityEngine.NetworkView", "UnityEngine.NetworkPlayer", "System.String", "System.String", "EnumAuthenticationResult"),
HelperClass.MethodParametersComparer("ClientInfo", "System.String", "EnumAuthenticationResult"),
HelperClass.MethodReturnTypeComparer("System.Void"),
HelperClass.MethodOPCodeComparer(new int[]{-13,-10,-6,-5,-4,-3,-2},//new int[]{1,4,8,9,10,11,12},
/*HelperClass.MethodOPCodeComparer(new int[]{-13,-10,-6,-5,-4,-3,-2},//new int[]{1,4,8,9,10,11,12},
new OpCode[]{OpCodes.Ldsfld,OpCodes.Newarr,OpCodes.Stelem_Ref,OpCodes.Callvirt,OpCodes.Ldarg_2,OpCodes.Ldc_I4_1,OpCodes.Call},
null)
null)*/
}, HelperClass.MemberNameSetter<MethodDefinition>("DenyPlayer"));

HelperClass.executeActions<MethodDefinition>(module, "GameManager", new HelperClass.GenericFuncContainer<MethodDefinition, bool>[]{
Expand Down

0 comments on commit c5cf280

Please sign in to comment.