Ejemplo n.º 1
0
        private static MetaHeap ReadGC()
        {
            var clr = Resources.Clr.Imports;

            const string GLOBAL_GCHEAP_PTR = "g_pGCHeap";
            const string GLOBAL_GCHEAP_LO  = "g_lowest_address";
            const string GLOBAL_GCHEAP_HI  = "g_highest_address";

            // .data	0000000180517000	000000018052F000	R	W	.	.	L	para	0004	public	DATA	64	0000	0000	0004	FFFFFFFFFFFFFFFF	FFFFFFFFFFFFFFFF

            // 000000018051C120
            var segments = PEFileReader.ReadPESectionInfo(Resources.Clr.Module.BaseAddress);

            var text = segments.Single(s => s.Name.Contains(".data"));

            var h = 0x5120;

            Pointer <byte> gc = text.Address + h;

            //Pointer<byte> lo = clr.GetAddress(GLOBAL_GCHEAP_LO).ReadPointer();
            //Pointer<byte> hi = clr.GetAddress(GLOBAL_GCHEAP_HI).ReadPointer();

            return(new MetaHeap(gc.ReadPointer(), null, null));
        }