Exemplo n.º 1
0
 public IList <ModuleInfo> EnumerateModules()
 {
     if (_modules == null)
     {
         // Need to filter out non-modules like the interpreter (named something
         // like "ld-2.23") and anything that starts with /dev/ because their
         // memory range overlaps with actual modules.
         ulong interpreter = _core.GetAuxvValue(ElfAuxvType.Base);
         _modules = _core.LoadedImages
                    .Where((img) => (ulong)img.BaseAddress != interpreter && !img.Path.StartsWith("/dev/"))
                    .Select(img => CreateModuleInfo(img))
                    .ToArray();
     }
     return(_modules);
 }
Exemplo n.º 2
0
        public IEnumerable <ModuleInfo> EnumerateModules()
        {
            if (_modules is null)
            {
                // Need to filter out non-modules like the interpreter (named something
                // like "ld-2.23") and anything that starts with /dev/ because their
                // memory range overlaps with actual modules.
                ulong interpreter = _core.GetAuxvValue(ElfAuxvType.Base);

                _modules = new List <ModuleInfo>();
                foreach (ElfLoadedImage image in _core.LoadedImages.Values)
                {
                    if ((ulong)image.BaseAddress != interpreter && !image.FileName.StartsWith("/dev", StringComparison.Ordinal))
                    {
                        _modules.Add(CreateModuleInfo(image));
                    }
                }
            }

            return(_modules);
        }
Exemplo n.º 3
0
        public IList <ModuleInfo> EnumerateModules()
        {
            if (_modules == null)
            {
                // Need to filter out non-modules like the interpreter (named something
                // like "ld-2.23") and anything that starts with /dev/ because their
                // memory range overlaps with actual modules.
                ulong interpreter = _core.GetAuxvValue(ElfAuxvType.Base);

                _modules = new List <ModuleInfo>(_core.LoadedImages.Count);
                foreach (ElfLoadedImage img in _core.LoadedImages)
                {
                    if ((ulong)img.BaseAddress != interpreter && !img.Path.StartsWith("/dev"))
                    {
                        _modules.Add(CreateModuleInfo(img));
                    }
                }
            }

            return(_modules);
        }