ReadMemory() public méthode

public ReadMemory ( TargetAddress address, int size ) : TargetBlob
address TargetAddress
size int
Résultat TargetBlob
        void read_dynamic_info(Inferior inferior)
        {
            if (has_dynlink_info) {
                if (!dyld_all_image_infos.IsNull)
                    do_update_shlib_info (inferior);
                return;
            }

            TargetMemoryInfo info = Inferior.GetTargetMemoryInfo (AddressDomain.Global);
			Bfd dyld_image = new Bfd (this, info, "/usr/lib/dyld", TargetAddress.Null, true);

            dyld_all_image_infos = dyld_image.LookupSymbol("dyld_all_image_infos");
            if (dyld_all_image_infos.IsNull)
                return;

            int size = 2 * inferior.TargetLongIntegerSize + 2 * inferior.TargetAddressSize;
            TargetReader reader = new TargetReader (inferior.ReadMemory (dyld_all_image_infos, size));

            reader.ReadLongInteger (); // version
            reader.ReadLongInteger (); // infoArrayCount
            reader.ReadAddress (); // infoArray
            TargetAddress dyld_image_notifier = reader.ReadAddress ();

            has_dynlink_info = true;

            Instruction insn = inferior.Architecture.ReadInstruction (inferior, dyld_image_notifier);
            if ((insn == null) || !insn.CanInterpretInstruction)
                throw new InternalError ("Unknown dynlink breakpoint: {0}", dyld_image_notifier);

            dynlink_breakpoint = new DynlinkBreakpoint (this, insn);
            dynlink_breakpoint.Insert (inferior);

            do_update_shlib_info (inferior);

            check_loaded_library (inferior, main_bfd);
        void read_dynamic_info(Inferior inferior)
        {
            if (has_dynlink_info) {
                if (!first_link_map.IsNull)
                    do_update_shlib_info (inferior);
                return;
            }

            TargetAddress debug_base = main_bfd.ReadDynamicInfo (inferior);
            if (debug_base.IsNull)
                return;

            int size = 2 * inferior.TargetLongIntegerSize + 3 * inferior.TargetAddressSize;

            TargetReader reader = new TargetReader (inferior.ReadMemory (debug_base, size));
            if (reader.ReadLongInteger () != 1)
                return;

            first_link_map = reader.ReadAddress ();
            dynlink_breakpoint_addr = reader.ReadAddress ();

            rdebug_state_addr = debug_base + reader.Offset;

            if (reader.ReadLongInteger () != 0)
                return;

            has_dynlink_info = true;

            Instruction insn = inferior.Architecture.ReadInstruction (inferior, dynlink_breakpoint_addr);
            if ((insn == null) || !insn.CanInterpretInstruction)
                throw new InternalError ("Unknown dynlink breakpoint: {0}", dynlink_breakpoint_addr);

            dynlink_breakpoint = new DynlinkBreakpoint (this, insn);
            dynlink_breakpoint.Insert (inferior);

            do_update_shlib_info (inferior);

            check_loaded_library (inferior, main_bfd);
        }
        void do_update_shlib_info(Inferior inferior)
        {
            //			if (Process.MonoRuntimeFound)
            //				return;
            if (!dyld_all_image_infos.IsNull) {
                int size = 2 * inferior.TargetLongIntegerSize + 2 * inferior.TargetAddressSize;
                TargetReader reader = new TargetReader (inferior.ReadMemory (dyld_all_image_infos, size));

                reader.ReadLongInteger (); // version
                int infoArrayCount = (int)reader.ReadLongInteger ();
                TargetAddress infoArray = reader.ReadAddress ();

                size = infoArrayCount * (inferior.TargetLongIntegerSize + 2 * inferior.TargetAddressSize);
                reader = new TargetReader (inferior.ReadMemory (infoArray, size));
                Console.Write("Loading symbols for shared libraries:");
                for (int i=0; i<infoArrayCount; i++)
                {
                    TargetAddress imageLoadAddress = reader.ReadAddress();
                    TargetAddress imageFilePath = reader.ReadAddress();
                    reader.ReadLongInteger(); //imageFileModDate
                    string name = inferior.ReadString (imageFilePath);

                    if (name == null)
                        continue;

                    if (bfd_hash.Contains (name))
                        continue;

                    try {
                        Console.Write(".");
                        AddExecutableFile (inferior, name, imageLoadAddress/*TargetAddress.Null*/, false, true);
                    }
                    catch (SymbolTableException e)
                    {
                        Console.WriteLine("Unable to load binary for "+name);
                        bfd_hash.Add (name, null);
                    }
                }
                Console.WriteLine("");
            }
        }
        void do_update_shlib_info(Inferior inferior)
        {
            bool first = true;
            TargetAddress map = first_link_map;
            while (!map.IsNull) {
                int the_size = 4 * inferior.TargetAddressSize;
                TargetReader map_reader = new TargetReader (inferior.ReadMemory (map, the_size));

                TargetAddress l_addr = map_reader.ReadAddress ();
                TargetAddress l_name = map_reader.ReadAddress ();
                map_reader.ReadAddress ();

                string name;
                try {
                    name = inferior.ReadString (l_name);
                    // glibc 2.3.x uses the empty string for the virtual
                    // "linux-gate.so.1".
                    if ((name != null) && (name == ""))
                        name = null;
                } catch {
                    name = null;
                }

                map = map_reader.ReadAddress ();

                if (first) {
                    first = false;
                    continue;
                }

                if (name == null)
                    continue;

                if (bfd_hash.Contains (name))
                    continue;

                bool step_into = Process.ProcessStart.LoadNativeSymbolTable;
                AddExecutableFile (inferior, name, l_addr, step_into, true);
            }
        }