コード例 #1
0
        public virtual void Uninstall()
        {
            if (!isHooked)
            {
                return;
            }

            byte *pTarget = (byte *)_targetPtr.ToPointer();

            for (int i = 0; i < _headSize; i++)
            {
                *pTarget++ = _backupArray[i];
            }
            isHooked = false;
            HookerPool.RemoveHooker(_targetPtr);
        }
コード例 #2
0
        protected void Install()
        {
            if (NativeAPI.IsiOS()) // iOS 不支持修改 code 所在区域 page
            {
                return;
            }

            if (isHooked)
            {
                return;
            }

            HookerPool.AddHooker(_targetPtr, this);

            BackupHeader();
            PatchTargetMethod();
            PatchProxyMethod();
            isHooked = true;
        }