Changing a process name in runtime

拜拜、爱过 提交于 2019-12-07 14:41:18

问题


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"

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

Is it possible?


回答1:


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

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;



回答2:


As far as I know this isn't possible without changing the file name.



来源:https://stackoverflow.com/questions/3722852/changing-a-process-name-in-runtime

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!