在运行时更改进程名称 [英] Changing a process name in runtime

查看:138
本文介绍了在运行时更改进程名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于 A.EXE PE 文件,如果程序以测试模式运行,我想将进程名称更改为A_TEST.exe".
如果程序以安全模式运行,我想更改为A_SAFE.exe"

For A.EXE PE file, if the program runs as test mode, I would like to change the process name to "A_TEST.exe".
And if the program runs as safe mode, I want to change to "A_SAFE.exe"

文件名必须相同(A.EXE).

The file name must be same(A.EXE).

有可能吗?

推荐答案

如果进程名称"是显示任务管理器的名称 - 您只能从 ring0 更改它.

If "process name" is a name which shows Task Manager - you can change it only from ring0.

从 ring3 您只能更改默认窗口标题.

From ring3 you can only change a default window title.

#include <intrin.h>

PEB* peb = (PEB*)__readfsdword(0x30);

wchar_t newTitle[] = L"NewTitle";
UNICODE_STRING newTitleUStr = {sizeof(newTitle), sizeof(newTitle), newTitle};
peb->ProcessParameters->WindowTitle = newTitleUStr;

这篇关于在运行时更改进程名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