Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Text;
- using System.IO;
- using WinApi;
- using System.Threading;
- using Gothic.zClasses;
- using Gothic.zTypes;
- using WinApi.User;
- using WinApi.User.Enumeration;
- using Gothic.mClasses;
- using Gothic.mClasses.Elements;
- using Gothic.zStruct;
- namespace marvinenabler
- {
- public class Program
- {
- public static Int32 InjectedMain(String message)
- {
- try
- {
- Process Process = Process.ThisProcess();
- AddHooks();
- MarvinModeEnable();
- while (true)
- {
- Thread.Sleep(10000);
- }
- }
- catch (System.Exception ex)
- {
- zERROR.GetZErr(Process.ThisProcess()).Report(4, 'G', ex.ToString(), 0, "Program.cs", 0);
- }
- return 11;
- }
- public static void AddHooks()
- {
- Process Process = Process.ThisProcess();
- Process.Hook("GUC.dll", typeof(Program).GetMethod("ocGameUpdate"), 0x006C8AB2, 5, 0);
- }
- //(That will add a hook at the end of the render function)
- public static Int32 ocGameUpdate(String message)
- {
- Process Process = Process.ThisProcess();
- //each time when gothic renders the game this function will be called
- return 0;
- }
- //Functions
- static byte[] mmenable;
- public static void MarvinModeEnable()
- {
- Process Process = Process.ThisProcess();
- Process.Write(mmenable, 0x006CBF60);
- }
- public static void MarvinModeDisable()
- {
- Process Process = Process.ThisProcess();
- Process.VirtualProtect(0x006CBF60, 25);
- mmenable = Process.ReadBytes(0x006CBF60, 25);
- byte[] arr = new byte[25];
- for (int i = 0; i < arr.Length; i++)
- arr[i] = 0x90;
- Process.Write(arr, 0x006CBF60);
- arr = new byte[] { 0xC3 };
- Process.Write(arr, 0x00432EC0);//Eventhandle marvin mode
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment