Ejemplo n.º 1
1
 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>();
 }
Ejemplo n.º 2
1
 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;
 }
Ejemplo n.º 3
1
 public static void SendFriendRequest(XDevkit.IXboxConsole xbc, Xuid xuidFrom, Xuid xuidTo)
 {
     try
     {
         XDRPCExecutionOptions options = new XDRPCExecutionOptions(XDRPCMode.Title, "xam.xex", 0x4e6);
         XDRPCArgumentInfo<ulong> info = new XDRPCArgumentInfo<ulong>((ulong)xuidFrom);
         XDRPCArgumentInfo<ulong> info2 = new XDRPCArgumentInfo<ulong>((ulong)xuidTo);
         XDRPCNullArgumentInfo info3 = new XDRPCNullArgumentInfo();
         uint errorCode = ((XDevkit.IXboxConsole)xbc).ExecuteRPC<uint>(options, new XDRPCArgumentInfo[] { info, info2, info3 });
         if (errorCode != 0)
         {
             //throw ProfilesExceptionFactory.CreateExceptionFromErrorCode(errorCode);
         }
     }
     catch (XDRPCException exception)
     {
         //throw new ProfilesException(exception);
     }
 }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 5
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));
        }
Ejemplo n.º 6
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);
            }
        }
Ejemplo n.º 7
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);
            }
        }
Ejemplo n.º 8
0
        static public void GetPartyState(XDevkit.IXboxConsole xbc, out PartyState state, out PartyErrorCodes errorCode)
        {
            XDRPCExecutionOptions    options = new XDRPCExecutionOptions(XDRPCMode.Title, "xam.xex", 0xb0f);
            XDRPCArgumentInfo <uint> info    = new XDRPCArgumentInfo <uint>(0, ArgumentType.Out);
            XDRPCArgumentInfo <uint> info2   = new XDRPCArgumentInfo <uint>(0, ArgumentType.Out);

            ((XDevkit.IXboxConsole)xbc).ExecuteRPC <uint>(options, new XDRPCArgumentInfo[] { info, info2 });
            state     = (PartyState)info.Value;
            errorCode = (PartyErrorCodes)info2.Value;
        }
Ejemplo n.º 9
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);
            }
        }
Ejemplo n.º 10
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);
        }
Ejemplo n.º 11
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);
        }
Ejemplo n.º 12
0
        static public XDRPCStructArgumentInfo <XPARTY_USER_LIST> GetPartyUserList(XDevkit.IXboxConsole xbc)
        {
            XDRPCExecutionOptions    options = new XDRPCExecutionOptions(XDRPCMode.Title, "xam.xex", 0xaff);
            XDRPCArgumentInfo <uint> info    = new XDRPCArgumentInfo <uint>(1);
            XDRPCStructArgumentInfo <XPARTY_USER_LIST> info2 = new XDRPCStructArgumentInfo <XPARTY_USER_LIST>(new XPARTY_USER_LIST(), ArgumentType.Out);
            uint errorCode = ((XDevkit.IXboxConsole)xbc).ExecuteRPC <uint>(options, new XDRPCArgumentInfo[] { info, info2 });

            if (errorCode != 0)
            {
                //throw ProfilesExceptionFactory.CreateExceptionFromErrorCode(errorCode);
            }
            return(info2);
        }
Ejemplo n.º 13
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);
        }
Ejemplo n.º 14
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);
        }
Ejemplo n.º 15
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);
            }
        }
Ejemplo n.º 16
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>());
        }
Ejemplo n.º 17
0
 static public void KickUserFromParty(XDevkit.IXboxConsole xbc, Xuid xuidToKick)
 {
     try
     {
         XDRPCStructArgumentInfo <XPARTY_USER_LIST> partyUserList = GetPartyUserList(xbc);
         XDRPCExecutionOptions     options = new XDRPCExecutionOptions(XDRPCMode.Title, "xam.xex", 0xb02);
         XDRPCArgumentInfo <ulong> info2   = new XDRPCArgumentInfo <ulong>((ulong)xuidToKick);
         uint errorCode = ((XDevkit.IXboxConsole)xbc).ExecuteRPC <uint>(options, new XDRPCArgumentInfo[] { info2 });
         if (errorCode != 0)
         {
             CreateExceptionFromErrorCode(errorCode);
         }
         WaitForPartyState(xbc, PartyState.XPARTY_STATE_INPARTY, TimeSpan.FromSeconds(15.0));
     }
     catch (XDRPCException exception)
     {
         //throw new ProfilesException(exception);
     }
 }
Ejemplo n.º 18
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);
        }
Ejemplo n.º 19
0
 static public void SendFriendRequest(XDevkit.IXboxConsole xbc, Xuid xuidFrom, Xuid xuidTo)
 {
     try
     {
         XDRPCExecutionOptions     options = new XDRPCExecutionOptions(XDRPCMode.Title, "xam.xex", 0x4e6);
         XDRPCArgumentInfo <ulong> info    = new XDRPCArgumentInfo <ulong>((ulong)xuidFrom);
         XDRPCArgumentInfo <ulong> info2   = new XDRPCArgumentInfo <ulong>((ulong)xuidTo);
         XDRPCNullArgumentInfo     info3   = new XDRPCNullArgumentInfo();
         uint errorCode = ((XDevkit.IXboxConsole)xbc).ExecuteRPC <uint>(options, new XDRPCArgumentInfo[] { info, info2, info3 });
         if (errorCode != 0)
         {
             //throw ProfilesExceptionFactory.CreateExceptionFromErrorCode(errorCode);
         }
     }
     catch (XDRPCException exception)
     {
         //throw new ProfilesException(exception);
     }
 }
Ejemplo n.º 20
0
        static public uint GetXuidFromIndex(XDevkit.IXboxConsole xbc, UserIndex userIndex, out ulong offlineXuid)
        {
            uint num2;
            //try
            //{
            XDRPCExecutionOptions     options = new XDRPCExecutionOptions(XDRPCMode.Title, "xam.xex", 0x20a);
            XDRPCArgumentInfo <uint>  info    = new XDRPCArgumentInfo <uint>((uint)userIndex);
            XDRPCArgumentInfo <uint>  info2   = new XDRPCArgumentInfo <uint>(2);
            XDRPCArgumentInfo <ulong> info3   = new XDRPCArgumentInfo <ulong>(0L, ArgumentType.Out);
            uint num = ((XDevkit.IXboxConsole)xbc).ExecuteRPC <uint>(options, new XDRPCArgumentInfo[] { info, info2, info3 });

            offlineXuid = info3.Value;
            num2        = num;
            //}
            //catch (XDRPCException exception)
            //{
            //}
            return(num2);
        }
Ejemplo n.º 21
0
        //static public string GetXUID(XDevkit.IXboxConsole xbc, string gamertag)
        //{
        //    XDRPCExecutionOptions options = new XDRPCExecutionOptions(XDRPCMode.Title, Addresses.g_XUserFindUserAddressDEV);


        //    //((XDevkit.IXboxConsole)xbc).Call(0x81824DF8, new object[] { 0x0009000006F93463, 0, gamertag, (int)0x18, Addresses.g_freememory + 0x20, 0 });
        //    XDRPCStringArgumentInfo GT = new XDRPCStringArgumentInfo(gamertag, Encoding.ASCII);
        //    XDRPCArgumentInfo<ulong> MyXUID = new XDRPCArgumentInfo<ulong>(0x0009000006F93463L);
        //    XDRPCArgumentInfo<int> idk = new XDRPCArgumentInfo<int>(0);
        //    XDRPCArgumentInfo<int> idk2 = new XDRPCArgumentInfo<int>((int)0x18);
        //    XDRPCArgumentInfo<ulong> XUID = new XDRPCArgumentInfo<ulong>(0L);
        //    uint num = ((XDevkit.IXboxConsole)xbc).ExecuteRPC<uint>(options, new XDRPCArgumentInfo[] { MyXUID, idk, GT, idk2, XUID, idk });

        //    return XUID.Value.ToString("X16");
        //}

        static public void JoinParty(XDevkit.IXboxConsole xbc, UserIndex userIndex, Xuid xuidContact)
        {
            try
            {
                XDRPCExecutionOptions     options = new XDRPCExecutionOptions(XDRPCMode.Title, "xam.xex", 0xb01);
                XDRPCArgumentInfo <uint>  info    = new XDRPCArgumentInfo <uint>((uint)userIndex);
                XDRPCArgumentInfo <ulong> info2   = new XDRPCArgumentInfo <ulong>((ulong)xuidContact);
                uint errorCode = ((XDevkit.IXboxConsole)xbc).ExecuteRPC <uint>(options, new XDRPCArgumentInfo[] { info, info2 });
                if (errorCode != 0)
                {
                    CreateExceptionFromErrorCode(errorCode);
                }
                WaitForPartyState(xbc, PartyState.XPARTY_STATE_INPARTY, TimeSpan.FromSeconds(15.0));
            }
            catch (XDRPCException exception)
            {
                //throw new ProfilesException(exception);
            }
        }
Ejemplo n.º 22
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);
            }
        }
Ejemplo n.º 23
0
        public static FIND_USER_INFO_RESPONSE XUserFindUser(XDevkit.IXboxConsole xbc, ulong YourXUID, string GamertagOrXUID)
        {
            var qwUserId = new XDRPCArgumentInfo <ulong>(YourXUID);
            XDRPCArgumentInfo qwFindId     = null;
            XDRPCArgumentInfo szSenderName = null;

            //if (GamertagOrXUID is ulong)
            //{
            //    if (!XUID.IsOnlineXUID((ulong)GamertagOrXUID) && !XUID.IsTeamXUID((ulong)GamertagOrXUID)) throw new Exception("XDKUtilities.XUserFindUser: Invalid gamer online/team XUID specified.");
            //    qwFindId = new XDRPCArgumentInfo<ulong>((ulong)GamertagOrXUID);
            //}
            //else if (GamertagOrXUID is string)
            {
                if (GamertagOrXUID.Length > 15)
                {
                    throw new Exception("XDKUtilities.XUserFindUser: Invalid Gamertag specified. It must be less than or equal to 15 characters in length.");
                }
                szSenderName = new XDRPCStringArgumentInfo(GamertagOrXUID, Encoding.ASCII, ArgumentType.ByRef, 16);
            }
            if (qwFindId == null && szSenderName == null)
            {
                throw new Exception("XDKUtilities.XUserFindUser: Invalid gamertag/XUID specified.");
            }
            if (qwFindId == null)
            {
                qwFindId = new XDRPCArgumentInfo <ulong>(0);
            }
            if (szSenderName == null)
            {
                szSenderName = new XDRPCStringArgumentInfo(string.Empty, Encoding.ASCII, ArgumentType.ByRef, 16);
            }
            var cbResults    = new XDRPCArgumentInfo <int>(0x18);
            var pResults     = new XDRPCStructArgumentInfo <FIND_USER_INFO_RESPONSE>(new FIND_USER_INFO_RESPONSE(), ArgumentType.Out);
            var pXOverlapped = new XDRPCArgumentInfo <uint>(0);
            var returnVal    = ((XDevkit.IXboxConsole)xbc).ExecuteRPC <uint>(XDRPCMode.Title, Tools.Addresses.g_XUserFindUserAddressDEV, qwUserId, qwFindId, szSenderName, cbResults, pResults, pXOverlapped);

            if (returnVal != 0x00000000)
            {
                throw new COMException("Exception from HRESULT: " + string.Format("0x{0:X}", returnVal), (int)returnVal);
            }
            return(pResults.Value);
        }
Ejemplo n.º 24
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));
        }
Ejemplo n.º 25
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);
        }
Ejemplo n.º 26
0
        //static public string[] ListFGamerTags = new string[32];
        //static public string[] ListFSXuid = new string[8];
        //static public ulong[] ListFLXuid = new ulong[8];

        //static public IEnumerable<Friend> EnumerateFriends(XDevkit.IXboxConsole xbc, UserIndex userIndex)
        //static public void GetMyFriends(XDevkit.IXboxConsole xbc, UserIndex userIndex)
        //{
        //    uint friendIndex = 0;
        //    while (true)
        //    {
        //        XONLINE_FRIEND iteratorVariable0;
        //        if (GetNextFriend(xbc, userIndex, friendIndex, out iteratorVariable0) != 0)
        //        {
        //            yield break;
        //        }
        //        FriendRequestStatus requestAccepted = FriendRequestStatus.RequestAccepted;
        //        if ((iteratorVariable0.dwFriendState & 0x40000000) > 0)
        //        {
        //            requestAccepted = FriendRequestStatus.RequestSent;
        //        }
        //        else if ((iteratorVariable0.dwFriendState & 0x80000000) > 0)
        //        {
        //            requestAccepted = FriendRequestStatus.RequestReceived;
        //        }
        //        FriendStatus offline = FriendStatus.Offline;
        //        if ((iteratorVariable0.dwFriendState & 1) > 0)
        //        {
        //            offline = ((FriendStatus)iteratorVariable0.dwFriendState) & ((FriendStatus)0xf0000);
        //        }
        //        //Friend iteratorVariable4 = new Friend(iteratorVariable0.szGamertag, iteratorVariable0.xuid, requestAccepted, offline, iteratorVariable0.wszRichPresence, iteratorVariable0.dwTitleID);
        //        //yield return iteratorVariable4;
        //        friendIndex++;
        //    }
        //}

        static private uint GetNextFriend(XDevkit.IXboxConsole xbc, UserIndex userIndex, uint friendIndex, out XONLINE_FRIEND friend)
        {
            uint num2;

            //try
            //{
            friend = new XONLINE_FRIEND();
            XDRPCExecutionOptions    options = new XDRPCExecutionOptions(XDRPCMode.Title, "xam.xex", 0x4ea);
            XDRPCArgumentInfo <uint> info    = new XDRPCArgumentInfo <uint>((uint)userIndex);
            XDRPCArgumentInfo <uint> info2   = new XDRPCArgumentInfo <uint>(friendIndex);
            XDRPCArgumentInfo <uint> info3   = new XDRPCArgumentInfo <uint>(1);
            XDRPCArgumentInfo <uint> info4   = new XDRPCArgumentInfo <uint>(0, ArgumentType.Out);
            XDRPCArgumentInfo <uint> info5   = new XDRPCArgumentInfo <uint>(0, ArgumentType.Out);
            uint num = ((XDevkit.IXboxConsole)xbc).ExecuteRPC <uint>(options, new XDRPCArgumentInfo[] { info, info2, info3, info4, info5 });

            if (num == 0)
            {
                options = new XDRPCExecutionOptions(XDRPCMode.Title, "xam.xex", 0x250);
                info5   = new XDRPCArgumentInfo <uint>(info5.Value);
                XDRPCArgumentInfo <uint> info6 = new XDRPCArgumentInfo <uint>(0);
                XDRPCStructArgumentInfo <XONLINE_FRIEND> info7 = new XDRPCStructArgumentInfo <XONLINE_FRIEND>(new XONLINE_FRIEND(), ArgumentType.Out);
                info4 = new XDRPCArgumentInfo <uint>(info4.Value);
                XDRPCArgumentInfo <uint> info8 = new XDRPCArgumentInfo <uint>(0, ArgumentType.Out);
                XDRPCNullArgumentInfo    info9 = new XDRPCNullArgumentInfo();
                num     = ((XDevkit.IXboxConsole)xbc).ExecuteRPC <uint>(options, new XDRPCArgumentInfo[] { info5, info6, info7, info4, info8, info9 });
                friend  = info7.Value;
                options = new XDRPCExecutionOptions(XDRPCMode.Title, "xam.xex", 0x414);
                ((XDevkit.IXboxConsole)xbc).ExecuteRPC <bool>(options, new XDRPCArgumentInfo[] { info5 });
            }
            num2 = num;
            //}
            //catch (XDRPCException exception)
            //{
            //    //throw new ProfilesException(exception);
            //}
            return(num2);
        }
