上一篇文章在xp下取路径太麻烦
既然规定在了xp系统下,为什么不硬编码呢?
好吧,走起~~~
PFILE_OBJECT __declspec(naked) __stdcall _MmGetFileObjectForSection(PVOID Section)
{
__asm
{
push ebp;
mov ebp, esp;
mov eax, dword ptr ss:[ebp + 0x08];
mov eax, dword ptr ds:[eax + 0x14];
mov eax, dword ptr ds:[eax];
mov eax, dword ptr ds:[eax + 0x24];
mov esp, ebp;
pop ebp;
ret 0x04;
}
}
NTSTATUS PsReferenceProcessFilePointer(IN PEPROCESS Process, OUT PVOID *OutFileObject)
{
PVOID SectionObject;
if (SectionObject = *(PVOID*)((PCHAR)Process + 0x138))
{
PFILE_OBJECT FileObject;
FileObject = _MmGetFileObjectForSection(SectionObject);
*OutFileObject = FileObject;
ObReferenceObject (FileObject);
return STATUS_SUCCESS;
}
return STATUS_UNSUCCESSFUL;
}WRK+DBG
本文探讨了解决XP系统下路径获取时遇到的问题,并通过硬编码的方式优化了解决方案。详细介绍了`PFILE_OBJECT__declspec(naked)__stdcall_MmGetFileObjectForSection(PVOIDSection)`函数的作用以及`PsReferenceProcessFilePointer`函数如何引用和处理文件对象。

3636

被折叠的 条评论
为什么被折叠?



