Пример #1
0
 // Token: 0x0600076E RID: 1902 RVA: 0x0003118C File Offset: 0x0002F38C
 public BinaryStream(Stream stream, BinaryAccess streamModel = BinaryAccess.ReadWrite, Encoding encoding = null)
 {
     this._stream   = stream;
     this._encoding = (encoding ?? this._encoding);
     this._reader   = ((streamModel != BinaryAccess.Write) ? new BinaryReader(this._stream, this._encoding) : null);
     this._writer   = ((streamModel != BinaryAccess.Read) ? new BinaryWriter(this._stream, this._encoding) : null);
 }
Пример #2
0
 // Token: 0x0600076D RID: 1901 RVA: 0x0000F95B File Offset: 0x0000DB5B
 public BinaryStream(byte[] buffer, BinaryAccess streamModel = BinaryAccess.ReadWrite, Encoding encoding = null) : this(new MemoryStream(buffer), streamModel, encoding)
 {
 }
Пример #3
0
 // Token: 0x0600076B RID: 1899 RVA: 0x0000F93C File Offset: 0x0000DB3C
 public BinaryStream(BinaryAccess streamModel = BinaryAccess.ReadWrite, Encoding encoding = null) : this(new MemoryStream(), streamModel, encoding)
 {
 }
Пример #4
0
 // Token: 0x0600076C RID: 1900 RVA: 0x0000F94B File Offset: 0x0000DB4B
 public BinaryStream(int capacity, BinaryAccess streamModel = BinaryAccess.ReadWrite, Encoding encoding = null) : this(new MemoryStream(capacity), streamModel, encoding)
 {
 }
Пример #5
0
        static int Main(string[] args)
        {
            WriteLine("MemoryToolkitTester start");

            if (args.Length == 0)
            {
                args = new string[] { "speed.exe" }
            }
            ;

            BinaryAccess mem = new BinaryAccess(args[0], (IntPtr)0x400000);

            WriteLine(mem.ToString(), ConsoleColor.DarkYellow);

            WriteLine("[Main Module] " + mem.MainModule.ToString());

            IntPtr adr = (IntPtr)0x8B26D4;

            WriteLine("[Read Char Test] 0x" + adr.ToString("X4"));

            for (int i = 0; i < 21; i++)
            {
                var result = mem.Read <Char>(adr);
                Write(result.ToString() + ",", ConsoleColor.Green);
                adr = adr.Increment(1);
            }

            WriteLine("");
            adr = (IntPtr)0x8B26D4;
            bool isWritten = mem.Write(adr, "string");

            WriteLine($"isWr: {isWritten}");
            WriteLine($"win32error: {Marshal.GetLastWin32Error()}");

            adr = (IntPtr)0x8B26D4;
            WriteLine("[Read Char Test] 0x" + adr.ToString("X4"));

            for (int i = 0; i < 21; i++)
            {
                var result = mem.Read <Char>(adr);
                Write(result.ToString() + ",", ConsoleColor.Green);
                adr = adr.Increment(1);
            }

            WriteLine("");
            adr = (IntPtr)0x8B26D4;
            WriteLine("[Read String Test] 0x" + adr.ToString("X4"));

            var resultString = mem.Read <string>(adr);

            Write(resultString.ToString(), ConsoleColor.Green);
            WriteLine("");

            mem.Dispose();

            if (!Debugger.IsAttached)
            {
                WriteLine("Press any key to exit");
                Console.ReadKey();
            }
            return(0);
        }