Ejemplo n.º 27
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);
            }
        }
Ejemplo n.º 28
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);
 }
Ejemplo n.º 29
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);
 }
Ejemplo n.º 30
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);
 }
Ejemplo n.º 31
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);
 }
Ejemplo n.º 32
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);
 }
Ejemplo n.º 33
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);
 }
Ejemplo n.º 34
0
 public XDRPCSizeOfArgumentInfo()
 {
     this.TargetArgument = (XDRPCArgumentInfo)null;
 }
Ejemplo n.º 35
0
 public static XDRPCStructArgumentInfo<XPARTY_USER_LIST> GetPartyUserList(XDevkit.IXboxConsole xbc)
 {
     XDRPCExecutionOptions options = new XDRPCExecutionOptions(XDRPCMode.Title, "xam.xex", 0xaff);
     XDRPCArgumentInfo<uint> info = new XDRPCArgumentInfo<uint>(1);
     XDRPCStructArgumentInfo<XPARTY_USER_LIST> info2 = new XDRPCStructArgumentInfo<XPARTY_USER_LIST>(new XPARTY_USER_LIST(), ArgumentType.Out);
     uint errorCode = ((XDevkit.IXboxConsole)xbc).ExecuteRPC<uint>(options, new XDRPCArgumentInfo[] { info, info2 });
     if (errorCode != 0)
     {
         //throw ProfilesExceptionFactory.CreateExceptionFromErrorCode(errorCode);
     }
     return info2;
 }
Ejemplo n.º 36
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;
 }
Ejemplo n.º 37
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);
 }
Ejemplo n.º 38
0
 //static public string GetXUID(XDevkit.IXboxConsole xbc, string gamertag)
 //{
 //    XDRPCExecutionOptions options = new XDRPCExecutionOptions(XDRPCMode.Title, Addresses.g_XUserFindUserAddressDEV);
 //    //((XDevkit.IXboxConsole)xbc).Call(0x81824DF8, new object[] { 0x0009000006F93463, 0, gamertag, (int)0x18, Addresses.g_freememory + 0x20, 0 });
 //    XDRPCStringArgumentInfo GT = new XDRPCStringArgumentInfo(gamertag, Encoding.ASCII);
 //    XDRPCArgumentInfo<ulong> MyXUID = new XDRPCArgumentInfo<ulong>(0x0009000006F93463L);
 //    XDRPCArgumentInfo<int> idk = new XDRPCArgumentInfo<int>(0);
 //    XDRPCArgumentInfo<int> idk2 = new XDRPCArgumentInfo<int>((int)0x18);
 //    XDRPCArgumentInfo<ulong> XUID = new XDRPCArgumentInfo<ulong>(0L);
 //    uint num = ((XDevkit.IXboxConsole)xbc).ExecuteRPC<uint>(options, new XDRPCArgumentInfo[] { MyXUID, idk, GT, idk2, XUID, idk });
 //    return XUID.Value.ToString("X16");
 //}
 public static void JoinParty(XDevkit.IXboxConsole xbc, UserIndex userIndex, Xuid xuidContact)
 {
     try
     {
         XDRPCExecutionOptions options = new XDRPCExecutionOptions(XDRPCMode.Title, "xam.xex", 0xb01);
         XDRPCArgumentInfo<uint> info = new XDRPCArgumentInfo<uint>((uint)userIndex);
         XDRPCArgumentInfo<ulong> info2 = new XDRPCArgumentInfo<ulong>((ulong)xuidContact);
         uint errorCode = ((XDevkit.IXboxConsole)xbc).ExecuteRPC<uint>(options, new XDRPCArgumentInfo[] { info, info2 });
         if (errorCode != 0)
         {
             CreateExceptionFromErrorCode(errorCode);
         }
         WaitForPartyState(xbc, PartyState.XPARTY_STATE_INPARTY, TimeSpan.FromSeconds(15.0));
     }
     catch (XDRPCException exception)
     {
         //throw new ProfilesException(exception);
     }
 }
Ejemplo n.º 39
0
 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;
 }
Ejemplo n.º 40
0
 public void SetClanTagText(string clantag)
 {
     XDRPCExecutionOptions options = new XDRPCExecutionOptions(XDRPCMode.Title, this.Addresses.SetClanTagText);
     XDRPCArgumentInfo<uint> info = new XDRPCArgumentInfo<uint>(0);
     XDRPCStringArgumentInfo info2 = new XDRPCStringArgumentInfo(clantag);
     ((XDevkit.IXboxConsole) xbc).ExecuteRPC<uint>(options, new XDRPCArgumentInfo[] { info, info2 });
 }
Ejemplo n.º 41
0
 public XDRPCSizeOfArgumentInfo(XDRPCArgumentInfo target)
 {
     this.TargetArgument = target;
 }
