首页
社区
课程
招聘
[非提问]双机调试解决了,Tp检测TesSafe模块内地址是否被下硬件断点
发表于: 2013-7-26 14:39 16418

[非提问]双机调试解决了,Tp检测TesSafe模块内地址是否被下硬件断点

2013-7-26 14:39
16418
双机调试很叼,但是我还是能调试了虽然是被动下段但也是可以的
在windbg  输入
bp kddisabledebugger+7
bp kddisabledebuggerwithlock // 以防万一

虽然能双机调试  但是我要搞清零 总得让我下访问断点吧
TP居然硬件断点都不让下 ,当然仅仅是Tesafe模块内地址
目测是有一个线程监视硬件断点情况
具体是监视dr寄存器还是其他方法不得而知
继续研究 继续撸 撸到深处撸自身
这真的很不乖哦

以下是解决双机调试的代码,如果以后TP加个【调用检测】,那么以下方法就无效了

/***************************************************************************************
* AUTHOR : pudge
* DATE   : 2012-9-8
* MODULE : PassKddisabledebugger.C
* 
* Command: 
*	Source of IOCTRL Sample Driver
*
* Description:
*		Demonstrates communications between USER and KERNEL.
*
****************************************************************************************
* Copyright (C) 2010 pudge.
****************************************************************************************/

//#######################################################################################
//# I N C L U D E S
//#######################################################################################

#ifndef CXX_PASSKDDISABLEDEBUGGER_H
#include "PassKddisabledebugger.h"
#endif
#include <ntddk.h>
#include "function.h"
#include "myfunc.h"
VOID LoadImageRoutine(
	__in_opt PUNICODE_STRING  FullImageName,
	__in HANDLE  ProcessId,
	__in PIMAGE_INFO  ImageInfo
	);

void  SearchFeatureEx(int nAddr,char* pFeature,int ModuleSize,int nLeng);
void PassGlobalStaticCrcEx();
DWORD NTAPI MyVectoredExceptionHead(EXCEPTION_POINTERS * ExceptionInfo);
ULONG fuckaddr1;
DWORD pShutdown[10000]={0};
BYTE _pMirror[1282048]={0};
DWORD pMirror=(DWORD)_pMirror;
DWORD TesSafeBase=0;
BYTE mKdDisableDebugger[5]={0};
DWORD kdRet=0;
int n=0;
PDRIVER_OBJECT g_pObj=NULL;
//////////////////////////////////////////////////////////////////////////

//#######################################################################################
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//@@@@@@@@				D R I V E R   E N T R Y   P O I N T						 @@@@@@@@
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//#######################################################################################
NTSTATUS
DriverEntry(IN PDRIVER_OBJECT pDriverObj, IN PUNICODE_STRING pRegistryString)
{
	NTSTATUS		status = STATUS_SUCCESS;
	UNICODE_STRING  ustrLinkName;
	UNICODE_STRING  ustrDevName;  
	PDEVICE_OBJECT  pDevObj;
	int i = 0;
    g_pObj=pDriverObj;
    dprintf("EasySys Sample Driver\r\n"
            "Compiled %s %s\r\nIn DriverEntry : %wZ\r\n",
			__DATE__, __TIME__, pRegistryString);

	// Register dispatch routines
/*
	for(i = 0; i < IRP_MJ_MAXIMUM_FUNCTION; i++)
	{
		pDriverObj->MajorFunction[i] = DispatchCommon;  
	}
*/
	pDriverObj->MajorFunction[IRP_MJ_CREATE] = DispatchCreate;
	pDriverObj->MajorFunction[IRP_MJ_CLOSE] = DispatchClose;

	// Dispatch routine for communications
	pDriverObj->MajorFunction[IRP_MJ_DEVICE_CONTROL] = DispatchDeviceControl;

	// Unload routine
	pDriverObj->DriverUnload = DriverUnload;

	// Initialize the device name.
	RtlInitUnicodeString(&ustrDevName, NT_DEVICE_NAME);

	// Create the device object and device extension
	status = IoCreateDevice(pDriverObj, 
				0,
				&ustrDevName, 
				FILE_DEVICE_UNKNOWN,
				0,
				FALSE,
				&pDevObj);

	if(!NT_SUCCESS(status))
	{
		dprintf("Error, IoCreateDevice = 0x%x\r\n", status);
		return status;
	}

    //// Get a pointer to our device extension
    //deviceExtension = (PDEVICE_EXTENSION) deviceObject->DeviceExtension;

    //// Save a pointer to the device object
    //deviceExtension->DeviceObject = deviceObject;

	if(IoIsWdmVersionAvailable(1,0x10))
	{
		//如果是支持符号链接用户相关性的系统
		RtlInitUnicodeString(&ustrLinkName, SYMBOLIC_LINK_GLOBAL_NAME);
	}
	else
	{
		//不支持
		RtlInitUnicodeString(&ustrLinkName, SYMBOLIC_LINK_NAME);
	}
	
	// Create a symbolic link to allow USER applications to access it. 
	status = IoCreateSymbolicLink(&ustrLinkName, &ustrDevName);  
	
	if(!NT_SUCCESS(status))
	{
		dprintf("Error, IoCreateSymbolicLink = 0x%x\r\n", status);
		
		IoDeleteDevice(pDevObj); 
		return status;
	}	

	//
	//	TODO: Add initialization code here.
	//设备开始
	
	
	PsSetLoadImageNotifyRoutine(LoadImageRoutine);

	




	//

    //// Tell the I/O Manger to do BUFFERED IO
    //deviceObject->Flags |= DO_BUFFERED_IO;

    //// Save the DeviveObject
    //deviceExtension->DeviceObject = deviceObject;

	dprintf("DriverEntry Success\r\n");
	DbgPrint("DriverEntry Success\r\n");

	return STATUS_SUCCESS;
}

