首页
社区
课程
招聘
[旧帖] 如何win32asm 下调用 RtlInitUnicodeString 0.00雪花
发表于: 2010-8-12 17:32 3531

[旧帖] 如何win32asm 下调用 RtlInitUnicodeString 0.00雪花

2010-8-12 17:32
3531
使用环境是在masm下

仅仅是使用下面的语句 似乎不能调用 RtlInitUnicodeString
include ntoskrnl.inc
includelib  ntoskrnl.lib

编译没问题  ntoskrnl.inc 中确实有 RtlInitUnicodeString  函数的申明
但是运行的时候  就报  找不到  ntoskrnl.dll  
确实是没有 ntoskrnl.dll   系统中只存在  ntoskrnl.exe   ...

初学 不知道该如何解决 ////

麻烦知道的大侠  提供下 调用源码 谢谢 :)

[课程]Linux pwn 探索篇!

收藏
免费 0
支持
分享
最新回复 (2)
雪    币: 16
活跃值: (11)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
2
找了一个这个方法
从ntdll.dll导出该函数 ...
奇怪  既然 ntdll都有了  为啥在 ntoskrnl.inc 中申明

.386
.model flat, stdcall
option casemap:none

include ..\Macro\strings.mac

include  windows.inc
include  kernel32.inc
includelib kernel32.lib
;======================================


UNICODE_STRINGC STRUCT
	_Length 			word ?
	MaximumLength 	word ?
	Buffer 			dword ?
UNICODE_STRINGC ENDS


_RtlInitUnicodeString  typedef proto :dword,:dword
lpRtlInitUnicodeString  typedef ptr _RtlInitUnicodeString

.const
dllname    db 'ntdll.dll',0
szRtlInitUnicodeString  db 'RtlInitUnicodeString',0

.data?
hdll dd ?
RtlInitUnicodeString  lpRtlInitUnicodeString  ?
SectionName UNICODE_STRING <?>


.code
start:

	invoke LoadLibrary, addr dllname
	mov hdll,eax
	
	invoke GetProcAddress, hdll, addr szRtlInitUnicodeString
	mov RtlInitUnicodeString,eax
	
	invoke  RtlInitUnicodeString, addr  SectionName, $CTW0("\\Devices\\PhysicalMemory")
	
end start


2010-8-12 18:01
0
雪    币: 452
活跃值: (72)
能力值: ( LV9,RANK:330 )
在线值:
发帖
回帖
粉丝
3
ntoskernel is in R0 mode
ntdll is r3
r3 code cannot call r0 code directly
2010-8-12 20:50
0
游客
登录 | 注册 方可回帖
返回
//