示例#1
0
 public uint ResolveFunction(string titleID, uint ord)
 {
     if (XRPC.firstRan == 0)
     {
         byte[] Data = new byte[4];
         this.xbCon.DebugTarget.GetMemory(2445314222U, 4U, Data, out XRPC.meh);
         this.xbCon.DebugTarget.InvalidateMemoryCache(true, 2445314222U, 4U);
         Array.Reverse((Array)Data);
         this.bufferAddress = BitConverter.ToUInt32(Data, 0);
         XRPC.firstRan      = 1;
         this.stringPointer = this.bufferAddress + 1500U;
         this.floatPointer  = this.bufferAddress + 2700U;
         this.bytePointer   = this.bufferAddress + 3200U;
         this.xbCon.DebugTarget.SetMemory(this.bufferAddress, 100U, this.nulled, out XRPC.meh);
         this.xbCon.DebugTarget.SetMemory(this.stringPointer, 100U, this.nulled, out XRPC.meh);
     }
     byte[] bytes1 = Encoding.ASCII.GetBytes(titleID);
     this.xbCon.DebugTarget.SetMemory(this.stringPointer, (uint)bytes1.Length, bytes1, out XRPC.meh);
     long[] numArray = new long[2]
     {
         (long)this.stringPointer,
         0L
     };
     this.stringPointer += (uint)(Convert.ToString(titleID).Length + 1);
     numArray[1]         = (long)ord;
     byte[] data = XRPC.getData(numArray);
     this.xbCon.DebugTarget.SetMemory(this.bufferAddress + 8U, (uint)data.Length, data, out XRPC.meh);
     byte[] bytes2 = BitConverter.GetBytes(2181038081U);
     Array.Reverse((Array)bytes2);
     this.xbCon.DebugTarget.SetMemory(this.bufferAddress, 4U, bytes2, out XRPC.meh);
     Thread.Sleep(50);
     byte[] Data1 = new byte[4];
     this.xbCon.DebugTarget.GetMemory(this.bufferAddress + 4092U, 4U, Data1, out XRPC.meh);
     this.xbCon.DebugTarget.InvalidateMemoryCache(true, this.bufferAddress + 4092U, 4U);
     Array.Reverse((Array)Data1);
     return(BitConverter.ToUInt32(Data1, 0));
 }
示例#2
0
        public uint CallSysFunction(uint address, params object[] arg)
        {
            long[] numArray1 = new long[9];
            if (!this.activeConnection)
            {
                this.Connect();
            }
            if (XRPC.firstRan == 0)
            {
                byte[] Data = new byte[4];
                this.xbCon.DebugTarget.GetMemory(2445314222U, 4U, Data, out XRPC.meh);
                this.xbCon.DebugTarget.InvalidateMemoryCache(true, 2445314222U, 4U);
                Array.Reverse((Array)Data);
                this.bufferAddress = BitConverter.ToUInt32(Data, 0);
                XRPC.firstRan      = 1;
                this.stringPointer = this.bufferAddress + 1500U;
                this.floatPointer  = this.bufferAddress + 2700U;
                this.bytePointer   = this.bufferAddress + 3200U;
                this.xbCon.DebugTarget.SetMemory(this.bufferAddress, 100U, this.nulled, out XRPC.meh);
                this.xbCon.DebugTarget.SetMemory(this.stringPointer, 100U, this.nulled, out XRPC.meh);
            }
            if (this.bufferAddress == 0U)
            {
                byte[] Data = new byte[4];
                this.xbCon.DebugTarget.GetMemory(2445314222U, 4U, Data, out XRPC.meh);
                this.xbCon.DebugTarget.InvalidateMemoryCache(true, 2445314222U, 4U);
                Array.Reverse((Array)Data);
                this.bufferAddress = BitConverter.ToUInt32(Data, 0);
            }
            this.stringPointer = this.bufferAddress + 1500U;
            this.floatPointer  = this.bufferAddress + 2700U;
            this.bytePointer   = this.bufferAddress + 3200U;
            int num    = 0;
            int index1 = 0;

            numArray1[index1] = (long)address;
            int index2 = index1 + 1;

            foreach (object obj in arg)
            {
                if (obj is byte)
                {
                    byte[] numArray2 = (byte[])obj;
                    numArray1[index2] = (long)BitConverter.ToUInt32(numArray2, 0);
                }
                else if (obj is byte[])
                {
                    byte[] Data = (byte[])obj;
                    this.xbCon.DebugTarget.SetMemory(this.bytePointer, (uint)Data.Length, Data, out XRPC.meh);
                    numArray1[index2] = (long)this.bytePointer;
                    this.bytePointer += (uint)(Data.Length + 2);
                }
                else if (obj is float)
                {
                    byte[] bytes = BitConverter.GetBytes(float.Parse(Convert.ToString(obj)));
                    this.xbCon.DebugTarget.SetMemory(this.floatPointer, (uint)bytes.Length, bytes, out XRPC.meh);
                    numArray1[index2]  = (long)this.floatPointer;
                    this.floatPointer += (uint)(bytes.Length + 2);
                }
                else if (obj is float[])
                {
                    byte[] Data = new byte[12];
                    for (int index3 = 0; index3 <= 2; ++index3)
                    {
                        byte[] numArray2 = new byte[4];
                        Buffer.BlockCopy((Array)obj, index3 * 4, (Array)numArray2, 0, 4);
                        Array.Reverse((Array)numArray2);
                        Buffer.BlockCopy((Array)numArray2, 0, (Array)Data, 4 * index3, 4);
                    }
                    this.xbCon.DebugTarget.SetMemory(this.floatPointer, (uint)Data.Length, Data, out XRPC.meh);
                    numArray1[index2]  = (long)this.floatPointer;
                    this.floatPointer += 2U;
                }
                else if (obj is string)
                {
                    byte[] bytes = Encoding.ASCII.GetBytes(Convert.ToString(obj));
                    this.xbCon.DebugTarget.SetMemory(this.stringPointer, (uint)bytes.Length, bytes, out XRPC.meh);
                    numArray1[index2]   = (long)this.stringPointer;
                    this.stringPointer += (uint)(Convert.ToString(obj).Length + 1);
                }
                else
                {
                    numArray1[index2] = Convert.ToInt64(obj);
                }
                ++num;
                ++index2;
            }
            byte[] data = XRPC.getData(numArray1);
            this.xbCon.DebugTarget.SetMemory(this.bufferAddress + 8U, (uint)data.Length, data, out XRPC.meh);
            byte[] bytes1 = BitConverter.GetBytes(num);
            Array.Reverse((Array)bytes1);
            this.xbCon.DebugTarget.SetMemory(this.bufferAddress + 4U, 4U, bytes1, out XRPC.meh);
            Thread.Sleep(0);
            byte[] bytes2 = BitConverter.GetBytes(2181038080U);
            Array.Reverse((Array)bytes2);
            this.xbCon.DebugTarget.SetMemory(this.bufferAddress, 4U, bytes2, out XRPC.meh);
            Thread.Sleep(50);
            byte[] Data1 = new byte[4];
            this.xbCon.DebugTarget.GetMemory(this.bufferAddress + 4092U, 4U, Data1, out XRPC.meh);
            this.xbCon.DebugTarget.InvalidateMemoryCache(true, this.bufferAddress + 4092U, 4U);
            Array.Reverse((Array)Data1);
            return(BitConverter.ToUInt32(Data1, 0));
        }