VOID
DriverUnload(IN PDRIVER_OBJECT pDriverObj)
{	
   
	UNICODE_STRING strLink;

	// Unloading - no resources to free so just return.
	dprintf("Unloading...\r\n");;	
	DbgPrint("Unloading...\r\n");
	//
	// TODO: Add uninstall code here.
	//关闭设备
	
	UnInLineHookEngine((int)KdDisableDebugger,(char *)mKdDisableDebugger,5);
	PsRemoveLoadImageNotifyRoutine(LoadImageRoutine);
	//NtFreeVirtualMemory((HANDLE)-1,pMirror,(PSIZE_T)0x139000,MEM_COMMIT);
	DbgPrint("unNotifyRoutine is OK");


	//
	
	// Delete the symbolic link
	RtlInitUnicodeString(&strLink, SYMBOLIC_LINK_NAME);
	IoDeleteSymbolicLink(&strLink);

	// Delete the DeviceObject
	IoDeleteDevice(pDriverObj->DeviceObject);

	dprintf("Unloaded Success\r\n");
	DbgPrint("Unloaded Success\r\n");
	return;
}

NTSTATUS
DispatchCreate(IN PDEVICE_OBJECT pDevObj, IN PIRP pIrp)
{
	pIrp->IoStatus.Status = STATUS_SUCCESS;
	pIrp->IoStatus.Information = 0;

	IoCompleteRequest(pIrp, IO_NO_INCREMENT);

	
	return STATUS_SUCCESS;
}


NTSTATUS
DispatchClose(IN PDEVICE_OBJECT pDevObj, IN PIRP pIrp)
{
	pIrp->IoStatus.Status = STATUS_SUCCESS;
	pIrp->IoStatus.Information = 0;

	IoCompleteRequest(pIrp, IO_NO_INCREMENT);
	

	// Return success
	return STATUS_SUCCESS;
}

NTSTATUS
DispatchCommon(IN PDEVICE_OBJECT pDevObj, IN PIRP pIrp)
{
	pIrp->IoStatus.Status = STATUS_SUCCESS;
	pIrp->IoStatus.Information = 0L;

	IoCompleteRequest( pIrp, 0 );

	// Return success
	return STATUS_SUCCESS;
}