Ejemplo n.º 42
0
 public void MakeStableStatsBuffer()
 {
     XDRPCExecutionOptions options = new XDRPCExecutionOptions(XDRPCMode.Title, this.Addresses.SetIntPlayerStat);
     XDRPCArgumentInfo<uint> info = new XDRPCArgumentInfo<uint>(((XDevkit.IXboxConsole) this.xbc).ExecuteRPC<uint>(new XDRPCExecutionOptions(XDRPCMode.Title, this.Addresses.StableBufferHelper), new XDRPCArgumentInfo[] { new XDRPCArgumentInfo<uint>(0) }));
     ((XDevkit.IXboxConsole) this.xbc).ExecuteRPC<uint>(options, new XDRPCArgumentInfo[] { info });
 }
Ejemplo n.º 43
0
        public static uint Call(this XDevkit.IXboxConsole xbCon, uint address, params object[] arg)
        {
            if (((XDevkit.IXboxConsole)xbCon).SupportsRPC())
            {
                bool flag = false;
                if (xbCon != null)
                {
                    XDRPCExecutionOptions       options    = new XDRPCExecutionOptions(XDRPCMode.Title, address);
                    XDRPCArgumentInfo[]         args       = new XDRPCArgumentInfo[arg.Length];
                    XDRPCArgumentInfo <float>[] infoArray2 = new XDRPCArgumentInfo <float> [arg.Length];
                    for (int i = 0; i < arg.Length; i++)
                    {
                        object obj2 = arg[i];
                        if (obj2 is string)
                        {
                            args[i] = new XDRPCStringArgumentInfo((string)obj2);
                        }
                        else if (obj2 is int)
                        {
                            args[i] = new XDRPCArgumentInfo <int>((int)obj2);
                        }
                        else if (obj2 is uint)
                        {
                            args[i] = new XDRPCArgumentInfo <uint>((uint)obj2);
                        }
                        else if (obj2 is float)
                        {
                            infoArray2[i] = new XDRPCArgumentInfo <float>((float)obj2);
                            flag          = true;
                        }
                        else if (obj2 is long)
                        {
                            args[i] = new XDRPCArgumentInfo <long>((long)obj2);
                        }
                        else if (obj2 is byte[])
                        {
                            args[i] = new XDRPCArrayArgumentInfo <byte[]>((byte[])obj2);
                        }
                        else if (obj2 is short)
                        {
                            args[i] = new XDRPCArgumentInfo <short>((short)obj2);
                        }
                        else if (obj2 is byte)
                        {
                            args[i] = new XDRPCArgumentInfo <byte>((byte)obj2);
                        }
                        else if (obj2 is char[])
                        {
                            args[i] = new XDRPCArrayArgumentInfo <char[]>((char[])obj2);
                        }
                        else if (obj2 is char)
                        {
                            args[i] = new XDRPCArgumentInfo <char>((char)obj2);
                        }
                        else
                        {
                            Console.WriteLine("Invalid Arg");
                            return(0);
                        }
                    }
                    try
                    {
                        if (flag)
                        {
                            return((uint)((XDevkit.IXboxConsole)xbCon).ExecuteRPC <float>(options, infoArray2));
                        }
                        return(((XDevkit.IXboxConsole)xbCon).ExecuteRPC <uint>(options, args));
                    }
                    catch (Exception)
                    {
                        return(0);
                    }
                }
                return(0);
            }
            long[] argument = new long[9];
            if (firstRan == 0)
            {
                byte[] buffer = new byte[4];
                xbCon.DebugTarget.GetMemory(0x91c088ae, 4, buffer, out meh);
                xbCon.DebugTarget.InvalidateMemoryCache(true, 0x91c088ae, 4);
                Array.Reverse(buffer);
                bufferAddress = BitConverter.ToUInt32(buffer, 0);
                firstRan      = 1;
                stringPointer = bufferAddress + 0x5dc;
                floatPointer  = bufferAddress + 0xa8c;
                bytePointer   = bufferAddress + 0xc80;
                xbCon.DebugTarget.SetMemory(bufferAddress, 100, nulled, out meh);
                xbCon.DebugTarget.SetMemory(stringPointer, 100, nulled, out meh);
            }
            if (bufferAddress == 0)
            {
                byte[] buffer2 = new byte[4];
                xbCon.DebugTarget.GetMemory(0x91c088ae, 4, buffer2, out meh);
                xbCon.DebugTarget.InvalidateMemoryCache(true, 0x91c088ae, 4);
                Array.Reverse(buffer2);
                bufferAddress = BitConverter.ToUInt32(buffer2, 0);
            }
            stringPointer = bufferAddress + 0x5dc;
            floatPointer  = bufferAddress + 0xa8c;
            bytePointer   = bufferAddress + 0xc80;
            int num4  = 0;
            int index = 0;

            foreach (object obj3 in arg)
            {
                if (obj3 is byte)
                {
                    byte[] buffer3 = (byte[])obj3;
                    argument[index] = BitConverter.ToUInt32(buffer3, 0);
                }
                else if (obj3 is byte[])
                {
                    byte[] buffer4 = (byte[])obj3;
                    xbCon.DebugTarget.SetMemory(bytePointer, (uint)buffer4.Length, buffer4, out meh);
                    argument[index] = bytePointer;
                    bytePointer    += (uint)(buffer4.Length + 2);
                }
                else if (obj3 is float)
                {
                    byte[] buffer5 = BitConverter.GetBytes(float.Parse(Convert.ToString(obj3)));
                    xbCon.DebugTarget.SetMemory(floatPointer, (uint)buffer5.Length, buffer5, out meh);
                    argument[index] = floatPointer;
                    floatPointer   += (uint)(buffer5.Length + 2);
                }
                else if (obj3 is float[])
                {
                    byte[] dst  = new byte[12];
                    int    num6 = 0;
                    for (num6 = 0; num6 <= 2; num6++)
                    {
                        byte[] buffer7 = new byte[4];
                        Buffer.BlockCopy((Array)obj3, num6 * 4, buffer7, 0, 4);
                        Array.Reverse(buffer7);
                        Buffer.BlockCopy(buffer7, 0, dst, 4 * num6, 4);
                    }
                    xbCon.DebugTarget.SetMemory(floatPointer, (uint)dst.Length, dst, out meh);
                    argument[index] = floatPointer;
                    floatPointer   += 2;
                }
                else if (obj3 is string)
                {
                    byte[] buffer8 = Encoding.ASCII.GetBytes(Convert.ToString(obj3));
                    xbCon.DebugTarget.SetMemory(stringPointer, (uint)buffer8.Length, buffer8, out meh);
                    argument[index] = stringPointer;
                    string str = Convert.ToString(obj3);
                    stringPointer += (uint)(str.Length + 1);
                }
                else
                {
                    argument[index] = Convert.ToInt64(obj3);
                }
                num4++;
                index++;
            }
            byte[] data = getData(argument);
            xbCon.DebugTarget.SetMemory(bufferAddress + 8, (uint)data.Length, data, out meh);
            byte[] bytes = BitConverter.GetBytes(num4);
            Array.Reverse(bytes);
            xbCon.DebugTarget.SetMemory(bufferAddress + 4, 4, bytes, out meh);
            Thread.Sleep(0);
            byte[] array = BitConverter.GetBytes(address);
            Array.Reverse(array);
            xbCon.DebugTarget.SetMemory(bufferAddress, 4, array, out meh);
            Thread.Sleep(50);
            byte[] buffer12 = new byte[4];
            xbCon.DebugTarget.GetMemory(bufferAddress + 0xffc, 4, buffer12, out meh);
            xbCon.DebugTarget.InvalidateMemoryCache(true, bufferAddress + 0xffc, 4);
            Array.Reverse(buffer12);
            return(BitConverter.ToUInt32(buffer12, 0));
        }
