Exemplo n.º 1
0
 public void Initialize(IDeviceRW device)
 {
     Device           = device;
     InitialSeed      = Device.ReadUInt32(SFMTAddressSeed);
     SFMTAddressIndex = SFMTAddressStart + 0x9C0;
     SFMT             = new SFMT(InitialSeed);
     CurrentSeed      = InitialSeed;
     FrameCount       = 0;
 }
Exemplo n.º 2
0
        public G7GameStateSM(IDeviceRW device) : base(device)
        {
            Main.SFMTAddressSeed = 0x325A3878;  // [1.2: 0x325A3878] [1.1: ??] [1.0: ???]

            Main.SFMTAddressStart = 0x33195B7C; // [1.2: 0x33195B88] [1.1: ???] [1.0 0x33195B7C]
            Main.Initialize(Device);

            SOS.SFMTAddressSeed  = 0x30038C44;
            SOS.SFMTAddressStart = 0x30038C44;
            SOS.Initialize(Device);
        }
Exemplo n.º 3
0
        public static long FindSequenceFirst(this IDeviceRW device, byte[] seq, ulong offset, ulong length, uint scanSize = 0x10000, long pid = -1)
        {
            var end = offset + length;
            var hop = scanSize - (uint)seq.Length + 1; // for each check, include enough from last sequence for overlap

            for (var i = offset; i < end; i += hop)
            {
                var data  = device.Read(i, scanSize, pid);
                var index = IndexOfBytes(data, seq);
                if (index >= 0)
                {
                    return((long)i + index);
                }
            }
            return(-1);
        }
Exemplo n.º 4
0
        // Scan
        public static IEnumerable <ulong> FindSequences(this IDeviceRW device, byte[] seq, ulong offset, ulong length, uint maxScan = 0x10000, long pid = -1)
        {
            var end = offset + length;
            var hop = maxScan - (uint)seq.Length + 1;  // for each check, include enough from last sequence for overlap

            for (var i = offset; i < end; i += hop)
            {
                var data  = device.Read(i, maxScan, pid);
                var index = IndexOfBytes(data, seq);
                if (index < 0)
                {
                    continue;
                }

                yield return(i + (ulong)index);
            }
        }
Exemplo n.º 5
0
        public static void WriteInt16(this IDeviceRW device, short value, ulong offset)
        {
            var data = BitConverter.GetBytes(value);

            device.Write(data, offset);
        }
Exemplo n.º 6
0
 public static byte ReadByte(this IDeviceRW device, ulong offset) => device.Read(offset, 1)[0];
Exemplo n.º 7
0
        public static short ReadInt16(this IDeviceRW device, ulong offset)
        {
            var data = device.Read(offset, 2);

            return(BitConverter.ToInt16(data, 0));
        }
Exemplo n.º 8
0
        public static int ReadInt32(this IDeviceRW device, ulong offset)
        {
            var data = device.Read(offset, 4);

            return(BitConverter.ToInt32(data, 0));
        }
Exemplo n.º 9
0
        public static long ReadInt64(this IDeviceRW device, ulong offset)
        {
            var data = device.Read(offset, 8);

            return(BitConverter.ToInt64(data, 0));
        }
Exemplo n.º 10
0
 public static void WriteByte(this IDeviceRW device, byte value, ulong offset) => device.Write(new [] { value }, offset);
Exemplo n.º 11
0
 public G7GameStateUSUM(IDeviceRW device) : base(device)
 {
     Main.SFMTAddressSeed  = 0x32663BF0;
     Main.SFMTAddressStart = 0x330D35D8;
     Main.Initialize(Device);
 }
Exemplo n.º 12
0
 protected G7GameState(IDeviceRW device) => Device = device;