Esempio n. 1
0
 public String GetStringFromStringTable(uint Index)
 {
     fixed(byte *NamePointer = &StringTable[Index])
     {
         return(PointerUtils.PtrToString(NamePointer, Encoding.ASCII));
     }
 }
Esempio n. 2
0
 public static string StringFromAddress(CpuThreadState CpuThreadState, uint Address)
 {
     if (Address == 0)
     {
         return(null);
     }
     return(PointerUtils.PtrToString((byte *)CpuThreadState.GetMemoryPtr(Address), Encoding.UTF8));
 }
        public int sceIoWrite(SceUID FileId, byte *InputPointer, int InputSize)
        {
            try
            {
                switch ((StdioForUser.StdHandle)FileId)
                {
                case StdioForUser.StdHandle.Out:
                case StdioForUser.StdHandle.Error:
                    ConsoleUtils.SaveRestoreConsoleState(() =>
                    {
                        //Console.BackgroundColor = ConsoleColor.DarkGray;
                        if ((StdioForUser.StdHandle)FileId == StdioForUser.StdHandle.Out)
                        {
                            Console.ForegroundColor = ConsoleColor.Blue;
                        }
                        else
                        {
                            Console.ForegroundColor = ConsoleColor.Red;
                        }
                        //Console.Error.WriteLine("Output: '{0}'", PointerUtils.PtrToString(InputPointer, InputSize, Encoding.UTF8));
                        Console.Error.Write("{0}",
                                            PointerUtils.PtrToString(InputPointer, InputSize, Encoding.UTF8));
                    });
                    return(0);
                }

                try
                {
                    var HleIoDrvFileArg = GetFileArgFromHandle(FileId);
                    return(HleIoDrvFileArg.HleIoDriver.IoWrite(HleIoDrvFileArg, InputPointer, InputSize));
                }
                catch (Exception Exception)
                {
                    Console.Error.WriteLine(Exception);
                    return(-1);
                }
            }
            finally
            {
                _DelayIo(IoDelayType.Write, InputSize);
            }
        }
 public string GetStringFromStringTable(uint index)
 {
     fixed(byte *namePointer = &StringTable[index])
     return(PointerUtils.PtrToString(namePointer, Encoding.ASCII));
 }