简单的修改IDT,实现hook page_fault中断处理进程

这篇博客介绍了一个简单的技术,通过修改中断描述表(IDT)来hook page_fault中断处理,以此实现特定功能。内容提及在Centos 5.5上已通过编译测试。
摘要由CSDN通过智能技术生成

一个想法的副产物,,,

参考

http://stackoverflow.com/questions/2497919/changing-the-interrupt-descriptor-table

不多说 就上代码算了。。。

Centos 5.5 编译测试通过

#include <linux/kernel.h>
#include <linux/module.h>
#include <asm/desc.h>

typedef struct desc_struct gate_desc;

struct desc_easy {
	unsigned short a;
	unsigned short b;
	unsigned short c;
	unsigned short d;
} __attribute__((packed)) ;

struct desc_ptr {
        unsigned short size;
        unsigned long address;
} __attribute__((packed)) ;

#define PGFAULT_INT 0x0E

static unsigned long isr_orig;
static unsigned long isr_new;
static gate_desc *PF_gate;

asmlinkage void my_function(void);

void stub(void)
{
	__asm__
	(
	"		pushal 				\n"
	"		pushl %es			\n"
	"		pushl 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值