首页
社区
课程
招聘
[求助]读一份驱动代码,有2处不明白,请大侠救助
发表于: 2008-4-3 19:19 4675

[求助]读一份驱动代码,有2处不明白,请大侠救助

2008-4-3 19:19
4675
★代码如下:

mov eax,CR0      
and eax,not 0x10000  //eax的第29位清零,该位是无意义的,正常就应该为零
mov CR0,eax

该代码目的是什么?

★代码有如下宏定义,宏定义中的“##”符号是什么意思

#define MemCheckAndHandle(nr,type,varsize,value) if ( /*it's faster to do this in a seperate code segment for each type, but lets try this first (less code)*/ \
        ((CurrentScan.Scantype==ST_Exact_value) && (*(##type)mempointer==value)) ||\
        ((CurrentScan.Scantype==ST_SmallerThan) && (*(##type)mempointer<value)) ||\
        ((CurrentScan.Scantype==ST_BiggerThan) && (*(##type)mempointer>value))\
        )\
        {\
                /*found one*/ \
                DbgPrint("Found one!!!\n");\
                AddressList[found]=(ULONG)mempointer;\
                ValueList##nr[found]=*(##type)mempointer;\
                found++;\
                if (found==AddressListSize)\
                {\
                        DbgPrint("Writing tempfile\n");\
                        \
                        /*write the addresses and values to disk*/ \
                        CETC_Write(addressfile,AddressList,found*4,&iosb);\
                        CETC_Write(valuefile,ValueList##nr,found*varsize,&iosb);\
\
                        foundsaved+=found;\
                        found=0;\
                }\
        }


[培训]《安卓高级研修班(网课)》月薪三万计划,掌握调试、分析还原ollvm、vmp的方法,定制art虚拟机自动化脱壳的方法

收藏
免费 0
支持
分享
最新回复 (5)
雪    币: 2134
活跃值: (14)
能力值: (RANK:170 )
在线值:
发帖
回帖
粉丝
2
1 启用内存保护机制
2 看这里:http://www.akae.cn/space/html/41/t-41.html
和http://www.pass100.net/jisuanji/dengji/erji/112210.html
2008-4-3 19:47
0
雪    币: 207
活跃值: (10)
能力值: ( LV4,RANK:50 )
在线值:
发帖
回帖
粉丝
3
操作符##把两个标记拼在一起。例如:define ss(a,b)   a ## b
ss(x,y)预处理后成为 ab。
2008-4-3 20:36
0
雪    币: 454
活跃值: (1673)
能力值: ( LV3,RANK:30 )
在线值:
发帖
回帖
粉丝
4
1、目的是清除CR0的第16位WP位,WP位在Intel手册3A卷2.5节中有描述
WP Write Protect (bit 16 of CR0) — Inhibits supervisor-level procedures from
writing into user-level read-only pages when set; allows supervisor-level
procedures to write into user-level read-only pages when clear (regardless of
the U/S bit setting; see Section 3.7.6). This flag facilitates implementation of
the copy-on-write method of creating a new process (forking) used by oper-
ating systems such as UNIX.
2008-4-3 21:46
0
雪    币: 197
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
5
谢谢大家的热心帮助,谢谢
2008-4-5 01:20
0
雪    币: 211
活跃值: (321)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
6
Intel手册 ?好东西
2008-4-8 22:06
0
游客
登录 | 注册 方可回帖
返回
//