Ejemplo n.º 44
0
 public void setStat(string statName, int value)
 {
     XDRPCExecutionOptions options = new XDRPCExecutionOptions(XDRPCMode.Title, this.Addresses.SetIntPlayerStat);
     XDRPCArgumentInfo<int> info = new XDRPCArgumentInfo<int>(0);
     XDRPCStringArgumentInfo info2 = new XDRPCStringArgumentInfo(statName);
     XDRPCArgumentInfo<int> info3 = new XDRPCArgumentInfo<int>(value);
     ((XDevkit.IXboxConsole) this.xbc).ExecuteRPC<int>(options, new XDRPCArgumentInfo[] { info, info2, info3 });
 }
Ejemplo n.º 45
0
 public bool Dvar_GetBool(uint dvarAddress)
 {
     XDRPCExecutionOptions options = new XDRPCExecutionOptions(XDRPCMode.Title, this.Addresses.Dvar_GetBool);
     XDRPCArgumentInfo<uint> info = new XDRPCArgumentInfo<uint>(dvarAddress);
     return ((XDevkit.IXboxConsole) xbc).ExecuteRPC<bool>(options, new XDRPCArgumentInfo[] { info });
 }
Ejemplo n.º 46
0
 public static void XamFree(XboxConsole Console, uint Address)
 {
     var pv = new XDRPCArgumentInfo<uint>(Address);
     Console.ExecuteRPC<uint>(XDRPCMode.Title, "xam.xex", 492, pv);
 }
Ejemplo n.º 47
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;
 }
Ejemplo n.º 48
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);
 }
Ejemplo n.º 49
0
        public static void XamFree(XboxConsole Console, uint Address)
        {
            var pv = new XDRPCArgumentInfo <uint>(Address);

            Console.ExecuteRPC <uint>(XDRPCMode.Title, "xam.xex", 492, pv);
        }
Ejemplo n.º 50
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;
 }
Ejemplo n.º 51
0
 public static void GetPartyState(XDevkit.IXboxConsole xbc, out PartyState state, out PartyErrorCodes errorCode)
 {
     XDRPCExecutionOptions options = new XDRPCExecutionOptions(XDRPCMode.Title, "xam.xex", 0xb0f);
     XDRPCArgumentInfo<uint> info = new XDRPCArgumentInfo<uint>(0, ArgumentType.Out);
     XDRPCArgumentInfo<uint> info2 = new XDRPCArgumentInfo<uint>(0, ArgumentType.Out);
     ((XDevkit.IXboxConsole)xbc).ExecuteRPC<uint>(options, new XDRPCArgumentInfo[] { info, info2 });
     state = (PartyState)info.Value;
     errorCode = (PartyErrorCodes)info2.Value;
 }
