ProcessSharp的构造函数,对应的测试是

https://github.com/lolp1/Process.NET/blob/master/test/Process.NET.Test/Core/ProcessSharpTest.cs

  /// <summary>
/// Initializes a new instance of the <see cref="ProcessSharp" /> class.
/// </summary>
/// <param name="native">The native process.</param>
/// <param name="type">The type of memory being manipulated.</param>
public ProcessSharp(System.Diagnostics.Process native,MemoryType type)
{
native.EnableRaisingEvents = true; native.Exited += (s, e) =>
{
ProcessExited?.Invoke(s, e);
HandleProcessExiting();
}; Native = native; Handle = MemoryHelper.OpenProcess(ProcessAccessFlags.AllAccess, Native.Id);
switch (type)
{
case MemoryType.Local:
Memory = new LocalProcessMemory(Handle);
break;
case MemoryType.Remote:
Memory = new ExternalProcessMemory(Handle);
break;
default:
throw new ArgumentOutOfRangeException(nameof(type), type, null);
} native.ErrorDataReceived += OutputDataReceived;
native.OutputDataReceived += OutputDataReceived; ThreadFactory = new ThreadFactory(this);
ModuleFactory = new ModuleFactory(this);
MemoryFactory = new MemoryFactory(this);
WindowFactory = new WindowFactory(this);
}

https://github.com/lolp1/Process.NET/blob/master/src/Process.NET/Memory/ExternalProcessMemory.cs

可以尝试转换HearthBuddy中的Class276中的方法

internal IntPtr method_33(IntPtr intptr_37, string string_0, params Class276.Enum20[] enum20_0)
{
while (intptr_37 != IntPtr.Zero)
{
using (AllocatedMemory allocatedMemory = this.externalProcessMemory_0.CreateAllocatedMemory())
{
allocatedMemory.AllocateOfChunk<IntPtr>("Itr");
IntPtr intPtr;
while ((intPtr = this.method_35(intptr_37, allocatedMemory["Itr"])) != IntPtr.Zero)
{
IntPtr intPtr2 = this.method_37(intPtr);
if (this.externalProcessMemory_0.ReadStringA(intPtr2) == string_0)
{
if (enum20_0 != null)
{
Class276.Enum20[] array = this.method_31(intPtr);
if (array.Length != enum20_0.Length || !array.SequenceEqual(enum20_0))
{
continue;
}
}
return intPtr;
}
}
intptr_37 = this.method_25(intptr_37);
}
}
return IntPtr.Zero;
}

Process.Net的更多相关文章

  1. IIS启动失败,启动Windows Process Activation Service时,出现错误13:数据无效 ;HTTP 错误 401.2 - Unauthorized 由于身份验证头无效,您无权查看此页

    因为修改过管理员账号的密码后重启服务器导致IIS无法启动,出现已下异常 1.解决:"启动Windows Process Activation Service时,出现错误13:数据无效&quo ...

  2. C#的Process类调用第三方插件实现PDF文件转SWF文件

    在项目开发过程中,有时会需要用到调用第三方程序实现本系统的某一些功能,例如本文中需要使用到的swftools插件,那么如何在程序中使用这个插件,并且该插件是如何将PDF文件转化为SWF文件的呢?接下来 ...

  3. C# ShellExcute与Process

    C#运行外部程序的两种方法 ShellExecute using System.Runtime.InteropServices; public enum ShowWindowCommands : in ...

  4. 【手记】调用Process.EnterDebugMode引发异常:并非所有引用的特权或组都分配给呼叫方

    刚上线一个新版本,其中有台电脑打开软件就报[xx的类型初始值设定项引发异常](还好不是一大波电脑,新东西上线就怕哀鸿遍野),如图: 显然是该类型的静态构造函数中抛异常了(红线处就是类名),遂打开该类, ...

  5. C# - 多线程 之 Process与Thread与ThreadPool

    Process 进程类, // 提供对本地和远程进程的访问,启动/停止本地系统进程 public class Process : Component { public int Id { get; } ...

  6. Java Business Process Management(业务流程管理) 初识环境搭建

    一.简介 (一)什么是jbpm JBPM,全称是Java Business Process Management(业务流程管理),它是覆盖了业务流程管理.工作流.服务协作等领域的一个开源的.灵活的.易 ...

  7. Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details

    thinkphp 在Apache上配置启用伪静态,重启Apache1 restart 竟然失败了,报错 Job for httpd.service failed because the control ...

  8. 更新过程 renewal process

    一类随机过程.是描述元件或设备更新现象的一类随机过程.设对某元件的工作进行观测.假定元件的使用寿命是一随机变量,当元件发生故障时就进行修理或换上新的同类元件,而且元件的更新是即时的(修理或更换元件所需 ...

  9. Transaction (Process ID xxx) was deadlocked on lock

    Transaction (Process ID 161) was deadlocked on lock | communication buffer resources with another pr ...

  10. NodeJS入门(五)—— process对象

    process对象用于处理与当前进程相关的事情,它是一个全局对象,可以在任何地方直接访问到它而无需引入额外模块. 它是 EventEmitter 的一个实例. 本章的示例可以从我的Github上下载到 ...

随机推荐

  1. Vue项目中使用AES加密

    1.在vue中安装crypto-js        备注:千万不要安装错了,中间是 ‘-’连接,不是‘.’ 2.在项目的工具文件夹中新建 encryption.js,用于定义加密和解密的方法,方便调用 ...

  2. Win Server 2012 配置运行 .net core 环境

    今天拿到一台 全新的win 2012 服务器配置服务器环境 记录一下 首先装好IIS 打开服务器管理器  - 添加功能和角色     好 安装完IIS 看一下服务器有没有安装 core的运行环境(全新 ...

  3. Spring Cloud(四)服务提供者 Eureka + 服务消费者 Feign

    上一篇文章,讲述了如何通过RestTemplate + Ribbon去消费服务,这篇文章主要讲述如何通过Feign去消费服务. Feign简介 Feign是一个声明式的伪Http客户端,它使得写Htt ...

  4. JavaScript 的基本使用

    JavaScript 基本语法要求: 1.JS的写法是严格区分大小写的. 2.标识符的起名要求跟java的是一样的,第一个位置可以说字母.下划线.美元符号.其他位置可以字母.下划线.美元符号.数字. ...

  5. gitbook 准备一 [python3 WSGI 初探]

    目录 1.wsgi服务样例 2.请求样例 1.wsgi服务样例 # 官网样例 from wsgiref.util import setup_testing_defaults from wsgiref. ...

  6. 《数字图像处理(MATLAB)》冈萨雷斯

    <数字图像处理(MATLAB)>冈萨雷斯 未完结! 参考:数字图像处理——https://blog.csdn.net/dujing2019/article/category/8820151 ...

  7. 十九:mvc强类型声明

    落下了几节,自己很懒啊, 得找个时间补上... 1. 强类型 是指变量在定义时就已经明确指定了其类型.如: string  s; int x; 2.弱类型 赋值时才确定类型. var s; var x ...

  8. okhttp连接池:put,get方法&connection回收

    OkHttp连接池put和get方法: 在上一次[https://www.cnblogs.com/webor2006/p/9281429.html]咱们分析了连接拦截器,如下: 不管是Http1.0还 ...

  9. java学习笔记12-继承

    继承就是子类继承父类的特征和行为 有时候单一划分某个类别并不能处理所有情况,某些类别下有明显不同的子类,这些子类虽然拥有类似的行为和属性,但是他们各自发生的这些行为的方式或者属性对某些结果的影响是不一 ...

  10. docker 查看系统进程pid

    docker inspect -f '{{.State.Pid}} {{.Id}}' $(docker ps -a -q)