public static ExecutionID XamGetExecutionId(XboxConsole Console)
 {
     var ppExecutionId = new XDRPCArgumentInfo<uint>(0, ArgumentType.Out);
     var returnVal = Console.ExecuteRPC<uint>(XDRPCMode.Title, "xam.xex", 640, ppExecutionId);
     if (returnVal != 0x00000000) throw new COMException("Exception from HRESULT: " + string.Format("0x{0:X}", returnVal), (int)returnVal);
     if (ppExecutionId.Value == 0) throw new Exception("XDKUtilities.XamGetExecutionId: Invalid pointer returned.");
     //The above only gets the pointer in console memory to the Execution ID. We still have to grab it below.
     //Props to MS devs for making a really nice function to do this.
     using (var refr = new XDRPCReference(Console, ppExecutionId.Value, 24)) return refr.Get<ExecutionID>();
 }
 public static XAMACCOUNTINFO XamProfileFindAccount(XboxConsole Console, ulong OfflineXUID)
 {
     if (!XUID.IsOfflineXUID(OfflineXUID)) throw new Exception("XDKUtilities.XamProfileFindAccount: Invalid offline XUID specified.");
     var xuidOffline = new XDRPCArgumentInfo<ulong>(OfflineXUID);
     var pAccountInfo = new XDRPCStructArgumentInfo<XAMACCOUNTINFO>(new XAMACCOUNTINFO(), ArgumentType.Out);
     var returnVal = Console.ExecuteRPC<uint>(XDRPCMode.Title, "xam.xex", 565, xuidOffline, pAccountInfo);
     //if (returnVal != 0x00000000) throw ProfilesExceptionFactory.CreateExceptionFromErrorCode(returnVal);
     return pAccountInfo.Value;
 }
Example #3
0
        public static bool XamFeatureEnabled(XboxConsole Console, XamAppIDs AppID)
        {
            var appID     = new XDRPCArgumentInfo <uint>((uint)AppID);
            var returnVal = Console.ExecuteRPC <uint>(XDRPCMode.Title, "xam.xex", 512, appID);

            return(Convert.ToBoolean(returnVal));
        }
Example #4
0
        public static void XamShowMessageComposeUI(XboxConsole Console, uint XUserIndex, ulong[] Recipients = null, string MessageText = "")
        {
            if (XUserIndex > 3)
            {
                throw new Exception("XDKUtilities.XamShowMessageComposeUI: Invalid user index specified.");
            }
            if (Recipients != null)
            {
                if (Recipients.Length > 64)
                {
                    throw new Exception("XDKUtilities.XamShowMessageComposeUI: Too many recipients specified. The maximum is 64.");
                }
                if (Recipients.Any(recipient => !XUID.IsOnlineXUID(recipient) && !XUID.IsTeamXUID(recipient)))
                {
                    throw new Exception("XDKUtilities.XamShowMessageComposeUI: Invalid recipient online/team XUID specified.");
                }
            }
            if (MessageText.Length > 255)
            {
                throw new Exception("XDKUtilities.XamShowMessageComposeUI: Specified message text is invalid. It must be less than or equal to 255 characters in length.");
            }
            var dwUserIndex     = new XDRPCArgumentInfo <uint>(XUserIndex);
            var pXuidRecipients = Recipients == null || Recipients.Length == 0 ? new XDRPCNullArgumentInfo() : (XDRPCArgumentInfo) new XDRPCArrayArgumentInfo <ulong[]>(Recipients);
            var cRecipients     = Recipients == null ? 0 : Recipients.Length;
            var pszText         = string.IsNullOrWhiteSpace(MessageText) ? new XDRPCNullArgumentInfo() : (XDRPCArgumentInfo) new XDRPCStringArgumentInfo(MessageText, Encoding.BigEndianUnicode);
            var returnVal       = Console.ExecuteRPC <uint>(XDRPCMode.Title, "xam.xex", 716, dwUserIndex, pXuidRecipients, cRecipients, pszText);

            if (returnVal != 0x00000000)
            {
                throw new COMException("Exception from HRESULT: " + string.Format("0x{0:X}", returnVal), (int)returnVal);
            }
        }
