comment~
Windows NT/2000/XP/Server 2003 获取Ring0的便捷工具
程序创建了几个段:
IDT,GDT,SSDT,Linear
为创建Ring3,Ring0之间的互交便捷
可以直接用Int nnH,call faraddress等等方法进入Ring0,像Windows 98一样方便!
本程序在Windows XP SP2中测试。
使用Windows 2000调试ASM请加入:
IFNDEF _W2K_
_W2K_ equ 1
ENDIF
使用Windows XP调试ASM请加入:
IFNDEF _WXP_
_WXP_ equ 1
ENDIF
使用Windows Server 2003调试ASM请加入:
IFNDEF _W2003_
_W2003_ equ 1
ENDIF
编译环境:MASMPlus 1.0
有什么问题联系我:frankvista@126.com
~
;程序开始了!
.686
.model flat,stdcall
option casemap:none
;一些库文件
IFNDEF _WXP_
_WXP_ equ 1
ENDIF
include w2k\ntstatus.inc
include w2k\ntddk.inc
include w2k\ntoskrnl.inc
IFDEF _W2K_
include w2kundoc.inc
ENDIF
IFDEF _WXP_
include wxpundoc.inc
ENDIF
IFDEF _W2003_
include wnetundoc.inc
ENDIF
includelib ntoskrnl.lib
include Strings.mac
KGDTREG STRUC
Limit WORD ?
Base DWORD ?
KGDTREG ENDS
KIDTREG STRUC
Limit WORD ?
Base DWORD ?
KIDTREG ENDS
.data?
;数据段开始
GDTR KGDTREG <?,?>
IDTR KIDTREG <?,?>
pGDT DWORD ?
PGDTR DWORD ?
;代码段开始
.code
;保留
.code Init
main proc pDrvObj,pRegPath ;我为什么要DriverEntry proc pDriverObject:PDRIVER_OBJECT,pusRegistryPath:PUNICODE_STRING呢?以后不注释了!
local segIDT:KGDTENTRY,segGDT:KGDTENTRY,segSSDT:KGDTENTRY,segLinear:KGDTENTRY
;开始
push edi
sgdt GDTR
mov edi,GDTR.Base
mov pGDT,edi
sidt IDTR
movzx eax,GDTR.Limit
lea eax,[sizeof KGDTENTRY+eax*sizeof KGDTENTRY]
add eax,edi
pop edi
assume eax:ptr KGDTENTRY
mov [eax].LimitLow,0FFFFH
mov edx,IDTR.Base
mov [eax].BaseLow,dx
shr edx,16
mov [eax]._HighWord.Bytes.BaseMid,dl
shr dx,8
mov [eax]._HighWord.Bytes.BaseHi,dl
mov edx,[eax]._HighWord.Bits
or edx,mask u15Granularity
or edx,mask u15Default_Big
and edx,not mask u15Reserved_0
and edx,not mask u15Sys
or edx,mask u15LimitHi
or edx,mask u15Pres
or edx,mask u15Dpl
or edx,mask u15Type
mov [eax]._HighWord.Bits,edx
inc GDTR.Limit
mov PGDTR,offset GDTR
lgdt PGDTR ;lgdt GDTR也有相同错误
mov eax, STATUS_DEVICE_CONFIGURATION_ERROR
ret
;结束
main endp
end main
E:\MASMPlus\Project\Console\Driver.asm(99) : error A2085: instruction or register not accepted in current CPU mode
[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)