public static void AoFrameProcess(IntPtr clientPtr) { SimpleHookEntryPoint myInstance = null; try { myInstance = HookRuntimeInfo.Callback as SimpleHookEntryPoint; if (myInstance == null) { return; } myInstance.Debug("Stuffs"); int val2 = (int)Hooks.GetSkill(clientPtr, 27, 0); myInstance.Debug(val2.ToString()); } catch (Exception e) { myInstance.Debug(e.ToString()); } }
public void Run( EasyHook.RemoteHooking.IContext context, string channelName) { // Injection is now complete and the server interface is connected // Install hooks _server.ReportMessage("Installing hooks"); try { this.createGetInstanceHook = LocalHook.Create( LocalHook.GetProcAddress("Interfaces.dll", "?FrameProcess@Client_t@@QAEXXZ"), new Hooks.AoFrameProcessDelegate(Process.Interfaces.Client_t.AoFrameProcess), this ); _server.ReportMessage("createGetInstanceHook installed"); //this.aoHookFrameProcess = LocalHook.Create(LocalHook.GetProcAddress("Interfaces.dll", "?FrameProcess@Client_t@@QAEXXZ"),new API.Interfaces.Client_t.AoFrameProcessDelegate(Hooks.Interfaces.Client_t.AoFrameProcess), // this //); // var createGetSkillsHook = EasyHook.LocalHook.Create(EasyHook.LocalHook.GetProcAddress("Gamecode.dll", "?GetClientChar@n3EngineClientAnarchy_t@@QBEPAVSimpleChar_t@@XZ"), new GetSkills_Delegate(GetSkills_Hook), this); createGetInstanceHook.ThreadACL.SetExclusiveACL(new Int32[] { 0 }); //createGetSkillsHook.ThreadACL.SetExclusiveACL(new Int32[] { 0 }); EasyHook.RemoteHooking.WakeUpProcess(); IntPtr ptr = Hooks.GetInstanceIfAny(); //IntPtr name = Hooks.GetName(ptr, ) uint id = Hooks.GetPlayerID(); _server.ReportMessage("---->" + id.ToString()); try { while (true) { } /* * for(int i = 0;i < 650; i++) * { * int local = Hooks.GetSkills(ptr, i,0); * * * _server.ReportMessage(i+" "+local.ToString()); * } */ } catch (Exception e) { _server.ReportException(e); } _server.IsInstalled(EasyHook.RemoteHooking.GetCurrentProcessId()); //EasyHook.RemoteHooking.WakeUpProcess(); this.createGetInstanceHook.Dispose(); } catch (Exception e) { _server.ReportException(e); } /* * try * { * _server.ReportMessage("got here"); * while (true) * { * _server.ReportMessage("got here"); * _server.Ping(); * * Thread.Sleep(5000); * } * * } * catch(Exception e) * { * _server.ReportException(e); * } */ _server.ReportMessage("removing hook"); try { //createGetInstanceHook.Dispose(); } catch (Exception e) { _server.ReportException(e); } }