Ejemplo n.º 1
0
        public void Deactivate()
        {
            //Write original instructions
            Hack.CopyInstructions(mProcess, mAllocatedMemory + (uint)mNewCode.Length, mAddress, mReplacedInstructionSize);

            //Free the allocated memory
            mProcess.FreeMemory(mAllocatedMemory);
        }
Ejemplo n.º 2
0
        public static uint DeinjectCode(AppProcess process, uint allocatedMem, uint address, int replacedInstructionSize, int newCodeLength)
        {
            if (replacedInstructionSize < 5)
            {
                throw new Exception("Replaced instruction size much be greater than 5.");
            }

            //Write original instructions
            CopyInstructions(process, allocatedMem + (uint)newCodeLength, address, replacedInstructionSize);

            //Free the allocated memory
            process.FreeMemory(allocatedMem);

            return(allocatedMem);
        }