P476 - 5eg :
book code :
InjectShellCodeToProcess(pTargetProc, pContext, g_DllPathToInject)
source code:
status = InjectShellCodeToProcessByModifyContext(pContext,g_DllPathToInject);
list ?:
book code :
InjectShellCodeToProcess(pTargetProc, pContext, g_DllPathToInject)
source code:
status = InjectShellCodeToProcessByModifyContext(pContext,g_DllPathToInject);
list ?:
-
why change? pTargetProc 去哪里了?不需要了吗?
- 回答: [这里的过程, InjectShellCodeToProcessByModifyContext 的input是改自身copy的pContext,不用pTargetProc 了.]
-
what for 这里的功能解释是?
- 回答: [修改copy 自目标targetThread 的 pContext]
-
NTSTATUS InjectShellCodeToProcessByModifyContext(PCONTEXT pContext,WCHAR *wstrDllPath)
的定义中如下:
uNtdllBase = FindImageBase(NtCurrentProcess(),L"ntdll.dll");
//[popexizhi: ?why? ntdll.dll 这个和下面的LdrLoadDll 都是要注册的目标线程中的吗? ]
if (uNtdllBase != 0)
{
//先申请内存
status = ZwAllocateVirtualMemory(NtCurrentProcess(),
&pData,0,&MemSize,MEM_COMMIT,PAGE_EXECUTE_READWRITE);
if (NT_SUCCESS(status))
{
dprintf("Allocated Mem = 0x%p\n",pData);
dprintf("ntdll.dll Base = 0x%p \n",uNtdllBase);
AddrOfLdrLoadDll = KeGetProcAddress(uNtdllBase,"LdrLoadDll");
dprintf("LdrLoadDll = 0x%p \n",AddrOfLdrLoadDll);
没有评论:
发表评论