发布时间:2014-04-28 12:21:58作者:知识屋
BOOLEAN SendInterface( IN PCWSTR DeviceName, IN ULONG IoControlCode, IN PVOID Data, IN ULONG DataLength ) { NTSTATUS ntStatus = STATUS_SUCCESS; PFILE_OBJECT pNetObject = NULL; OBJECT_ATTRIBUTES ObPassthru; IO_STATUS_BLOCK NetStatusBlock; UNICODE_STRING PassthruString; HANDLE hNet =NULL; BOOLEAN bRet = FALSE; __try { RtlInitUnicodeString( &PassthruString, DeviceName); InitializeObjectAttributes( &ObPassthru,&PassthruString,0,(HANDLE) NULL,(PSECURITY_DESCRIPTOR)NULL); ntStatus = ZwOpenFile(&hNet,OBJ_CASE_INSENSITIVE,&ObPassthru,&NetStatusBlock,0,FILE_NON_DIRECTORY_FILE); if (!NT_SUCCESS(ntStatus)) { DbgPrint("[SendInterface] ZwOpenFile failed err=[0x%08x]n", ntStatus); __leave; } ntStatus = ObReferenceObjectByHandle(hNet,0,NULL,KernelMode,(PVOID *) &pNetObject,NULL ); if (!NT_SUCCESS(ntStatus)) { DbgPrint("[SendInterface] ObReferenceObjectByHandle failed err=[0x%08x]n", ntStatus); ZwClose(hNet); __leave; } ntStatus = ZwDeviceIoControlFile(hNet,NULL,NULL,NULL,&NetStatusBlock,IoControlCode,Data,DataLength,NULL,0); ObDereferenceObject(pNetObject); if (!NT_SUCCESS(ntStatus)) { DbgPrint("[SendInterface] ZwDeviceIoControlFile failed err=[0x%08x]n", ntStatus); ZwClose(hNet); __leave; } ZwClose(hNet); bRet = TRUE; } __except(EXCEPTION_EXECUTE_HANDLER) { KdPrint(("[SendInterface]Memory access failed.")); } return bRet; } SendInterface(L"DeviceBBDrvDevice",0xb972a008,(PVOID)0x02f0ade0,0x00000030);
2011-06-17
电脑开机时出现lass.exe进程是病毒吗?
自拍须谨慎!教你如何通过照片定位查看拍摄地点
电脑病毒最基础知识
黑客学员必须了解的C语言技术
精典详细内网渗透专题文章
教你破解Tp-Link的无线路由密码
解决SecureCRT中文显示乱码
QQ电脑管家和360哪个好?横评实测对比
攻防实战:无线网络路由入侵过程