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

            //Free the allocated memory
            mProcess.FreeMemory(mAllocatedMemory);
        }
示例#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);
        }