Example #5
0
        public static void XNotifyQueueUI(XboxConsole Console, uint XUserIndex, XNotifyUITypes XNotifyUIType, XNotifyUIPriorities XNotifyUIPriority, string XNotifyMessage)
        {
            if (XUserIndex > 3)
            {
                throw new Exception("XDKUtilities.XNotifyQueueUI: Invalid user index specified. It must be less than or equal to 3.");
            }
            if (!Enum.IsDefined(typeof(XNotifyUITypes), XNotifyUIType))
            {
                throw new Exception("XDKUtilities.XNotifyQueueUI: Invalid notification type specified.");
            }
            if (!Enum.IsDefined(typeof(XNotifyUIPriorities), XNotifyUIPriority))
            {
                throw new Exception("XDKUtilities.XNotifyQueueUI: Invalid notification priority specified.");
            }
            var dwType          = new XDRPCArgumentInfo <uint>((uint)XNotifyUIType);
            var dwUserIndex     = new XDRPCArgumentInfo <uint>(XUserIndex);
            var dwPriority      = new XDRPCArgumentInfo <uint>((uint)XNotifyUIPriority);
            var pwszStringParam = new XDRPCStringArgumentInfo(XNotifyMessage, Encoding.BigEndianUnicode);
            var returnVal       = Console.ExecuteRPC <uint>(XDRPCMode.Title, "xam.xex", 656, dwType, dwUserIndex, dwPriority, pwszStringParam);

            if (returnVal != 0x00000000)
            {
                throw new COMException("Exception from HRESULT: " + string.Format("0x{0:X}", returnVal), (int)returnVal);
            }
        }
Example #6
0
        public static void XamShowGameInviteUI(XboxConsole Console, uint XUserIndex, ulong[] Recipients = null)
        {
            if (XUserIndex > 3)
            {
                throw new Exception("XDKUtilities.XamShowGameInviteUI: Invalid user index specified.It must be less than or equal to 3.");
            }
            if (Recipients != null)
            {
                if (Recipients.Length > 64)
                {
                    throw new Exception("XDKUtilities.XamShowGameInviteUI: Too many recipients specified. The maximum is 64.");
                }
                if (Recipients.Any(recipient => !XUID.IsOnlineXUID(recipient) && !XUID.IsTeamXUID(recipient)))
                {
                    throw new Exception("XDKUtilities.XamShowGameInviteUI: Invalid recipient online/team XUID specified.");
                }
            }
            var dwUserIndex     = new XDRPCArgumentInfo <uint>(XUserIndex);
            var pXuidRecipients = Recipients == null || Recipients.Length == 0 ? new XDRPCNullArgumentInfo() : (XDRPCArgumentInfo) new XDRPCArrayArgumentInfo <ulong[]>(Recipients);
            var cRecipients     = Recipients == null ? 0 : Recipients.Length;
            var returnVal       = Console.ExecuteRPC <uint>(XDRPCMode.Title, "xam.xex", 717, dwUserIndex, pXuidRecipients, cRecipients);

            if (returnVal != 0x00000000)
            {
                throw new COMException("Exception from HRESULT: " + string.Format("0x{0:X}", returnVal), (int)returnVal);
            }
        }
Example #7
0
        public static void XamFeatureEnableDisable(XboxConsole Console, bool EnableDisable, XamAppIDs AppID)
        {
            var enableDisable = new XDRPCArgumentInfo <bool>(EnableDisable);
            var appID         = new XDRPCArgumentInfo <uint>((uint)AppID);
            var returnVal     = Console.ExecuteRPC <uint>(XDRPCMode.Title, "xam.xex", 515, enableDisable, appID);

            if (returnVal != 0)
            {
                throw new COMException("Exception from HRESULT: " + string.Format("0x{0:X}", returnVal), (int)returnVal);
            }
        }
Example #8
0
        public static ConsoleFeatures DmGetConsoleFeatures(XboxConsole Console)
        {
            var pdwConsoleFeatures = new XDRPCArgumentInfo <uint>(0, ArgumentType.Out);
            var returnVal          = Console.ExecuteRPC <uint>(XDRPCMode.Title, "xbdm.xex", 220, pdwConsoleFeatures);

            if (returnVal != 0x02DA0000)
            {
                throw new COMException("Exception from HRESULT: " + string.Format("0x{0:X}", returnVal), (int)returnVal);
            }
            return((ConsoleFeatures)pdwConsoleFeatures.Value);
        }
