Exemplo n.º 1
0
        public unsafe void MemRead(ulong address, ulong size, Span <byte> dest)
        {
            fixed(byte *destPtr = dest)
            {
                var err = UcNative.UcMemRead(Handle, address, destPtr, size);

                if (err != UcErr.UC_ERR_OK)
                {
                    throw new UcException(err);
                }
            }
        }
Exemplo n.º 2
0
        public unsafe byte[] MemRead(ulong address, ulong size)
        {
            var result = new byte[size];

            fixed(byte *pBytes = result)
            {
                var err = UcNative.UcMemRead(Handle, address, pBytes, size);

                if (err != UcErr.UC_ERR_OK)
                {
                    throw new UcException(err);
                }
            }

            return(result);
        }