NTSTATUS 
DispatchDeviceControl(IN PDEVICE_OBJECT pDevObj, IN PIRP pIrp)
{
	NTSTATUS status               = STATUS_INVALID_DEVICE_REQUEST;	 // STATUS_UNSUCCESSFUL
	PIO_STACK_LOCATION pIrpStack  = IoGetCurrentIrpStackLocation(pIrp);
	ULONG uIoControlCode          = 0;
	PVOID pIoBuffer				  = NULL;
	ULONG uInSize                 = 0;
	ULONG uOutSize                = 0;

	// Get the IoCtrl Code
	uIoControlCode = pIrpStack->Parameters.DeviceIoControl.IoControlCode;

	pIoBuffer = pIrp->AssociatedIrp.SystemBuffer;
	uInSize = pIrpStack->Parameters.DeviceIoControl.InputBufferLength;
	uOutSize = pIrpStack->Parameters.DeviceIoControl.OutputBufferLength;

	switch(uIoControlCode)
	{
		case IOCTL_HELLO_WORLD:
			{			
				dprintf("MY_CTL_CODE(0)=%d\r\n,MY_CTL_CODE");

				// Return success
				status = STATUS_SUCCESS;
			}
			break;

		case IOCTRL_REC_FROM_APP:
			{
				// Receive data form Application
				//dprintf("IOCTRL_REC_FROM_APP\r\n");

				// Do we have any data?
				if( uInSize > 0 )
				{
					dprintf("Get Data from App: %ws\r\n", pIoBuffer);
				}

				// Return success
				status = STATUS_SUCCESS;
			}
			break;

		case IOCTRL_SEND_TO_APP:
			{
				// Send data to Application
				//dprintf("IOCTRL_SEND_TO_APP\r\n");
			
				// If we have enough room copy the data upto the App - note copy the terminating character as well...
				if( uOutSize >= strlen( DATA_TO_APP ) + 1 )
				{
					RtlCopyMemory(  pIoBuffer,
									DATA_TO_APP, 
									strlen( DATA_TO_APP ) + 1 );

					// Update the length for the App
					pIrp->IoStatus.Information = strlen( DATA_TO_APP ) + 1;

					dprintf("Send Data to App: %s\r\n", pIoBuffer);
					
					// Return success
					status = STATUS_SUCCESS;
				}
			}
			break;
			
		//
		// TODO: Add execute code here.执行
			
			
		//

		default:
			{
				// Invalid code sent
				dprintf("Unknown IOCTL: 0x%X (%04X,%04X)\r\n", 
                                          uIoControlCode,
                                          DEVICE_TYPE_FROM_CTL_CODE(uIoControlCode),
                                          IoGetFunctionCodeFromCtlCode(uIoControlCode));
				status = STATUS_INVALID_PARAMETER;	
			}
			break;
	}

	if(status == STATUS_SUCCESS)
	{
		pIrp->IoStatus.Information = uOutSize;
	}
	else
	{
		pIrp->IoStatus.Information = 0;
	}

	// Complete the I/O Request
	pIrp->IoStatus.Status = status;

	IoCompleteRequest(pIrp, IO_NO_INCREMENT);

	return status;
}

__declspec(naked) void MyKdDisableDebugger()
{
	__asm
	{
			push eax
			mov eax,[esp+0x4]
			sub eax,TesSafeBase
			add eax,pMirror
			mov [esp+0x4],eax
			pop eax
			jmp kdRet
	}

	
}
//
// TODO: Add your module definitions here.
//
VOID LoadImageRoutine(
	__in_opt PUNICODE_STRING  FullImageName,
	__in HANDLE  ProcessId,
	__in PIMAGE_INFO  ImageInfo
)
{
	if(wcsstr(FullImageName->Buffer, L"TesSafe.sys")!=0)
	{
		

		DbgPrint("TesSafe has been discovered");
		ULONG uImageInfo=(ULONG)ImageInfo->ImageBase;
		DbgPrint("TesSafeBase is %x",uImageInfo);
		TesSafeBase=uImageInfo;
		

		PMDL pMdl;
		pMdl = IoAllocateMdl(_pMirror,0x139000,FALSE,FALSE,NULL);
		MmProtectMdlSystemAddress(pMdl,PAGE_EXECUTE_READWRITE);
		IoFreeMdl(pMdl);
		//NtAllocateVirtualMemory((HANDLE)-1,pMirror,0,(PSIZE_T)0x139000,MEM_COMMIT,PAGE_EXECUTE_READWRITE);
		UnInLineHookEngine((int)_pMirror,(char *)TesSafeBase,0x139000);

		//PassGlobalStaticCrcEx();
		kdRet=(DWORD)KdDisableDebugger+0x7;
		UnInLineHookEngine((int)mKdDisableDebugger,(char *)KdDisableDebugger,5);
		InLineHookEngine((ULONG)KdDisableDebugger,(int)MyKdDisableDebugger);
		DbgPrint("MirrorBase is %x",(int)pMirror);

		if(*(PUCHAR)(pMirror+0x92c1)==0x75)
		{
			
			*(PUSHORT)(pMirror+0x92c1)=0x9090;
			DbgPrint("TesSafeOffset1 is %x",pMirror+0x92c1);
		}
		if(*(PUCHAR)(pMirror+0x92c1+0x12e)==0x74)
		{
			*(PUCHAR)(pMirror+0x92c1+0x12e)=0xeb;
			DbgPrint("TesSafeOffset2 is %x",pMirror+0x92c1+0x12e);
		}

		
	}
	return;
}












