Exemple #1
0
        public Resolver(ProcessCommunication hProcess, Assembly hAssembly, string zFile, string zCRC32)
            : base((XElement)null)
        {
            XElement xelement1 = (XElement)null;
            Dictionary <string, uint> dictionary = new Dictionary <string, uint>();

            using (Stream manifestResourceStream = hAssembly.GetManifestResourceStream(zFile))
            {
                if (manifestResourceStream == null)
                {
                    return;
                }
                xelement1 = XElement.Load(manifestResourceStream);
            }
            foreach (XElement xelement2 in xelement1.Elements())
            {
                XAttribute xattribute = xelement2.Attribute((XName)"Hash");
                if (xattribute != null && zCRC32 == xattribute.Value)
                {
                    using (Stream manifestResourceStream = hAssembly.GetManifestResourceStream(xelement2.Value))
                    {
                        if (manifestResourceStream == null)
                        {
                            break;
                        }
                        this._hElement  = XElement.Load(manifestResourceStream);
                        this._hAssembly = hAssembly;
                        this._hProcess  = hProcess;
                        break;
                    }
                }
            }
        }
Exemple #2
0
        public static ulong _Base(ProcessCommunication hProcess)
        {
            hProcess.ProcessEnvironment.Refresh();
            Image image = hProcess["Game.dll"];

            if (image != null)
            {
                return(image.Address);
            }
            return(0);
        }
Exemple #3
0
        protected static ArrayList _List(HashSet <uint> hResultList)
        {
            ArrayList arrayList1 = new ArrayList();

            for (int index = 0; index < hResultList.Count; ++index)
            {
                uint iProcessId = Enumerable.ElementAt <uint>((IEnumerable <uint>)hResultList, index);
                ProcessCommunication hProcess             = new ProcessCommunication();
                ProcessCommunication processCommunication = Game.Process;
                if (hProcess.Open(iProcessId))
                {
                    ulong iBase = Game._Base(hProcess);
                    if ((long)iBase != 0L)
                    {
                        Game.Process = hProcess;
                        if (Game.LoadVersion())
                        {
                            Player player = new Player(iBase).Update();
                            Game.Process = processCommunication;
                            ArrayList arrayList2 = new ArrayList()
                            {
                                (object)iProcessId,
                                (object)player.GetID(iBase),
                                (object)player.GetName(0UL),
                                (object)player.GetLevel()
                            };
                            arrayList1.Add((object)arrayList2);
                        }
                        else
                        {
                            continue;
                        }
                    }
                    hProcess.Close();
                }
            }
            return(arrayList1);
        }