Changeset 93 for binary-improvements/assembly-patcher
- Timestamp:
- Jul 20, 2014, 8:50:13 PM (10 years ago)
- Location:
- binary-improvements/assembly-patcher
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/assembly-patcher/Assembly-Patcher.userprefs
r86 r93 3 3 <MonoDevelop.Ide.Workbench ActiveDocument="Main.cs"> 4 4 <Files> 5 <File FileName="Main.cs" Line=" 28" Column="4" />5 <File FileName="Main.cs" Line="53" Column="57" /> 6 6 <File FileName="AssemblyInfo.cs" Line="21" Column="1" /> 7 7 </Files> -
binary-improvements/assembly-patcher/Main.cs
r84 r93 11 11 { 12 12 ModuleDefinition module = ModuleDefinition.ReadModule ("Assembly-CSharp.dll"); 13 14 TypeDefinition type = module.GetType ("GameManager"); 15 if (isPatched (type)) { 16 Console.WriteLine("Assembly already patched"); 17 return; 18 } 19 markTypePatched (module, type); 20 13 21 telnetPatch (module); 14 22 connectLogPatch (module); 15 executionLogPatch (module);23 executionLogPatch (module); 16 24 publicCommandPermissionsPatch (module); 25 playerDataPatch (module); 17 26 module.Write ("Assembly-CSharp.dll"); 18 27 Console.WriteLine ("Done"); 28 } 29 30 private static void playerDataPatch (ModuleDefinition module) 31 { 32 TypeDefinition type = module.GetType ("GameManager"); 33 34 addHook (type, "SavePlayerData", true, 2, true, typeof(PlayerDataStuff).GetMethod ("GM_SavePlayerData")); 19 35 } 20 36 … … 23 39 TypeDefinition type = module.GetType ("AdminTools"); 24 40 25 if (isPatched (type)) {26 return;27 }28 29 markTypePatched (module, type);30 41 replaceMethod (type, "GetAllowedCommandsList", true, 1, typeof(AdminToolsStuff).GetMethod ("GetAllowedCommandsList")); 31 42 } … … 35 46 TypeDefinition type = module.GetType ("GameManager"); 36 47 37 if (isPatched (type)) {38 return;39 }40 41 markTypePatched (module, type);42 48 addHook (type, "RequestToSpawnPlayer", true, 5, true, typeof(AllocsLogFunctions).GetMethod ("RequestToSpawnPlayer")); 43 49 } … … 47 53 TypeDefinition type = module.GetType ("ConsoleSdtd"); 48 54 49 if (isPatched (type)) {50 return;51 }52 53 markTypePatched (module, type);54 55 addHook (type, "ExecuteCmdFromClient", true, 3, false, typeof(AllocsLogFunctions).GetMethod ("ExecuteCmdFromClient")); 55 56 } … … 59 60 TypeDefinition type = module.GetType ("NetTelnetServer"); 60 61 61 if (isPatched (type)) {62 return;63 }64 65 markTypePatched (module, type);66 62 replaceMethod (type, ".ctor", false, 1, typeof(AllocsNetTelnetServer).GetMethod ("init")); 67 63 replaceMethod (type, "Disconnect", false, 0, typeof(AllocsNetTelnetServer).GetMethod ("Disconnect"));
Note:
See TracChangeset
for help on using the changeset viewer.