Example #9
0
        public static uint XexGetModuleHandle(XboxConsole Console, string ModuleName)
        {
            var name      = new XDRPCStringArgumentInfo(ModuleName, Encoding.ASCII);
            var handle    = new XDRPCArgumentInfo <uint>(0, ArgumentType.Out);
            var returnVal = Console.ExecuteRPC <uint>(XDRPCMode.Title, "xboxkrnl.exe", 405, name, handle);

            if (returnVal != 0x00000000)
            {
                throw new COMException("Exception from HRESULT: " + string.Format("0x{0:X}", returnVal), (int)returnVal);
            }
            return(handle.Value);
        }
Example #10
0
        public static DM_SYSTEM_INFO DmGetSystemInfo(XboxConsole Console)
        {
            var pdmGetSystemInfo = new XDRPCStructArgumentInfo <DM_SYSTEM_INFO>(new DM_SYSTEM_INFO {
                SizeOfStruct = 0x20
            }, ArgumentType.ByRef);
            var returnVal = Console.ExecuteRPC <uint>(XDRPCMode.Title, "xbdm.xex", 161, pdmGetSystemInfo);

            if (returnVal != 0x02DA0000)
            {
                throw new COMException("Exception from HRESULT: " + string.Format("0x{0:X}", returnVal), (int)returnVal);
            }
            return(pdmGetSystemInfo.Value);
        }
Example #11
0
        public static XAMACCOUNTINFO XamProfileFindAccount(XboxConsole Console, ulong OfflineXUID)
        {
            if (!XUID.IsOfflineXUID(OfflineXUID))
            {
                throw new Exception("XDKUtilities.XamProfileFindAccount: Invalid offline XUID specified.");
            }
            var xuidOffline  = new XDRPCArgumentInfo <ulong>(OfflineXUID);
            var pAccountInfo = new XDRPCStructArgumentInfo <XAMACCOUNTINFO>(new XAMACCOUNTINFO(), ArgumentType.Out);
            var returnVal    = Console.ExecuteRPC <uint>(XDRPCMode.Title, "xam.xex", 565, xuidOffline, pAccountInfo);

            //if (returnVal != 0x00000000) throw ProfilesExceptionFactory.CreateExceptionFromErrorCode(returnVal);
            return(pAccountInfo.Value);
        }
Example #12
0
        public static uint XamAlloc(XboxConsole Console, uint Flags, uint Size)
        {
            var dwFlags   = new XDRPCArgumentInfo <uint>(Flags);
            var cb        = new XDRPCArgumentInfo <uint>(Size);
            var ppv       = new XDRPCArgumentInfo <uint>(0, ArgumentType.Out);
            var returnVal = Console.ExecuteRPC <uint>(XDRPCMode.Title, "xam.xex", 490, dwFlags, cb, ppv);

            if (returnVal != 0x00000000)
            {
                throw new COMException("Exception from HRESULT: " + string.Format("0x{0:X}", returnVal), (int)returnVal);
            }
            return(ppv.Value);
        }
Example #13
0
        public static void XamShowPlayersUI(XboxConsole Console, uint XUserIndex)
        {
            if (XUserIndex > 3)
            {
                throw new Exception("XDKUtilities.XamShowPlayersUI: Invalid user index specified. It must be less than or equal to 3.");
            }
            var dwUserIndex = new XDRPCArgumentInfo <uint>(XUserIndex);
            var returnVal   = Console.ExecuteRPC <uint>(XDRPCMode.Title, "xam.xex", 712, dwUserIndex);

            if (returnVal != 0x00000000)
            {
                throw new COMException("Exception from HRESULT: " + string.Format("0x{0:X}", returnVal), (int)returnVal);
            }
        }
Example #14
0
        public static ExecutionID XamGetExecutionId(XboxConsole Console)
        {
            var ppExecutionId = new XDRPCArgumentInfo <uint>(0, ArgumentType.Out);
            var returnVal     = Console.ExecuteRPC <uint>(XDRPCMode.Title, "xam.xex", 640, ppExecutionId);

            if (returnVal != 0x00000000)
            {
                throw new COMException("Exception from HRESULT: " + string.Format("0x{0:X}", returnVal), (int)returnVal);
            }
            if (ppExecutionId.Value == 0)
            {
                throw new Exception("XDKUtilities.XamGetExecutionId: Invalid pointer returned.");
            }
            //The above only gets the pointer in console memory to the Execution ID. We still have to grab it below.
            //Props to MS devs for making a really nice function to do this.
            using (var refr = new XDRPCReference(Console, ppExecutionId.Value, 24)) return(refr.Get <ExecutionID>());
        }
