示例#1
0
        public void WriteUInt64(GeckoMemoryAddress address, ulong value)
        {
            int rawAddress = address.GetAddress(Client);

            Client.Stream.WriteCommand(GeckoCommand.UploadMemory);
            Client.Stream.WriteInt32(rawAddress);
            Client.Stream.WriteInt32(unchecked (rawAddress + sizeof(ulong)));
            Client.Stream.WriteUInt64(value);
            Client.Stream.Flush();
        }
示例#2
0
        public void WriteBytes(GeckoMemoryAddress address, byte[] value)
        {
            int rawAddress  = address.GetAddress(Client);
            int remainBytes = value.Length;
            int sendBytes   = Math.Min(remainBytes, Client.DataBufferSize - sizeof(GeckoCommand) - sizeof(int) * 2);
            int valueOffset = 0;

            while (remainBytes > 0)
            {
                Client.Stream.WriteCommand(GeckoCommand.UploadMemory);
                Client.Stream.WriteInt32(rawAddress);
                Client.Stream.WriteInt32(unchecked (rawAddress + sendBytes));
                Client.Stream.Write(value, valueOffset, sendBytes);
                Client.Stream.Flush();

                remainBytes -= sendBytes;
                valueOffset += sendBytes;
                rawAddress  += sendBytes;
            }
        }