Пример #1
0
        /// <summary>
        ///     A patch can be used to change byte(s) starting at the defined address.
        /// </summary>
        /// <param name="addressToPatch">The address of the byte where we want our patch to start.</param>
        public MemoryPatch(MemoryPointer addressToPatch, byte[] newBytes)
        {
            PatchAddress  = addressToPatch ?? throw new ArgumentNullException(nameof(addressToPatch));
            NewBytes      = newBytes ?? throw new ArgumentNullException(nameof(newBytes));
            OriginalBytes = PatchAddress.Read(NewBytes.Length);

            MemoryPatches.Add(this);
        }
Пример #2
0
        public PEB(IProcess process)
        {
            _pebPointer = process.GetPebAddress();

            if (process.Is64Bit)
            {
                _pebOffsets = new PebOffsets64();
            }
            else
            {
                _pebOffsets = new PebOffsets32();
            }
        }
Пример #3
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="MemoryScanner" /> class.
 /// </summary>
 /// <param name="module"><see cref="ProcessModule"/> which we are going to scan.</param>
 public MemoryScanner(ModulePointer module)
 {
     ModuleBase = module.MemoryPointer;
     Bytes      = ModuleBase.Read(module.Size);
 }