Example #15
0
        public static byte[] ExGetXConfigSetting(XboxConsole Console, XCONFIG_CATEGORY_TYPES Category, short Entry, short SettingSize)
        {
            var dwCategory = new XDRPCArgumentInfo <short>((short)Category);
            var dwEntry    = new XDRPCArgumentInfo <short>(Entry);
            var pBuffer    = new XDRPCArrayArgumentInfo <byte[]>(new byte[SettingSize], ArgumentType.ByRef);
            var cbBuffer   = new XDRPCArgumentInfo <short>(SettingSize);
            var szSetting  = new XDRPCArgumentInfo <short>(0, ArgumentType.Out);
            var returnVal  = Console.ExecuteRPC <uint>(XDRPCMode.Title, "xboxkrnl.exe", 16, dwCategory, dwEntry, pBuffer, cbBuffer, szSetting);

            if (returnVal != 0x00000000)
            {
                throw new COMException("Exception from HRESULT: " + string.Format("0x{0:X}", returnVal), (int)returnVal);
            }
            if (szSetting.Value != SettingSize)
            {
                throw new XDRPCInvalidResponseException("XDKUtilities.ExGetXConfigSetting: The returned buffer size does not match the expected buffer size.");
            }
            return(pBuffer.Value);
        }
Example #16
0
        public static void XamShowGamerCardUIForXUID(XboxConsole Console, uint XUserIndex, ulong GamerXUID)
        {
            if (XUserIndex > 3)
            {
                throw new Exception("XDKUtilities.XamShowGamerCardUIForXUID: Invalid user index specified. It must be less than or equal to 3.");
            }
            if (!XUID.IsOnlineXUID(GamerXUID) && !XUID.IsTeamXUID(GamerXUID))
            {
                throw new Exception("XDKUtilities.XamShowGamerCardUIForXUID: Invalid gamer online/team XUID specified.");
            }
            var dwUserIndex = new XDRPCArgumentInfo <uint>(XUserIndex);
            var xuidPlayer  = new XDRPCArgumentInfo <ulong>(GamerXUID);
            var returnVal   = Console.ExecuteRPC <uint>(XDRPCMode.Title, "xam.xex", 771, dwUserIndex, xuidPlayer);

            if (returnVal != 0x00000000)
            {
                throw new COMException("Exception from HRESULT: " + string.Format("0x{0:X}", returnVal), (int)returnVal);
            }
        }
Example #17
0
        public static void HalSendSMCMessage(XboxConsole Console, byte[] Request, ref byte[] Response)
        {
            if (Request.Length != 16)
            {
                throw new Exception("XDKUtilities.HalSendSMCMessage: Invalid request specified. It must be 16 bytes in length.");
            }
            if (!Enum.IsDefined(typeof(SMCRequestTypes), Request[0]))
            {
                throw new Exception("XDKUtilities.HalSendSMCMessage: Invalid request specified. The first byte needs to be a valid request value.");
            }
            var request  = new XDRPCArrayArgumentInfo <byte[]>(Request);
            var response = Response == null ? (XDRPCArgumentInfo) new XDRPCNullArgumentInfo() : new XDRPCArrayArgumentInfo <byte[]>(Response, ArgumentType.ByRef);

            Console.ExecuteRPC <uint>(XDRPCMode.Title, "xboxkrnl.exe", 41, request, response);
            if (!(response is XDRPCNullArgumentInfo))
            {
                Response = ((XDRPCArrayArgumentInfo <byte[]>)response).Value;
            }
        }
Example #18
0
        public static string XamGetCachedTitleName(XboxConsole Console, uint TitleID)
        {
            if (TitleID == 0)
            {
                return(string.Empty);
            }
            var dwTitleId = new XDRPCArgumentInfo <uint>(TitleID);
            var pwsz      = new XDRPCArrayArgumentInfo <byte[]>(new byte[56], ArgumentType.Out, 56);
            var pcch      = new XDRPCArgumentInfo <int>(56, ArgumentType.ByRef);
            var returnVal = Console.ExecuteRPC <uint>(XDRPCMode.Title, "xam.xex", 694, dwTitleId, pwsz, pcch);

            if (returnVal == 0x3E5)
            {
                return(string.Empty);
            }
            if (returnVal != 0x00000000)
            {
                throw new COMException("Exception from HRESULT: " + string.Format("0x{0:X}", returnVal), (int)returnVal);
            }
            return(Encoding.BigEndianUnicode.GetString(pwsz.Value).Replace("\0", string.Empty));
        }
