⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 alignment.c

📁 一个类似与Windows环境下的softice的源代码
💻 C
字号:
/****************************************************************************** * * Copyright (c) 2003 Gerhard W. Gruber * * PROJECT: pICE * $Source: /cvsroot/pice/pice/module/alignment.c,v $ * $Revision: 1.3 $ * $Date: 2004/02/17 23:07:36 $ * $Author: lightweave $ * $Name:  $ * * $Log: alignment.c,v $ * Revision 1.3  2004/02/17 23:07:36  lightweave * * Improved the DEBUG facillity and replaced the configuration handler with a * new code which now can read MS Windows INI style files. See CHANGES.txt for * more details. * Also added a macro which prevents compiling for kernels before 2.4.19. * * Revision 1.2  2003/06/18 22:00:21  lightweave * DEBUG and DEBUG_SERIAL added * * *****************************************************************************/static char *ident = "$Header: /cvsroot/pice/pice/module/alignment.c,v 1.3 2004/02/17 23:07:36 lightweave Exp $";/*++Copyright (c) 1998-2001 Klaus P. GerlicherModule Name:    alignment.cAbstract:Environment:    Kernel mode onlyAuthor:    Klaus P. GerlicherRevision History:    14-Oct-2001:	createdCopyright notice:  This file may be distributed under the terms of the GNU Public License.--*/////////////////////////////////////////////////////// INCLUDES////#include "remods.h"#include "precomp.h"////////////////////////////////////////////////////// DEFINES////#define ALIGNMENT_VECTOR (0x11)////////////////////////////////////////////////////// GLOBALS////ULONG ulOldAlignmentHandler=0;ULONG ulCountUnaligned = 0;//************************************************************************* // HandleAlignmentFault() // //************************************************************************* void HandleAlignmentFault(EXCEPTION_FRAME* pFrame){	ulCountUnaligned++;}//************************************************************************* // InstallAlignmentHook() // //************************************************************************* BOOLEAN InstallAlignmentHook(void){#ifdef ACTIVATE_ALIGNMENT_HOOK   void DebuggerAlignment(void);   DPRINT(PICE_DEBUG, DBT_ALIGNMENT, DBL_INFO, "InstallAlignmentHook(ulOldAlignmentHandler=%08x)...\n", ulOldAlignmentHandler);   if(!ulOldAlignmentHandler)   {      HookInterruptVector(ALIGNMENT_VECTOR,(PVOID)&DebuggerAlignment,(PVOID)&ulOldAlignmentHandler);   }#endif // ACTIVATE_BREAKPOINT_HOOK   return TRUE;}//************************************************************************* // DeInstallAlignmentHook() // //************************************************************************* void DeInstallAlignmentHook(void){#ifdef ACTIVATE_BREAKPOINT_HOOK   DPRINT(PICE_DEBUG, DBT_ALIGNMENT, DBL_INFO, "DeInstallTraceHook(ulOldAlignmentHandler=%08x)...\n",ulOldAlignmentHandler);   if(ulOldAlignmentHandler)   {      HookInterruptVector(ALIGNMENT_VECTOR,(PVOID)&ulOldAlignmentHandler,NULL);   }#endif // ACTIVATE_BREAKPOINT_HOOK}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -