-
-
[求助]这段驱动的代码错在哪里?
-
发表于:
2007-1-14 17:08
3885
-
我在按MSDN的说明,驱动里想访问磁盘文件 NTDLL。DLL,但是每次都会出错,在VC编译后却能正常运行。下面代码错在哪里?
LOCAL OBJAttr:OBJECT_ATTRIBUTES
LOCAL IOSB:IO_STATUS_BLOCK
LOCAL hFile:DWORD,hSection:DWORD,Base:DWORD,hProcess:DWORD,dwImgSize
LOCAL UniDllName:UNICODE_STRING
invoke RtlInitUnicodeString,ADDR UniDllName,$CTW0("\\SystemRoot\\System32\\ntdll.dll")
lea esi,OBJAttr
assume esi:ptr OBJECT_ATTRIBUTES
mov [esi]._Length,sizeof OBJECT_ATTRIBUTES
mov [esi].RootDirectory,0
lea eax,UniDllName
mov [esi].ObjectName,eax
mov [esi].Attributes,OBJ_CASE_INSENSITIVE
invoke ZwOpenFile,Addr hFile,
FILE_EXECUTE or SYNCHRONIZE,
ADDR OBJAttr,
ADDR IOSB,
FILE_SHARE_READ,
FILE_SYNCHRONOUS_IO_NONALERT
ZwOpenFile返回C0000058h
[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!