StorageHelper.cs 796 B

123456789101112131415161718192021222324252627
  1. using System.IO;
  2. namespace Ryujinx.HLE.HOS.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. }