Beispiel #1
0
        public static void UnloadModule(this IXboxConsole xbCon, string module)
        {
            uint handle = xbCon.ExecuteRPC <uint>(XDRPCMode.System, "xam.xex", 1102, new object[] { module });

            if (handle != 0u)
            {
                xbCon.WriteInt16(handle + 0x40, 1);
                xbCon.ExecuteRPC <uint>(XDRPCMode.System, "xboxkrnl.exe", 417, new object[] { handle });
            }
        }
Beispiel #2
0
        public static string GetCPUKey(this IXboxConsole xbCon)
        {
            byte[] RPC = new byte[] { 0x38, 0x00, 0x00, 0x71, 0x44, 0x00, 0x00, 0x02, 0x4E, 0x80, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00 };

            xbCon.DebugTarget.SetMemory(0x81B44688, 16, RPC, out outInt);
            UInt64 CPU1 = xbCon.ExecuteRPC <UInt64>(new XDRPCExecutionOptions(XDRPCMode.Title, 0x81B44688), new object[] { 0x48565050, 3, 0x8000020000020600 });
            UInt64 CPU2 = xbCon.ExecuteRPC <UInt64>(new XDRPCExecutionOptions(XDRPCMode.Title, 0x81B44688), new object[] { 0x48565050, 3, 0x8000020000020800 });
            UInt64 CPU3 = xbCon.ExecuteRPC <UInt64>(new XDRPCExecutionOptions(XDRPCMode.Title, 0x81B44688), new object[] { 0x48565050, 3, 0x8000020000020A00 });
            UInt64 CPU4 = xbCon.ExecuteRPC <UInt64>(new XDRPCExecutionOptions(XDRPCMode.Title, 0x81B44688), new object[] { 0x48565050, 3, 0x8000020000020C00 });

            xbCon.DebugTarget.SetMemory(0x81B44688, 16, new byte[16], out outInt);

            return(String.Format("{0}{1}", (CPU1 | CPU2).ToString("X8"), (CPU3 | CPU4).ToString("X8")));
        }
Beispiel #3
0
        public static void LoadModule(this IXboxConsole xbCon, string module)
        {
            if (module.Contains("\\") == false)
            {
                module = "Hdd:\\" + module;
            }

            xbCon.ExecuteRPC <uint>(XDRPCMode.System, "xboxkrnl.exe", 409, new object[] { module, 8, 0, 0 });
        }
Beispiel #4
0
        public static bool SupportsRPC(this IXboxConsole console)
        {
            bool flag = true;

            try
            {
                console.ExecuteRPC <int>(XDRPCMode.System, "xbdm.xex", 117, (object)0);
            }
            catch (XDRPCException ex)
            {
                flag = false;
            }
            return(flag);
        }
        public static XDRPCReference AllocateRPC(
            this IXboxConsole console,
            int size,
            XDRPCMode mode)
        {
            if (size == 0)
            {
                throw new XDRPCInvalidOperationException("Allocating size of 0 is not allowed.");
            }
            uint pointer = console.ExecuteRPC <uint>(mode, "xbdm.xex", 1, (object)size);

            if (pointer == 0U)
            {
                throw new XDRPCException("Failed allocation: null pointer was returned.");
            }
            return(new XDRPCReference(console, pointer, size)
            {
                XDRPCManaged = true
            });
        }
Beispiel #6
0
        private void CallByOrdinalButton_Click(object sender, EventArgs e)
        {
            if (ModuleNameTextBox.Text.Equals(string.Empty) || OrdinalTextBox.Text.Equals(string.Empty))
            {
                MessageBox.Show("Error", "Please enter a module name and ordinal value!");
                return;
            }

            string moduleName    = ModuleNameTextBox.Text;
            int    ordinalNumber = OrdinalTextBox.Text.Contains("0x") ? Convert.ToInt32(OrdinalTextBox.Text, 16) : Convert.ToInt32(OrdinalTextBox.Text, 10);

            if (CallByOrdinalReturnTypeComboBox.Text.Equals(string.Empty))
            {
                MessageBox.Show("Error", "Please select a return type before calling the function!");
                return;
            }

            try {
                if (CallByOrdinalReturnTypeComboBox.SelectedIndex == 0)
                {
                    xbCon.ExecuteRPC <Int64>(XDRPCMode.System, moduleName, ordinalNumber, GetParameters());
                    ByOridinalReturnValueTextBox.Text = "No Return";
                }
                else if (CallByOrdinalReturnTypeComboBox.SelectedIndex == 1)
                {
                    Int64 returnVal = xbCon.ExecuteRPC <Int64>(XDRPCMode.System, moduleName, ordinalNumber, GetParameters());
                    ByOridinalReturnValueTextBox.Text = "0x" + returnVal.ToString("X");
                }
                else if (CallByOrdinalReturnTypeComboBox.SelectedIndex == 2)
                {
                    string returnVal = xbCon.CallString(moduleName, ordinalNumber, GetParameters());
                    ByOridinalReturnValueTextBox.Text = returnVal;
                }
                else if (CallByOrdinalReturnTypeComboBox.SelectedIndex == 3)
                {
                    float returnVal = xbCon.ExecuteRPC <float>(XDRPCMode.System, moduleName, ordinalNumber, GetParameters());
                    ByOridinalReturnValueTextBox.Text = returnVal.ToString();
                }
            }
            catch {
                MessageBox.Show("Error", "Make sure you have set values and types for all parameters being used!");
            }
        }
Beispiel #7
0
 public static uint GetCurrentTitleId(this IXboxConsole xbCon)
 {
     return(xbCon.ExecuteRPC <uint>(XDRPCMode.System, "xam.xex", 463, new object[] { }));
 }
Beispiel #8
0
 public static void Shutdown(this IXboxConsole xbCon)
 {
     xbCon.ExecuteRPC <uint>(XDRPCMode.System, "xboxkrnl.exe", 40, new object[] { 0x7 });
 }