__declspec(naked) void FuckNtCreateFile (
__out PHANDLE FileHandle,
__in ACCESS_MASK DesiredAccess,
__in POBJECT_ATTRIBUTES ObjectAttributes,
__out PIO_STATUS_BLOCK IoStatusBlock,
__in_opt PLARGE_INTEGER AllocationSize,
__in ULONG FileAttributes,
__in ULONG ShareAccess,
__in ULONG CreateDisposition,
__in ULONG CreateOptions,
__in_bcount_opt(EaLength) PVOID EaBuffer,
__in ULONG EaLength
)
{
if (MmIsAddressValid(ObjectAttributes))
{
//KdPrint(("1111111 : %wZ\r\n", &ProtectFileName));
if (MmIsAddressValid(ObjectAttributes->ObjectName))
{
//KdPrint(("222222 : %wZ\r\n", &ProtectFileName));
if (MmIsAddressValid(ObjectAttributes->ObjectName->Buffer))
{
//KdPrint(("3333333 : %wZ\r\n", &ProtectFileName));
KdPrint(("4444 :%ws----- \r\n",ObjectAttributes->ObjectName->Buffer ));
//if ( wcsstr(ObjectAttributes->ObjectName->Buffer,ProtectFileName.Buffer) != NULL)
//{
// KdPrint(("执行Hook成功\n"));
//}
}
}
}
__asm
{
/* popfd;
popad;*/
jmp CreateFileHookZone;
}
}
这个是InlineHook代码中,那个修改前五个字节jmp来的函数,这里我想输出创建的文件名,发现输出的都是问号,而我用SSDTHook输入的打开文件名, 是没有错误的,求解释,难道这种naked函数需要纯汇编指令????
还是姿势不对啊,如应该先调用原始函数,再进行修改返回值...
[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!