Esempio n. 1
0
        /// <summary>
        /// Updates the internal pointer list.
        /// </summary>
        /// <returns></returns>
        public bool UpdateFactory()
        {
            // Reset the pointer table..
            this.m_PointerTable = new Dictionary <String, IntPtr>();

            // Validate current process..
            if (Globals.Instance.CurrentProcess == null || Globals.Instance.CurrentProcess.HasExited)
            {
                return(false);
            }

            // Locate FFXiMain.dll..
            var ffxiMain = (from ProcessModule m in Globals.Instance.CurrentProcess.Modules
                            where m.ModuleName.ToLower() == "ffximain.dll"
                            select m).SingleOrDefault();

            if (ffxiMain == null)
            {
                return(false);
            }

            // Prepare signature scanner..
            var sigScan = new SigScan(
                Globals.Instance.CurrentProcess, ffxiMain.BaseAddress, ffxiMain.ModuleMemorySize
                );

            // Loop each signature and rescan..
            foreach (var p in Globals.Instance.Config.Signatures)
            {
                // Attempt to locate signature..
                var pointer = sigScan.FindPattern(Helpers.HexStringToArray(p.Pattern), p.Mask, p.Offset);
                if (pointer == IntPtr.Zero)
                {
                    Program.CriticalError("Failed to locate critical signature: " + p.Name);
                    return(false);
                }

                // Add pointer to pointer table..
                this.m_PointerTable.Add(p.Name, pointer);
            }

            return(true);
        }
Esempio n. 2
0
        /// <summary>
        /// Updates the internal pointer list.
        /// </summary>
        /// <returns></returns>
        public bool UpdateFactory()
        {
            // Reset the pointer table..
            this.m_PointerTable = new Dictionary<String, IntPtr>();

            // Validate current process..
            if (Globals.Instance.CurrentProcess == null || Globals.Instance.CurrentProcess.HasExited)
                return false;

            // Locate FFXiMain.dll..
            var ffxiMain = (from ProcessModule m in Globals.Instance.CurrentProcess.Modules
                            where m.ModuleName.ToLower() == "ffximain.dll"
                            select m).SingleOrDefault();

            if (ffxiMain == null)
                return false;

            // Prepare signature scanner..
            var sigScan = new SigScan(
                Globals.Instance.CurrentProcess, ffxiMain.BaseAddress, ffxiMain.ModuleMemorySize
                );

            // Loop each signature and rescan..
            foreach (var p in Globals.Instance.Config.Signatures)
            {
                // Attempt to locate signature..
                var pointer = sigScan.FindPattern(Helpers.HexStringToArray(p.Pattern), p.Mask, p.Offset);
                if (pointer == IntPtr.Zero)
                {
                    Program.CriticalError("Failed to locate critical signature: " + p.Name);
                    return false;
                }

                // Add pointer to pointer table..
                this.m_PointerTable.Add(p.Name, pointer);
            }

            return true;
        }