示例#1
0
        public static MethodDefinition GetMethodDefinition(Pointer address)
        {
            var  table   = Intrinsic.GetMethodLookupTable();
            uint entries = table.Load32();

            table += Pointer.Size;             // skip count

            while (entries > 0)
            {
                var  addr = table.LoadPointer();
                uint size = table.Load32(Pointer.Size);

                if (address >= addr && address < (addr + size))
                {
                    return(new MethodDefinition(table.LoadPointer(Pointer.Size * 2)));
                }

                table += Pointer.Size * 3;

                entries--;
            }

            return(new MethodDefinition(Pointer.Zero));
        }