Exemplo n.º 1
0
        public static byte[] DebugGetInternalRam()
        {
            byte[]   buffer = new byte[0x800];
            GCHandle handle = GCHandle.Alloc(buffer, GCHandleType.Pinned);

            try {
                UInt32 memorySize = InteropEmu.DebugGetMemoryStateWrapper(DebugMemoryType.InternalRam, handle.AddrOfPinnedObject());
                Array.Resize(ref buffer, (int)memorySize);
            } finally {
                handle.Free();
            }
            return(buffer);
        }
Exemplo n.º 2
0
        public static byte[] DebugGetMemoryState(DebugMemoryType type)
        {
            byte[] buffer = new byte[10485760];             //10mb buffer

            GCHandle handle = GCHandle.Alloc(buffer, GCHandleType.Pinned);

            try {
                UInt32 memorySize = InteropEmu.DebugGetMemoryStateWrapper(type, handle.AddrOfPinnedObject());
                Array.Resize(ref buffer, (int)memorySize);
            } finally {
                handle.Free();
            }
            return(buffer);
        }