Example #19
0
        public static uint XexGetProcedureAddress(XboxConsole Console, uint ModuleHandle, uint FunctionOrdinal)
        {
            if (ModuleHandle == 0)
            {
                throw new Exception("XDKUtilities.XexGetProcedureAddress: Invalid module handle specified.");
            }
            if (FunctionOrdinal == 0)
            {
                throw new Exception("XDKUtilities.XexGetProcedureAddress: Invalid function ordinal specified.");
            }
            var handle    = new XDRPCArgumentInfo <uint>(ModuleHandle);
            var ordinal   = new XDRPCArgumentInfo <uint>(FunctionOrdinal);
            var address   = new XDRPCArgumentInfo <uint>(0, ArgumentType.Out);
            var returnVal = Console.ExecuteRPC <uint>(XDRPCMode.Title, "xboxkrnl.exe", 407, handle, ordinal, address);

            if (returnVal != 0x00000000)
            {
                throw new COMException("Exception from HRESULT: " + string.Format("0x{0:X}", returnVal), (int)returnVal);
            }
            return(address.Value);
        }
Example #20
0
        public static void XamShowFofUI(XboxConsole Console, uint XUserIndex, ulong FriendXUID, string Gamertag)
        {
            if (XUserIndex > 3)
            {
                throw new Exception("XDKUtilities.XamShowFofUI: Invalid user index specified. It must be less than or equal to 3.");
            }
            if (!XUID.IsOnlineXUID(FriendXUID) && !XUID.IsTeamXUID(FriendXUID))
            {
                throw new Exception("XDKUtilities.XamShowFofUI: Invalid friend online/team XUID specified.");
            }
            if (Gamertag.Length > 15)
            {
                throw new Exception("XDKUtilities.XamShowFofUI: Invalid Gamertag specified. It must be less than or equal to 16 characters in length.");
            }
            var dwUserIndex = new XDRPCArgumentInfo <uint>(XUserIndex);
            var xuidFriend  = new XDRPCArgumentInfo <ulong>(FriendXUID);
            var pszGamertag = new XDRPCStringArgumentInfo(Gamertag, Encoding.ASCII);
            var returnVal   = Console.ExecuteRPC <uint>(XDRPCMode.Title, "xam.xex", 1572, dwUserIndex, xuidFriend, pszGamertag);

            if (returnVal != 0x00000000)
            {
                throw new COMException("Exception from HRESULT: " + string.Format("0x{0:X}", returnVal), (int)returnVal);
            }
        }
 public static void HalSendSMCMessage(XboxConsole Console, byte[] Request, ref byte[] Response)
 {
     if (Request.Length != 16) throw new Exception("XDKUtilities.HalSendSMCMessage: Invalid request specified. It must be 16 bytes in length.");
     if (!Enum.IsDefined(typeof(SMCRequestTypes), Request[0])) throw new Exception("XDKUtilities.HalSendSMCMessage: Invalid request specified. The first byte needs to be a valid request value.");
     var request = new XDRPCArrayArgumentInfo<byte[]>(Request);
     var response = Response == null ? (XDRPCArgumentInfo)new XDRPCNullArgumentInfo() : new XDRPCArrayArgumentInfo<byte[]>(Response, ArgumentType.ByRef);
     Console.ExecuteRPC<uint>(XDRPCMode.Title, "xboxkrnl.exe", 41, request, response);
     if (!(response is XDRPCNullArgumentInfo)) Response = ((XDRPCArrayArgumentInfo<byte[]>)response).Value;
 }
 public static uint XamAlloc(XboxConsole Console, uint Flags, uint Size)
 {
     var dwFlags = new XDRPCArgumentInfo<uint>(Flags);
     var cb = new XDRPCArgumentInfo<uint>(Size);
     var ppv = new XDRPCArgumentInfo<uint>(0, ArgumentType.Out);
     var returnVal = Console.ExecuteRPC<uint>(XDRPCMode.Title, "xam.xex", 490, dwFlags, cb, ppv);
     if (returnVal != 0x00000000) throw new COMException("Exception from HRESULT: " + string.Format("0x{0:X}", returnVal), (int)returnVal);
     return ppv.Value;
 }
 public static bool XamFeatureEnabled(XboxConsole Console, XamAppIDs AppID)
 {
     var appID = new XDRPCArgumentInfo<uint>((uint)AppID);
     var returnVal = Console.ExecuteRPC<uint>(XDRPCMode.Title, "xam.xex", 512, appID);
     return Convert.ToBoolean(returnVal);
 }
 public static void XamFeatureEnableDisable(XboxConsole Console, bool EnableDisable, XamAppIDs AppID)
 {
     var enableDisable = new XDRPCArgumentInfo<bool>(EnableDisable);
     var appID = new XDRPCArgumentInfo<uint>((uint)AppID);
     var returnVal = Console.ExecuteRPC<uint>(XDRPCMode.Title, "xam.xex", 515, enableDisable, appID);
     if (returnVal != 0) throw new COMException("Exception from HRESULT: " + string.Format("0x{0:X}", returnVal), (int)returnVal);
 }
 public static uint XexGetModuleHandle(XboxConsole Console, string ModuleName)
 {
     var name = new XDRPCStringArgumentInfo(ModuleName, Encoding.ASCII);
     var handle = new XDRPCArgumentInfo<uint>(0, ArgumentType.Out);
     var returnVal = Console.ExecuteRPC<uint>(XDRPCMode.Title, "xboxkrnl.exe", 405, name, handle);
     if (returnVal != 0x00000000) throw new COMException("Exception from HRESULT: " + string.Format("0x{0:X}", returnVal), (int)returnVal);
     return handle.Value;
 }
 public static DM_SYSTEM_INFO DmGetSystemInfo(XboxConsole Console)
 {
     var pdmGetSystemInfo = new XDRPCStructArgumentInfo<DM_SYSTEM_INFO>(new DM_SYSTEM_INFO { SizeOfStruct = 0x20 }, ArgumentType.ByRef);
     var returnVal = Console.ExecuteRPC<uint>(XDRPCMode.Title, "xbdm.xex", 161, pdmGetSystemInfo);
     if (returnVal != 0x02DA0000) throw new COMException("Exception from HRESULT: " + string.Format("0x{0:X}", returnVal), (int)returnVal);
     return pdmGetSystemInfo.Value;
 }
 public static void XamShowFofUI(XboxConsole Console, uint XUserIndex, ulong FriendXUID, string Gamertag)
 {
     if (XUserIndex > 3) throw new Exception("XDKUtilities.XamShowFofUI: Invalid user index specified. It must be less than or equal to 3.");
     if (!XUID.IsOnlineXUID(FriendXUID) && !XUID.IsTeamXUID(FriendXUID)) throw new Exception("XDKUtilities.XamShowFofUI: Invalid friend online/team XUID specified.");
     if (Gamertag.Length > 15) throw new Exception("XDKUtilities.XamShowFofUI: Invalid Gamertag specified. It must be less than or equal to 16 characters in length.");
     var dwUserIndex = new XDRPCArgumentInfo<uint>(XUserIndex);
     var xuidFriend = new XDRPCArgumentInfo<ulong>(FriendXUID);
     var pszGamertag = new XDRPCStringArgumentInfo(Gamertag, Encoding.ASCII);
     var returnVal = Console.ExecuteRPC<uint>(XDRPCMode.Title, "xam.xex", 1572, dwUserIndex, xuidFriend, pszGamertag);
     if (returnVal != 0x00000000) throw new COMException("Exception from HRESULT: " + string.Format("0x{0:X}", returnVal), (int)returnVal);
 }
 public static void XamShowGameInviteUI(XboxConsole Console, uint XUserIndex, ulong[] Recipients = null)
 {
     if (XUserIndex > 3) throw new Exception("XDKUtilities.XamShowGameInviteUI: Invalid user index specified.It must be less than or equal to 3.");
     if (Recipients != null)
     {
         if (Recipients.Length > 64) throw new Exception("XDKUtilities.XamShowGameInviteUI: Too many recipients specified. The maximum is 64.");
         if (Recipients.Any(recipient => !XUID.IsOnlineXUID(recipient) && !XUID.IsTeamXUID(recipient))) throw new Exception("XDKUtilities.XamShowGameInviteUI: Invalid recipient online/team XUID specified.");
     }
     var dwUserIndex = new XDRPCArgumentInfo<uint>(XUserIndex);
     var pXuidRecipients = Recipients == null || Recipients.Length == 0 ? new XDRPCNullArgumentInfo() : (XDRPCArgumentInfo)new XDRPCArrayArgumentInfo<ulong[]>(Recipients);
     var cRecipients = Recipients == null ? 0 : Recipients.Length;
     var returnVal = Console.ExecuteRPC<uint>(XDRPCMode.Title, "xam.xex", 717, dwUserIndex, pXuidRecipients, cRecipients);
     if (returnVal != 0x00000000) throw new COMException("Exception from HRESULT: " + string.Format("0x{0:X}", returnVal), (int)returnVal);
 }
 public static void XamShowGamerCardUIForXUID(XboxConsole Console, uint XUserIndex, ulong GamerXUID)
 {
     if (XUserIndex > 3) throw new Exception("XDKUtilities.XamShowGamerCardUIForXUID: Invalid user index specified. It must be less than or equal to 3.");
     if (!XUID.IsOnlineXUID(GamerXUID) && !XUID.IsTeamXUID(GamerXUID)) throw new Exception("XDKUtilities.XamShowGamerCardUIForXUID: Invalid gamer online/team XUID specified.");
     var dwUserIndex = new XDRPCArgumentInfo<uint>(XUserIndex);
     var xuidPlayer = new XDRPCArgumentInfo<ulong>(GamerXUID);
     var returnVal = Console.ExecuteRPC<uint>(XDRPCMode.Title, "xam.xex", 771, dwUserIndex, xuidPlayer);
     if (returnVal != 0x00000000) throw new COMException("Exception from HRESULT: " + string.Format("0x{0:X}", returnVal), (int)returnVal);
 }
 public static ConsoleTypes DmGetConsoleType(XboxConsole Console)
 {
     var pdwConsoleType = new XDRPCArgumentInfo<uint>(0, ArgumentType.Out);
     var returnVal = Console.ExecuteRPC<uint>(XDRPCMode.Title, "xbdm.xex", 140, pdwConsoleType);
     if (returnVal != 0x02DA0000) throw new COMException("Exception from HRESULT: " + string.Format("0x{0:X}", returnVal), (int)returnVal);
     return (ConsoleTypes)pdwConsoleType.Value;
 }
 public static void XamShowMessageComposeUI(XboxConsole Console, uint XUserIndex, ulong[] Recipients = null, string MessageText = "")
 {
     if (XUserIndex > 3) throw new Exception("XDKUtilities.XamShowMessageComposeUI: Invalid user index specified.");
     if (Recipients != null)
     {
         if (Recipients.Length > 64) throw new Exception("XDKUtilities.XamShowMessageComposeUI: Too many recipients specified. The maximum is 64.");
         if (Recipients.Any(recipient => !XUID.IsOnlineXUID(recipient) && !XUID.IsTeamXUID(recipient))) throw new Exception("XDKUtilities.XamShowMessageComposeUI: Invalid recipient online/team XUID specified.");
     }
     if (MessageText.Length > 255) throw new Exception("XDKUtilities.XamShowMessageComposeUI: Specified message text is invalid. It must be less than or equal to 255 characters in length.");
     var dwUserIndex = new XDRPCArgumentInfo<uint>(XUserIndex);
     var pXuidRecipients = Recipients == null || Recipients.Length == 0 ? new XDRPCNullArgumentInfo() : (XDRPCArgumentInfo)new XDRPCArrayArgumentInfo<ulong[]>(Recipients);
     var cRecipients = Recipients == null ? 0 : Recipients.Length;
     var pszText = string.IsNullOrWhiteSpace(MessageText) ? new XDRPCNullArgumentInfo() : (XDRPCArgumentInfo)new XDRPCStringArgumentInfo(MessageText, Encoding.BigEndianUnicode);
     var returnVal = Console.ExecuteRPC<uint>(XDRPCMode.Title, "xam.xex", 716, dwUserIndex, pXuidRecipients, cRecipients, pszText);
     if (returnVal != 0x00000000) throw new COMException("Exception from HRESULT: " + string.Format("0x{0:X}", returnVal), (int)returnVal);
 }
 public static string XamGetCachedTitleName(XboxConsole Console, uint TitleID)
 {
     if (TitleID == 0) return string.Empty;
     var dwTitleId = new XDRPCArgumentInfo<uint>(TitleID);
     var pwsz = new XDRPCArrayArgumentInfo<byte[]>(new byte[56], ArgumentType.Out, 56);
     var pcch = new XDRPCArgumentInfo<int>(56, ArgumentType.ByRef);
     var returnVal = Console.ExecuteRPC<uint>(XDRPCMode.Title, "xam.xex", 694, dwTitleId, pwsz, pcch);
     if (returnVal == 0x3E5) return string.Empty;
     if (returnVal != 0x00000000) throw new COMException("Exception from HRESULT: " + string.Format("0x{0:X}", returnVal), (int)returnVal);
     return Encoding.BigEndianUnicode.GetString(pwsz.Value).Replace("\0", string.Empty);
 }
 public static void XamFree(XboxConsole Console, uint Address)
 {
     var pv = new XDRPCArgumentInfo<uint>(Address);
     Console.ExecuteRPC<uint>(XDRPCMode.Title, "xam.xex", 492, pv);
 }
 public static uint XexGetProcedureAddress(XboxConsole Console, uint ModuleHandle, uint FunctionOrdinal)
 {
     if (ModuleHandle == 0) throw new Exception("XDKUtilities.XexGetProcedureAddress: Invalid module handle specified.");
     if (FunctionOrdinal == 0) throw new Exception("XDKUtilities.XexGetProcedureAddress: Invalid function ordinal specified.");
     var handle = new XDRPCArgumentInfo<uint>(ModuleHandle);
     var ordinal = new XDRPCArgumentInfo<uint>(FunctionOrdinal);
     var address = new XDRPCArgumentInfo<uint>(0, ArgumentType.Out);
     var returnVal = Console.ExecuteRPC<uint>(XDRPCMode.Title, "xboxkrnl.exe", 407, handle, ordinal, address);
     if (returnVal != 0x00000000) throw new COMException("Exception from HRESULT: " + string.Format("0x{0:X}", returnVal), (int)returnVal);
     return address.Value;
 }
 public static void XamShowPlayersUI(XboxConsole Console, uint XUserIndex)
 {
     if (XUserIndex > 3) throw new Exception("XDKUtilities.XamShowPlayersUI: Invalid user index specified. It must be less than or equal to 3.");
     var dwUserIndex = new XDRPCArgumentInfo<uint>(XUserIndex);
     var returnVal = Console.ExecuteRPC<uint>(XDRPCMode.Title, "xam.xex", 712, dwUserIndex);
     if (returnVal != 0x00000000) throw new COMException("Exception from HRESULT: " + string.Format("0x{0:X}", returnVal), (int)returnVal);
 }