/* EOF */

[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!

收藏
免费 0
支持
分享
最新回复 (16)
雪    币: 381
活跃值: (11)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
2
看着很复杂的样子,以前就两句话就搞定了。。。
2013-7-26 14:46
0
雪    币: 167
活跃值: (190)
能力值: ( LV5,RANK:60 )
在线值:
发帖
回帖
粉丝
3
第一次遇到内核下不让下硬件断点

这招太阴了
2013-7-26 14:49
0
雪    币: 68
活跃值: (104)
能力值: ( LV4,RANK:50 )
在线值:
发帖
回帖
粉丝
4
楼上 加企鹅 一起探讨啊 我也弄了几天了 907187533
2013-7-26 15:42
0
雪    币: 564
活跃值: (390)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
5
目测楼主CRC校验没过,你这样会不重启?
2013-7-26 19:04
0
雪    币: 167
活跃值: (190)
能力值: ( LV5,RANK:60 )
在线值:
发帖
回帖
粉丝
6
不重启啊,那句你看出会重启?
2013-7-26 19:17
0
雪    币: 34
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
7
楼主的UnInLineHookEngine和InLineHookEngine应该说明一下都做了什么内容啊?
2013-7-27 09:17
0
雪    币: 167
活跃值: (190)
能力值: ( LV5,RANK:60 )
在线值:
发帖
回帖
粉丝
8
void InLineHookEngine(int nRHookAddr,int nMyFunctionAddr)
{
	MemoryWritable();
	
	int nJmpAddr=nMyFunctionAddr-nRHookAddr-5;
	
	__asm
	{
		mov eax,nRHookAddr
		mov byte ptr ds:[eax],0xe9
		mov ebx,nJmpAddr
		mov dword ptr ds:[eax+1],ebx
	}
	
	MemoryNotWritable();
}

void UnInLineHookEngine(int nRHookAddr,char *szMacCode,int nLeng)
{
	MemoryWritable();
	
	RtlMoveMemory((char*)nRHookAddr,szMacCode,nLeng);
	
	MemoryNotWritable();
}
2013-7-27 09:59
0
雪    币: 34
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
9
代码里有对dr寄存器的操作,但是看起来没有改变这些寄存器的值,
.text:0100498D 50                                      push    eax
.text:0100498E 0F 21 C0                                mov     eax, dr0
.text:01004991 89 45 E4                                mov     [ebp-1Ch], eax
.text:01004994 0F 21 C8                                mov     eax, dr1
.text:01004997 89 45 E0                                mov     [ebp-20h], eax
.text:0100499A 0F 21 D0                                mov     eax, dr2
.text:0100499D 89 45 DC                                mov     [ebp-24h], eax
.text:010049A0 0F 21 D8                                mov     eax, dr3
.text:010049A3 89 45 D8                                mov     [ebp-28h], eax
.text:010049A6 0F 21 F0                                mov     eax, dr6
.text:010049A9 89 45 D4                                mov     [ebp-2Ch], eax
.text:010049AC 0F 21 F8                                mov     eax, dr7
.text:010049AF 89 45 D0                                mov     [ebp-30h], eax
.text:010049B2 58                                      pop     eax

在影响EIP的指令旁边是不能下硬断的,楼主确认下是不是所有地方都不能下硬断,还是下在了影响EIP指令的旁边?
2013-7-27 12:05
0
雪    币: 167
活跃值: (190)
能力值: ( LV5,RANK:60 )
在线值:
发帖
回帖
粉丝
10
不是TP模块内  都能下断
2013-7-27 12:12
0
雪    币: 167
活跃值: (190)
能力值: ( LV5,RANK:60 )
在线值:
发帖
回帖
粉丝
11
不信你试试
2013-7-27 12:14
0
雪    币: 34
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
12
kd> bl
0 e 804d773c w 4 0001 (0001) nt!_imp__KdReceivePacket
1 e 804d774c w 4 0001 (0001) nt!_imp__KdSendPacket
2 e 805bfd9c w 4 0001 (0001) nt!NtOpenProcess+0x224
3 e 805c0020 w 4 0001 (0001) nt!NtOpenThread+0x21c
我用上面的断点试了,的确是命中硬断点的时候就蓝了,这是我的dump分析:
kd> !analyze -v
*******************************************************************************
*                                                                             *
*                        Bugcheck Analysis                                    *
*                                                                             *
*******************************************************************************

SYSTEM_THREAD_EXCEPTION_NOT_HANDLED_M (1000007e)
This is a very common bugcheck.  Usually the exception address pinpoints
the driver/function that caused the problem.  Always note this address
as well as the link date of the driver/image that contains this address.
Some common problems are exception code 0x80000003.  This means a hard
coded breakpoint or assertion was hit, but this system was booted
/NODEBUG.  This is not supposed to happen as developers should never have
hardcoded breakpoints in retail code, but ...
If this happens, make sure a debugger gets connected, and the
system is booted /DEBUG.  This will let us see why this breakpoint is
happening.
Arguments:
Arg1: 80000004, The exception code that was not handled
Arg2: b11dad78, The address that the exception occurred at
Arg3: bacffb08, Exception Record Address
Arg4: bacff804, Context Record Address

Debugging Details:
------------------

EXCEPTION_CODE: (NTSTATUS) 0x80000004 (2147483652) - {

FAULTING_IP:
TesSafe+8d78
b11dad78 0f20c0          mov     eax,cr0

EXCEPTION_RECORD:  bacffb08 -- (.exr 0xffffffffbacffb08)
ExceptionAddress: b11dad78 (TesSafe+0x00008d78)
   ExceptionCode: 80000004 (Single step exception)
  ExceptionFlags: 00000000
NumberParameters: 0

CONTEXT:  bacff804 -- (.cxr 0xffffffffbacff804)
eax=8000003b ebx=b11d460e ecx=804d773c edx=00000006 esi=bada8f4c edi=b11d461e
eip=b11dad78 esp=bacffbd0 ebp=bacffbdc iopl=0         nv up di ng nz na po nc
cs=0008  ss=0010  ds=0023  es=0023  fs=0030  gs=0000             efl=00000082
TesSafe+0x8d78:
b11dad78 0f20c0          mov     eax,cr0
Resetting default scope

CUSTOMER_CRASH_COUNT:  2

DEFAULT_BUCKET_ID:  DRIVER_FAULT

BUGCHECK_STR:  0x7E

PROCESS_NAME:  System

ERROR_CODE: (NTSTATUS) 0x80000004 - {

LAST_CONTROL_TRANSFER:  from b11db114 to b11dad78

STACK_TEXT:  
WARNING: Stack unwind information not available. Following frames may be wrong.
bacffbdc b11db114 804d7000 bada91b2 b11d460e TesSafe+0x8d78
bacffc50 b13022a0 89ae17e0 e26c12c0 00000000 TesSafe+0x9114
bacffc7c 80575550 89ae17e0 89999000 00000000 TesSafe+0x1302a0
bacffd4c 8057565f 00000a20 00000001 00000000 nt!IopLoadDriver+0x66c
bacffd74 80533dd0 00000a20 00000000 89c328b8 nt!IopLoadUnloadDriver+0x45
bacffdac 805c4a28 b1de8cf4 00000000 00000000 nt!ExpWorkerThread+0x100
bacffddc 80540fa2 80533cd0 00000001 00000000 nt!PspSystemThreadStartup+0x34
00000000 00000000 00000000 00000000 00000000 nt!KiThreadStartup+0x16

FOLLOWUP_IP:
TesSafe+8d78
b11dad78 0f20c0          mov     eax,cr0

SYMBOL_STACK_INDEX:  0

SYMBOL_NAME:  TesSafe+8d78

FOLLOWUP_NAME:  MachineOwner

MODULE_NAME: TesSafe

IMAGE_NAME:  TesSafe.sys

DEBUG_FLR_IMAGE_TIMESTAMP:  519330d0

STACK_COMMAND:  .cxr 0xffffffffbacff804 ; kb

FAILURE_BUCKET_ID:  0x7E_TesSafe+8d78

BUCKET_ID:  0x7E_TesSafe+8d78

Followup: MachineOwner
---------
从IDA中找到代码:
lkd> .formats B11DAD78-B11D2000
Evaluate expression:
  Hex:     00008d78
从IDA里找代码
.text:01008D56                         loc_1008D56:                            ; CODE XREF: sub_1008C96+95j
.text:01008D56 8B 31                                   mov     esi, [ecx]
.text:01008D58 3B 75 14                                cmp     esi, [ebp+arg_C]
.text:01008D5B 75 29                                   jnz     short loc_1008D86
.text:01008D5D 89 0D F8 04 04 01                       mov     dword_10404F8, ecx
.text:01008D63 8B 01                                   mov     eax, [ecx]
.text:01008D65 A3 FC 04 04 01                          mov     dword_10404FC, eax
.text:01008D6A FA                                      cli
.text:01008D6B 0F 20 C0                                mov     eax, cr0
.text:01008D6E 25 FF FF FE FF                          and     eax, 0FFFEFFFFh
.text:01008D73 0F 22 C0                                mov     cr0, eax
.text:01008D76 89 39                                   mov     [ecx], edi 这句会导致重启!
.text:01008D78 0F 20 C0                                mov     eax, cr0
.text:01008D7B 0D 00 00 01 00                          or      eax, 10000h
.text:01008D80 0F 22 C0                                mov     cr0, eax
.text:01008D83 FB                                      sti
.text:01008D84 B0 01                                   mov     al, 1
看一下寄存器
kd> r
eax=8000003b ebx=b11d460e ecx=804d773c edx=00000006 esi=bada8f4c edi=b11d461e
eip=b11dad78 esp=bacffbd0 ebp=bacffbdc iopl=0         nv up di ng nz na po nc
cs=0008  ss=0010  ds=0023  es=0023  fs=0030  gs=0000             efl=00000082
TesSafe+0x8d78:
b11dad78 0f20c0          mov     eax,cr0

可以看到,的确是向ecx=804d773c写东西的时候,命中了我下的硬上断点
0 e 804d773c w 4 0001 (0001) nt!_imp__KdReceivePacket

这么看来,的确做了比较高级的检测,硬断点下了会出问题。
我先根据!analyze -v给出的提示:
SYSTEM_THREAD_EXCEPTION_NOT_HANDLED_M (1000007e)
This is a very common bugcheck.  Usually the exception address pinpoints
the driver/function that caused the problem.  Always note this address
as well as the link date of the driver/image that contains this address.
Some common problems are exception code 0x80000003.  This means a hard
coded breakpoint or assertion was hit, but this system was booted
/NODEBUG.  This is not supposed to happen as developers should never have
hardcoded breakpoints in retail code, but ...
If this happens, make sure a debugger gets connected, and the
system is booted /DEBUG.  This will let us see why this breakpoint is
happening.
先查下资料,这个exception是什么问题。
2013-7-27 12:36
0
雪    币: 15
活跃值: (40)
能力值: ( LV3,RANK:30 )
在线值:
发帖
回帖
粉丝
13
在装WDK。。。。回一下你的帖子。

我看了看你的代码。你处理了kedebuggerenabled,你没有处理kidebugroutine是吧?
某P会在kedebuggerenabled这个函数之后,将kidebugroutine的值改为KdpStub,如果不处理的话,你下硬断还能断到调试器??

刚重装了电脑,还没仔细看。只是看到楼上恢复的分析里面说当前windows是以nodebug启动的。才想到这一点。一会构建起来了我试试。
2013-7-27 15:15
0
雪    币: 167
活跃值: (190)
能力值: ( LV5,RANK:60 )
在线值:
发帖
回帖
粉丝
14
被动断额,主动break不行,硬件断点不在tp内也能断,在tp内就重启
2013-7-27 17:13
0
雪    币: 118
活跃值: (27)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
15
LZ童鞋木有明白上午我的解释.

某P现在的crc不是以前那种全部扫的.改成类似vmp那种调用扫的
现情况是check drx反你找它crc. crc又查你有没anti它check drx

这样的情况下.不能跑脚本的内核调试器就无解了
比较容易解决的方式

1.是先用一个无代码修改hook干掉check drx.然后把查 check drx的crc处理掉.
(如果打算用drx来无代码hook的话.又可能和调试器工具冲突~哈.这就是逼你自己写内核调试器嘛~)
2.是直接真机用vt内核调试器把crc抓完.
2013-7-27 19:36
0
雪    币: 167
活跃值: (190)
能力值: ( LV5,RANK:60 )
在线值:
发帖
回帖
粉丝
16
我真的黔驴技穷了,方法2系统不支持,只能走方法1了
2013-7-27 20:09
0
雪    币: 5
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
17
请问大哥你的虚拟机与windbg是怎样设置的?我在网上看了很多关于DxF驱动双机调试设置的文章和方法都不行,这是咋回事。
2014-3-15 22:57
0
游客
登录 | 注册 方可回帖
返回
//