예제 #1
0
        public static ulong GetMTOfType(ClrType Type)
        {
            if (Type == null)
            {
                return(0UL);
            }
            object temp = AdHoc.GetMember(Type, "m_handle");

            if (temp as ulong? == null)
            {
                temp = AdHoc.GetMember(Type.Heap.GetRuntime(), "ObjectMethodTable");
                if (temp as ulong? == null)
                {
                    return(0);
                }
                ;
            }
            return((ulong)temp);
        }
예제 #2
0
        public static ulong[] GetDomainsAddr(ClrRuntime runtime, ulong Address)
        {
            List <ulong> domains = new List <ulong>();

            if (Address == 0)
            {
                return(domains.ToArray());
            }

            foreach (var domain in AdHoc.GetDomains(runtime))
            {
                foreach (var module in domain.Modules)
                {
                    if (module.ImageBase == Address)
                    {
                        domains.Add(module.AssemblyId);
                    }
                }
            }

            return(domains.ToArray());
        }