StorageHelper.cs 798 B

123456789101112131415161718192021222324252627
  1. using System.IO;
  2. namespace Ryujinx.HLE.OsHle.Services.Am
  3. {
  4. class StorageHelper
  5. {
  6. private const uint LaunchParamsMagic = 0xc79497ca;
  7. public static byte[] MakeLaunchParams()
  8. {
  9. //Size needs to be at least 0x88 bytes otherwise application errors.
  10. using (MemoryStream MS = new MemoryStream())
  11. {
  12. BinaryWriter Writer = new BinaryWriter(MS);
  13. MS.SetLength(0x88);
  14. Writer.Write(LaunchParamsMagic);
  15. Writer.Write(1); //IsAccountSelected? Only lower 8 bits actually used.
  16. Writer.Write(1L); //User Id Low (note: User Id needs to be != 0)
  17. Writer.Write(0L); //User Id High
  18. return MS.ToArray();
  19. }
  20. }
  21. }
  22. }