Example #36
0
        public static void XamFree(XboxConsole Console, uint Address)
        {
            var pv = new XDRPCArgumentInfo <uint>(Address);

            Console.ExecuteRPC <uint>(XDRPCMode.Title, "xam.xex", 492, pv);
        }
 public static void XNotifyQueueUI(XboxConsole Console, uint XUserIndex, XNotifyUITypes XNotifyUIType, XNotifyUIPriorities XNotifyUIPriority, string XNotifyMessage)
 {
     if (XUserIndex > 3) throw new Exception("XDKUtilities.XNotifyQueueUI: Invalid user index specified. It must be less than or equal to 3.");
     if (!Enum.IsDefined(typeof(XNotifyUITypes), XNotifyUIType)) throw new Exception("XDKUtilities.XNotifyQueueUI: Invalid notification type specified.");
     if (!Enum.IsDefined(typeof(XNotifyUIPriorities), XNotifyUIPriority)) throw new Exception("XDKUtilities.XNotifyQueueUI: Invalid notification priority specified.");
     var dwType = new XDRPCArgumentInfo<uint>((uint)XNotifyUIType);
     var dwUserIndex = new XDRPCArgumentInfo<uint>(XUserIndex);
     var dwPriority = new XDRPCArgumentInfo<uint>((uint)XNotifyUIPriority);
     var pwszStringParam = new XDRPCStringArgumentInfo(XNotifyMessage, Encoding.BigEndianUnicode);
     var returnVal = Console.ExecuteRPC<uint>(XDRPCMode.Title, "xam.xex", 656, dwType, dwUserIndex, dwPriority, pwszStringParam);
     if (returnVal != 0x00000000) throw new COMException("Exception from HRESULT: " + string.Format("0x{0:X}", returnVal), (int)returnVal);
 }