Exemple #1
0
        private IEnumerable <NativeModule> InternalEnumProcessModules()
        {
            var flags = m_Process.Is64Bit ? ListModulesFlags.ListModules64Bit : ListModulesFlags.ListModules32Bit;

            if (!ModuleHelper.EnumProcessModules(m_Process.Handle, out var modHandles, flags))
            {
                return(Enumerable.Empty <NativeModule>());
            }
            return(modHandles.Select(h => new NativeModule(m_Process.Handle, h)));
        }
Exemple #2
0
 public NativeModule(SafeMemoryHandle hProcess, IntPtr hModule)
 {
     BaseAddress = hModule;
     FileName    = ModuleHelper.GetModuleFileName(hProcess, hModule);
     ModuleName  = string.IsNullOrEmpty(FileName) ? string.Empty : Path.GetFileName(FileName);
     if (ModuleHelper.GetModuleInformation(hProcess, hModule, out var info))
     {
         EntryPointAddress = info.EntryPoint;
         ModuleMemorySize  = (int)info.SizeOfImage.ToInt64();
     }
 }
Exemple #3
0
        private IEnumerable <NativeModule> InternalEnumProcessModules()
        {
            var flags = m_Process.Is64Bit ? ListModulesFlags.ListModules64Bit : ListModulesFlags.ListModules32Bit;

            if (!ModuleHelper.EnumProcessModules(m_Process.Handle, out var modHandles, flags))
            {
                yield break;
            }
            foreach (var handle in modHandles)
            {
                yield return(new NativeModule(m_Process.Handle, handle));
            }
        }