示例#1
0
        public uint ResolveFunction(string titleID, uint ord)
        {
            if (XboxAPI.firstRan == 0)
            {
                byte[] array = new byte[4];
                xbCon.DebugTarget.GetMemory(2445314222u, 4u, array, out XboxAPI.meh);
                xbCon.DebugTarget.InvalidateMemoryCache(true, 2445314222u, 4u);
                Array.Reverse(array);
                bufferAddress    = BitConverter.ToUInt32(array, 0);
                XboxAPI.firstRan = 1;
                stringPointer    = bufferAddress + 1500u;
                floatPointer     = bufferAddress + 2700u;
                bytePointer      = bufferAddress + 3200u;
                xbCon.DebugTarget.SetMemory(bufferAddress, 100u, nulled, out XboxAPI.meh);
                xbCon.DebugTarget.SetMemory(stringPointer, 100u, nulled, out XboxAPI.meh);
            }
            byte[] bytes = Encoding.ASCII.GetBytes(titleID);
            xbCon.DebugTarget.SetMemory(stringPointer, (uint)bytes.Length, bytes, out XboxAPI.meh);
            long[] array2 = new long[2];
            array2[0] = (long)((ulong)stringPointer);
            string text = Convert.ToString(titleID);

            stringPointer += (uint)(text.Length + 1);
            array2[1]      = (long)((ulong)ord);
            byte[] data = XboxAPI.getData(array2);
            xbCon.DebugTarget.SetMemory(bufferAddress + 8u, (uint)data.Length, data, out XboxAPI.meh);
            byte[] bytes2 = BitConverter.GetBytes(2181038081u);
            Array.Reverse(bytes2);
            xbCon.DebugTarget.SetMemory(bufferAddress, 4u, bytes2, out XboxAPI.meh);
            Thread.Sleep(50);
            byte[] array3 = new byte[4];
            xbCon.DebugTarget.GetMemory(bufferAddress + 4092u, 4u, array3, out XboxAPI.meh);
            xbCon.DebugTarget.InvalidateMemoryCache(true, bufferAddress + 4092u, 4u);
            Array.Reverse(array3);
            return(BitConverter.ToUInt32(array3, 0));
        }
示例#2
0
        public uint CallSysFunction(uint address, params object[] arg)
        {
            long[] array = new long[9];
            if (!activeConnection)
            {
                Connection();
            }
            if (XboxAPI.firstRan == 0)
            {
                byte[] array2 = new byte[4];
                xbCon.DebugTarget.GetMemory(2445314222u, 4u, array2, out XboxAPI.meh);
                xbCon.DebugTarget.InvalidateMemoryCache(true, 2445314222u, 4u);
                Array.Reverse(array2);
                bufferAddress    = BitConverter.ToUInt32(array2, 0);
                XboxAPI.firstRan = 1;
                stringPointer    = bufferAddress + 1500u;
                floatPointer     = bufferAddress + 2700u;
                bytePointer      = bufferAddress + 3200u;
                xbCon.DebugTarget.SetMemory(bufferAddress, 100u, nulled, out XboxAPI.meh);
                xbCon.DebugTarget.SetMemory(stringPointer, 100u, nulled, out XboxAPI.meh);
            }
            if (bufferAddress == 0u)
            {
                byte[] array3 = new byte[4];
                xbCon.DebugTarget.GetMemory(2445314222u, 4u, array3, out XboxAPI.meh);
                xbCon.DebugTarget.InvalidateMemoryCache(true, 2445314222u, 4u);
                Array.Reverse(array3);
                bufferAddress = BitConverter.ToUInt32(array3, 0);
            }
            stringPointer = bufferAddress + 1500u;
            floatPointer  = bufferAddress + 2700u;
            bytePointer   = bufferAddress + 3200u;
            int num  = 0;
            int num2 = 0;

            array[num2] = (long)((ulong)address);
            num2++;
            for (int i = 0; i < arg.Length; i++)
            {
                object obj = arg[i];
                if (obj is byte)
                {
                    byte[] value = (byte[])obj;
                    array[num2] = (long)((ulong)BitConverter.ToUInt32(value, 0));
                }
                else if (obj is byte[])
                {
                    byte[] array4 = (byte[])obj;
                    xbCon.DebugTarget.SetMemory(bytePointer, (uint)array4.Length, array4, out XboxAPI.meh);
                    array[num2]  = (long)((ulong)bytePointer);
                    bytePointer += (uint)(array4.Length + 2);
                }
                else if (obj is float)
                {
                    float  value2 = float.Parse(Convert.ToString(obj));
                    byte[] bytes  = BitConverter.GetBytes(value2);
                    xbCon.DebugTarget.SetMemory(floatPointer, (uint)bytes.Length, bytes, out XboxAPI.meh);
                    array[num2]   = (long)((ulong)floatPointer);
                    floatPointer += (uint)(bytes.Length + 2);
                }
                else if (obj is float[])
                {
                    byte[] array5 = new byte[12];
                    for (int j = 0; j <= 2; j++)
                    {
                        byte[] array6 = new byte[4];
                        Buffer.BlockCopy((Array)obj, j * 4, array6, 0, 4);
                        Array.Reverse(array6);
                        Buffer.BlockCopy(array6, 0, array5, 4 * j, 4);
                    }
                    xbCon.DebugTarget.SetMemory(floatPointer, (uint)array5.Length, array5, out XboxAPI.meh);
                    array[num2]   = (long)((ulong)floatPointer);
                    floatPointer += 2u;
                }
                else if (obj is string)
                {
                    byte[] bytes2 = Encoding.ASCII.GetBytes(Convert.ToString(obj));
                    xbCon.DebugTarget.SetMemory(stringPointer, (uint)bytes2.Length, bytes2, out XboxAPI.meh);
                    array[num2] = (long)((ulong)stringPointer);
                    string text = Convert.ToString(obj);
                    stringPointer += (uint)(text.Length + 1);
                }
                else
                {
                    array[num2] = Convert.ToInt64(obj);
                }
                num++;
                num2++;
            }
            byte[] data = XboxAPI.getData(array);
            xbCon.DebugTarget.SetMemory(bufferAddress + 8u, (uint)data.Length, data, out XboxAPI.meh);
            byte[] bytes3 = BitConverter.GetBytes(num);
            Array.Reverse(bytes3);
            xbCon.DebugTarget.SetMemory(bufferAddress + 4u, 4u, bytes3, out XboxAPI.meh);
            Thread.Sleep(0);
            byte[] bytes4 = BitConverter.GetBytes(2181038080u);
            Array.Reverse(bytes4);
            xbCon.DebugTarget.SetMemory(bufferAddress, 4u, bytes4, out XboxAPI.meh);
            Thread.Sleep(50);
            byte[] array7 = new byte[4];
            xbCon.DebugTarget.GetMemory(bufferAddress + 4092u, 4u, array7, out XboxAPI.meh);
            xbCon.DebugTarget.InvalidateMemoryCache(true, bufferAddress + 4092u, 4u);
            Array.Reverse(array7);
            return(BitConverter.ToUInt32(array7, 0));
        }