Beispiel #1
0
        public static IntPtr[] ConstructPointer(string str)
        {
            IntPtr[] ptr = null;

            if (str.Contains(","))
            {
                String   formatted = MemReaderUtil.TrimAllWithInplaceCharArray(str);
                String[] add       = formatted.Split(',');
                ptr = new IntPtr[add.Length];
                for (int i = 0; i < add.Length; i++)
                {
                    if (IsHex(add[i]))
                    {
                        ptr[i] = (IntPtr)Convert.ToInt32(add[i], 16);
                    }
                    else
                    {
                        break;
                    }
                }
            }
            else
            {
                if (IsHex(str))
                {
                    ptr = new IntPtr[] { (IntPtr)Convert.ToInt32(str, 16) }
                }
                ;
            }

            return(ptr);
        }
        public void Remove(string address)
        {
            // Remove input whitespaces
            string formatted = MemReaderUtil.TrimAllWithInplaceCharArray(address);

            // Remove address entry
            string match = null;

            foreach (string s in AddressList)
            {
                if (s == formatted)
                {
                    match = s;
                }
            }

            if (match != null)
            {
                AddressList.Remove(match);
            }
        }
        public void Add(string address)
        {
            // Remove input whitespaces
            string formatted = MemReaderUtil.TrimAllWithInplaceCharArray(address);

            // Check for duplicate
            bool exists = false;

            foreach (string s in AddressList)
            {
                if (s == formatted)
                {
                    exists = true;
                }
            }

            // Add if no duplicate
            if (!exists)
            {
                AddressList.Add(formatted);
            }
        }