コード例 #1
0
        public static uint FindMemloc2(string strPrefix, string strSuffix)
        {
            uint Address = 0;

            try
            {
                Match     match1       = null;
                Regex     regex1       = new Regex((strPrefix + "-([0-9|A-F][0-9|A-F])-([0-9|A-F][0-9|A-F])-([0-9|A-F][0-9|A-F])-([0-9|A-F][0-9|A-F])-" + strSuffix));
                const int StartAddress = 229376;

                long num2 = MemoryHandler.GetModuleEndAddress(MemoryHandler.Instance.Process);
                MemoryHandler.Instance.Address = MemoryHandler.Instance.BaseAddress;

                do
                {
                    string Pattern = MemoryHandler.Instance.GetOpcode(StartAddress);
                    match1 = regex1.Match(Pattern);
                    if (match1.Success)
                    {
                        break; // TODO: might not be correct. Was : Exit Do
                    }
                    MemoryHandler.Instance.Address = (MemoryHandler.Instance.Address + StartAddress);
                } while ((!match1.Success & (MemoryHandler.Instance.Address < num2)));

                Address = (uint)((match1.Index / 3) + MemoryHandler.Instance.Address);
            }
            catch (Exception ex)
            {
                Address = 0;
            }
            return(Address);
        }
コード例 #2
0
        public static int FindMemloc(string strPrefix, string strSuffix)
        {
            Match     m         = null;
            int       Address   = 0;
            Regex     regex1    = new Regex((strPrefix + "-([0-9|A-F][0-9|A-F])-([0-9|A-F][0-9|A-F])-([0-9|A-F][0-9|A-F])-([0-9|A-F][0-9|A-F])-" + strSuffix));
            const int blockSize = 229376;


            long endAddress = MemoryHandler.GetModuleEndAddress(MemoryHandler.Instance.Process);

            MemoryHandler.Instance.Address = MemoryHandler.Instance.BaseAddress;

            do
            {
                string text1 = MemoryHandler.Instance.GetOpcode(blockSize);
                m = regex1.Match(text1);
                MemoryHandler.Instance.Address = (MemoryHandler.Instance.Address + blockSize);
            } while ((!m.Success & (MemoryHandler.Instance.Address < endAddress)));
            try
            {
                Address = Int32.Parse((m.Groups[4].ToString() + m.Groups[3].ToString() + m.Groups[2].ToString() + m.Groups[1].ToString()), NumberStyles.HexNumber);
            }
            catch (Exception ex)
            {
                Address = 0;
            }
            return(Address);
        }
コード例 #3
0
        public static uint FindByteString(string search)
        {
            uint Address = 0;

            try
            {
                Match     match1     = null;
                Regex     regex1     = new Regex(search);
                const int SearchSize = 229376;

                long num2 = MemoryHandler.GetModuleEndAddress(MemoryHandler.Instance.Process);
                System.Diagnostics.Debug.Print(MemoryHandler.Instance.BaseAddress.ToString("X") + "+" + num2.ToString("X"));
                MemoryHandler.Instance.Address = MemoryHandler.Instance.BaseAddress;

                do
                {
                    string Pattern = MemoryHandler.Instance.GetOpcode(SearchSize);

                    match1 = regex1.Match(Pattern);
                    if (match1.Success)
                    {
                        break;
                    }

                    MemoryHandler.Instance.Address = (MemoryHandler.Instance.Address + SearchSize);
                } while ((!match1.Success & (MemoryHandler.Instance.Address < num2)));

                Address = (uint)((match1.Index / 3) + MemoryHandler.Instance.Address);
            }
            catch (Exception ex)
            {
                Address = 0;
            }
            return(Address);
        }