/// <summary> /// Sets up the boost injection for overriding boost behaviour. /// </summary> public static void setupBoostInjection() { // Assembly Code to Write address of Player currently boosting to memory. string[] injectionString = new string[] { "use32", "add ebx,0x00000BE0", "mov dword [0x" + currentPlayerVelocity.ToString("X") + "],ebx", "add ebx,-0x00000BE0" }; // Assemble ASM Code. byte[] playerPointerASM = serverClient.SendData_Alternate(Message_Type.Client_Call_Assemble_x86_Mnemonics, Serialize_x86_ASM_Mnemonics(injectionString), true); // Create new Mixed Injection & Execute. Injection boostCSharpInjection = new Injection((IntPtr)BOOSTPAD_BOOST_MEMORY_WRITE_ADDRESS, (boostPlayerDelegate)boostPlayerAction, 6, serverClient, true); // Activate Injection boostCSharpInjection.Activate(); // Declare ASM Injection ASM_Hook boostASMInjection = new ASM_Hook((IntPtr)BOOSTPAD_BOOST_MEMORY_WRITE_ADDRESS, playerPointerASM, 6, serverClient, true); // Activate Injection boostASMInjection.Activate(); // Append Hooks onto List boostPlayerInjection.Add(boostCSharpInjection); boostPlayerInjection.Add(boostASMInjection); }