Пример #1
0
        //Gets a byte array, converts it into a string, and then returns it
        public static string GetByteArrayAsString(uint offset, int length)
        {
            byte[] array;

            if (usingPS3lib)
            {
                array = PS3API.Extension.ReadBytes(offset, length);
            }
            else
            {
                array = RPCS3API.ReadBytes(offset, length);
            }

            string construct = "";

            for (int byteIndex = 0; byteIndex < array.Length; byteIndex++)
            {
                construct = construct + array[byteIndex].ToString("X");
            }

            /*This function only handled two bytes at first.
             *  It is possible to handle more from the "length" argument, but it is not recommended*/
            if (length == 2)
            {
                if (construct.Length == 3)
                {
                    construct = "0" + construct;
                }
                else if (construct.Length == 2)
                {
                    construct = "00" + construct;
                }
            }

            return(construct);
        }
Пример #2
0
 int IDiaStackWalkHelper.readMemory(MemoryTypeEnum type, ulong va, uint cbData, out uint pcbData, byte[] pbData)
 {
     MemoryAccessor.ReadBytes((IntPtr)va, cbData, pbData);
     pcbData = cbData;
     return(S_OK);
 }