[原创]另一种进入NT内核方法的汇编版本
2008-01-09 16:12
120 查看
要说明的是该方法本身不是我的原创 ,是其他大牛首先写出来的。
而我只是将该方法的C版本 "翻译" 成 masm32 版本。: )
.386
.model flat, stdcall
option casemap:none
include c:masm32includewindows.inc
include c:masm32includeuser32.inc
include c:masm32includekernel32.inc
include c:masm32includeadvapi32.inc
includelib c:masm32libuser32.lib
includelib c:masm32libkernel32.lib
includelib c:masm32libadvapi32.lib
include c:masm32macrosucmacros.asm
UNICODE_STRING STRUCT
_Length WORD ?
MaximumLength WORD ?
Buffer DWORD ?
UNICODE_STRING ENDS
SystemLoadAndCallImage equ 38
_ZwSetSystemInformation typedef proto :dword,:dword,:dword
lpZwSetSystemInformation typedef ptr _ZwSetSystemInformation
_RtlInitUnicodeString typedef proto :dword,:dword
lpRtlInitUnicodeString typedef ptr _RtlInitUnicodeString
SYSTEM_LOAD_AND_CALL_IMAGE struct
ModuleName UNICODE_STRING <?>
SYSTEM_LOAD_AND_CALL_IMAGE ends
.const
txt db 'Just Do It!',0
cp db 'hopy|侯佩',0
WSTR drvnameW,"??c: mpDrv.sys"
drvname db '??c:tmpDrv.sys',0
dllname db 'ntdll.dll',0
szZwSetSystemInformation db 'ZwSetSystemInformation',0
szRtlInitUnicodeString db 'RtlInitUnicodeString',0
.data?
hInstance dd ?
hdll dd ?
stSysCallImage SYSTEM_LOAD_AND_CALL_IMAGE <>
ZwSetSystemInformation lpZwSetSystemInformation ?
RtlInitUnicodeString lpRtlInitUnicodeString ?
.code
start:
invoke GetModuleHandle, 0
mov hInstance,eax
invoke LoadLibrary,addr dllname
mov hdll,eax
invoke GetProcAddress,hdll,addr szZwSetSystemInformation
mov ZwSetSystemInformation,eax
invoke GetProcAddress,hdll,addr szRtlInitUnicodeString
mov RtlInitUnicodeString,eax
invoke RtlInitUnicodeString,addr stSysCallImage.ModuleName,
addr drvnameW
invoke ZwSetSystemInformation,SystemLoadAndCallImage,
addr stSysCallImage,
sizeof SYSTEM_LOAD_AND_CALL_IMAGE
invoke MessageBox,NULL,addr txt,addr cp,MB_OK
invoke ExitProcess,NULL
end start
而我只是将该方法的C版本 "翻译" 成 masm32 版本。: )
.386
.model flat, stdcall
option casemap:none
include c:masm32includewindows.inc
include c:masm32includeuser32.inc
include c:masm32includekernel32.inc
include c:masm32includeadvapi32.inc
includelib c:masm32libuser32.lib
includelib c:masm32libkernel32.lib
includelib c:masm32libadvapi32.lib
include c:masm32macrosucmacros.asm
UNICODE_STRING STRUCT
_Length WORD ?
MaximumLength WORD ?
Buffer DWORD ?
UNICODE_STRING ENDS
SystemLoadAndCallImage equ 38
_ZwSetSystemInformation typedef proto :dword,:dword,:dword
lpZwSetSystemInformation typedef ptr _ZwSetSystemInformation
_RtlInitUnicodeString typedef proto :dword,:dword
lpRtlInitUnicodeString typedef ptr _RtlInitUnicodeString
SYSTEM_LOAD_AND_CALL_IMAGE struct
ModuleName UNICODE_STRING <?>
SYSTEM_LOAD_AND_CALL_IMAGE ends
.const
txt db 'Just Do It!',0
cp db 'hopy|侯佩',0
WSTR drvnameW,"??c: mpDrv.sys"
drvname db '??c:tmpDrv.sys',0
dllname db 'ntdll.dll',0
szZwSetSystemInformation db 'ZwSetSystemInformation',0
szRtlInitUnicodeString db 'RtlInitUnicodeString',0
.data?
hInstance dd ?
hdll dd ?
stSysCallImage SYSTEM_LOAD_AND_CALL_IMAGE <>
ZwSetSystemInformation lpZwSetSystemInformation ?
RtlInitUnicodeString lpRtlInitUnicodeString ?
.code
start:
invoke GetModuleHandle, 0
mov hInstance,eax
invoke LoadLibrary,addr dllname
mov hdll,eax
invoke GetProcAddress,hdll,addr szZwSetSystemInformation
mov ZwSetSystemInformation,eax
invoke GetProcAddress,hdll,addr szRtlInitUnicodeString
mov RtlInitUnicodeString,eax
invoke RtlInitUnicodeString,addr stSysCallImage.ModuleName,
addr drvnameW
invoke ZwSetSystemInformation,SystemLoadAndCallImage,
addr stSysCallImage,
sizeof SYSTEM_LOAD_AND_CALL_IMAGE
invoke MessageBox,NULL,addr txt,addr cp,MB_OK
invoke ExitProcess,NULL
end start
相关文章推荐
- [原创]另一种进入NT内核方法的汇编版本
- [原创]另一种进入NT内核方法的汇编版本
- [原创]浅谈NT下Ring3无驱进入Ring0的方法
- ubuntu升级内核进入不了图像界面解决方法
- XP下wubi 安装的ubuntu内核升级之后无法进入系统的解决办法(初级方法 慎用!)
- Linux下查看内核、CPU、内存及各组件版本的命令和方法
- [原创]删除重复记录的另一种方法
- 【Vegas原创】解决System.Web.Extensions版本冲突方法
- 【原创】禁止快播自动升级到最新版本,自己发现的方法
- 高版本内核系统(Ubuntu12.04)下编译低版本内核(2.6.30)bug解决方法
- Ldd3 学习笔记2 — simple 2.6.10以上内核版本编译错误解决方法!!!
- [置顶] Linux下查看内核、CPU、内存及各组件版本的命令和方法
- 查看linux内核信息、发行版本信息以及系统位数的方法
- vs.net git版本仓库使用 之解决冲突方法 原创
- 软件版本比较不用ini记录的另一种方法
- 2.6内核LOGO的制作方法(深蓝原创)
- Linux下查看内核、CPU、内存及各组件版本的命令和方法
- insmod内核版本问题解决方法
- linux查看内核版本和发行版本的方法
- Ubuntu10.04升级内核无法进入系统的方法