Ejemplo n.º 52
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);
 }
Ejemplo n.º 53
0
 public static uint GetXuidFromIndex(XDevkit.IXboxConsole xbc, UserIndex userIndex, out ulong offlineXuid)
 {
     uint num2;
     //try
     //{
         XDRPCExecutionOptions options = new XDRPCExecutionOptions(XDRPCMode.Title, "xam.xex", 0x20a);
         XDRPCArgumentInfo<uint> info = new XDRPCArgumentInfo<uint>((uint)userIndex);
         XDRPCArgumentInfo<uint> info2 = new XDRPCArgumentInfo<uint>(2);
         XDRPCArgumentInfo<ulong> info3 = new XDRPCArgumentInfo<ulong>(0L, ArgumentType.Out);
         uint num = ((XDevkit.IXboxConsole)xbc).ExecuteRPC<uint>(options, new XDRPCArgumentInfo[] { info, info2, info3 });
         offlineXuid = info3.Value;
         num2 = num;
     //}
     //catch (XDRPCException exception)
     //{
     //}
     return num2;
 }
Ejemplo n.º 54
0
 public static FIND_USER_INFO_RESPONSE XUserFindUser(XDevkit.IXboxConsole xbc, ulong YourXUID, string GamertagOrXUID)
 {
     var qwUserId = new XDRPCArgumentInfo<ulong>(YourXUID);
     XDRPCArgumentInfo qwFindId = null;
     XDRPCArgumentInfo szSenderName = null;
     //if (GamertagOrXUID is ulong)
     //{
     //    if (!XUID.IsOnlineXUID((ulong)GamertagOrXUID) && !XUID.IsTeamXUID((ulong)GamertagOrXUID)) throw new Exception("XDKUtilities.XUserFindUser: Invalid gamer online/team XUID specified.");
     //    qwFindId = new XDRPCArgumentInfo<ulong>((ulong)GamertagOrXUID);
     //}
     //else if (GamertagOrXUID is string)
     {
         if (GamertagOrXUID.Length > 15) throw new Exception("XDKUtilities.XUserFindUser: Invalid Gamertag specified. It must be less than or equal to 15 characters in length.");
         szSenderName = new XDRPCStringArgumentInfo(GamertagOrXUID, Encoding.ASCII, ArgumentType.ByRef, 16);
     }
     if (qwFindId == null && szSenderName == null) throw new Exception("XDKUtilities.XUserFindUser: Invalid gamertag/XUID specified.");
     if (qwFindId == null) qwFindId = new XDRPCArgumentInfo<ulong>(0);
     if (szSenderName == null) szSenderName = new XDRPCStringArgumentInfo(string.Empty, Encoding.ASCII, ArgumentType.ByRef, 16);
     var cbResults = new XDRPCArgumentInfo<int>(0x18);
     var pResults = new XDRPCStructArgumentInfo<FIND_USER_INFO_RESPONSE>(new FIND_USER_INFO_RESPONSE(), ArgumentType.Out);
     var pXOverlapped = new XDRPCArgumentInfo<uint>(0);
     var returnVal = ((XDevkit.IXboxConsole)xbc).ExecuteRPC<uint>(XDRPCMode.Title, Tools.Addresses.g_XUserFindUserAddressDEV, qwUserId, qwFindId, szSenderName, cbResults, pResults, pXOverlapped);
     if (returnVal != 0x00000000) throw new COMException("Exception from HRESULT: " + string.Format("0x{0:X}", returnVal), (int)returnVal);
     return pResults.Value;
 }
Ejemplo n.º 55
0
 public static void KickUserFromParty(XDevkit.IXboxConsole xbc, Xuid xuidToKick)
 {
     try
     {
         XDRPCStructArgumentInfo<XPARTY_USER_LIST> partyUserList = GetPartyUserList(xbc);
         XDRPCExecutionOptions options = new XDRPCExecutionOptions(XDRPCMode.Title, "xam.xex", 0xb02);
         XDRPCArgumentInfo<ulong> info2 = new XDRPCArgumentInfo<ulong>((ulong)xuidToKick);
         uint errorCode = ((XDevkit.IXboxConsole)xbc).ExecuteRPC<uint>(options, new XDRPCArgumentInfo[] { info2 });
         if (errorCode != 0)
         {
             CreateExceptionFromErrorCode(errorCode);
         }
         WaitForPartyState(xbc, PartyState.XPARTY_STATE_INPARTY, TimeSpan.FromSeconds(15.0));
     }
     catch (XDRPCException exception)
     {
         //throw new ProfilesException(exception);
     }
 }
Ejemplo n.º 56
0
 public decimal getStat(string statName)
 {
     XDRPCExecutionOptions options = new XDRPCExecutionOptions(XDRPCMode.Title, this.Addresses.GetIntPlayerStat);
     XDRPCArgumentInfo<int> info = new XDRPCArgumentInfo<int>(0);
     XDRPCStringArgumentInfo info2 = new XDRPCStringArgumentInfo(statName);
     return ((XDevkit.IXboxConsole) this.xbc).ExecuteRPC<int>(options, new XDRPCArgumentInfo[] { info, info2 });
 }
Ejemplo n.º 57
0
 //static public string[] ListFGamerTags = new string[32];
 //static public string[] ListFSXuid = new string[8];
 //static public ulong[] ListFLXuid = new ulong[8];
 //static public IEnumerable<Friend> EnumerateFriends(XDevkit.IXboxConsole xbc, UserIndex userIndex)
 //static public void GetMyFriends(XDevkit.IXboxConsole xbc, UserIndex userIndex)
 //{
 //    uint friendIndex = 0;
 //    while (true)
 //    {
 //        XONLINE_FRIEND iteratorVariable0;
 //        if (GetNextFriend(xbc, userIndex, friendIndex, out iteratorVariable0) != 0)
 //        {
 //            yield break;
 //        }
 //        FriendRequestStatus requestAccepted = FriendRequestStatus.RequestAccepted;
 //        if ((iteratorVariable0.dwFriendState & 0x40000000) > 0)
 //        {
 //            requestAccepted = FriendRequestStatus.RequestSent;
 //        }
 //        else if ((iteratorVariable0.dwFriendState & 0x80000000) > 0)
 //        {
 //            requestAccepted = FriendRequestStatus.RequestReceived;
 //        }
 //        FriendStatus offline = FriendStatus.Offline;
 //        if ((iteratorVariable0.dwFriendState & 1) > 0)
 //        {
 //            offline = ((FriendStatus)iteratorVariable0.dwFriendState) & ((FriendStatus)0xf0000);
 //        }
 //        //Friend iteratorVariable4 = new Friend(iteratorVariable0.szGamertag, iteratorVariable0.xuid, requestAccepted, offline, iteratorVariable0.wszRichPresence, iteratorVariable0.dwTitleID);
 //        //yield return iteratorVariable4;
 //        friendIndex++;
 //    }
 //}
 private static uint GetNextFriend(XDevkit.IXboxConsole xbc, UserIndex userIndex, uint friendIndex, out XONLINE_FRIEND friend)
 {
     uint num2;
     //try
     //{
         friend = new XONLINE_FRIEND();
         XDRPCExecutionOptions options = new XDRPCExecutionOptions(XDRPCMode.Title, "xam.xex", 0x4ea);
         XDRPCArgumentInfo<uint> info = new XDRPCArgumentInfo<uint>((uint)userIndex);
         XDRPCArgumentInfo<uint> info2 = new XDRPCArgumentInfo<uint>(friendIndex);
         XDRPCArgumentInfo<uint> info3 = new XDRPCArgumentInfo<uint>(1);
         XDRPCArgumentInfo<uint> info4 = new XDRPCArgumentInfo<uint>(0, ArgumentType.Out);
         XDRPCArgumentInfo<uint> info5 = new XDRPCArgumentInfo<uint>(0, ArgumentType.Out);
         uint num = ((XDevkit.IXboxConsole)xbc).ExecuteRPC<uint>(options, new XDRPCArgumentInfo[] { info, info2, info3, info4, info5 });
         if (num == 0)
         {
             options = new XDRPCExecutionOptions(XDRPCMode.Title, "xam.xex", 0x250);
             info5 = new XDRPCArgumentInfo<uint>(info5.Value);
             XDRPCArgumentInfo<uint> info6 = new XDRPCArgumentInfo<uint>(0);
             XDRPCStructArgumentInfo<XONLINE_FRIEND> info7 = new XDRPCStructArgumentInfo<XONLINE_FRIEND>(new XONLINE_FRIEND(), ArgumentType.Out);
             info4 = new XDRPCArgumentInfo<uint>(info4.Value);
             XDRPCArgumentInfo<uint> info8 = new XDRPCArgumentInfo<uint>(0, ArgumentType.Out);
             XDRPCNullArgumentInfo info9 = new XDRPCNullArgumentInfo();
             num = ((XDevkit.IXboxConsole)xbc).ExecuteRPC<uint>(options, new XDRPCArgumentInfo[] { info5, info6, info7, info4, info8, info9 });
             friend = info7.Value;
             options = new XDRPCExecutionOptions(XDRPCMode.Title, "xam.xex", 0x414);
             ((XDevkit.IXboxConsole)xbc).ExecuteRPC<bool>(options, new XDRPCArgumentInfo[] { info5 });
         }
         num2 = num;
     //}
     //catch (XDRPCException exception)
     //{
     //    //throw new ProfilesException(exception);
     //}
     return num2;
 }
Ejemplo n.º 58
0
 public uint HudElem_Alloc(uint clientNum)
 {
     XDRPCExecutionOptions options = new XDRPCExecutionOptions(XDRPCMode.Title, this.Addresses.HudElem_Alloc);
     XDRPCArgumentInfo<uint> info = new XDRPCArgumentInfo<uint>(0);
     XDRPCArgumentInfo<uint> info2 = new XDRPCArgumentInfo<uint>(0);
     uint num = ((XDevkit.IXboxConsole) xbc).ExecuteRPC<uint>(options, new XDRPCArgumentInfo[] { info, info2 });
     ((XDevkit.IXboxConsole) xbc).WriteUInt32(num + 0x7c, clientNum);
     return num;
 }