首页
社区
课程
招聘
[求助]请教RtlCopyMemory,RtlFillMemory,RtlZeroMemory这几个函数最终是调用哪个函数的呢?
发表于: 2008-12-29 20:11 12940

[求助]请教RtlCopyMemory,RtlFillMemory,RtlZeroMemory这几个函数最终是调用哪个函数的呢?

2008-12-29 20:11
12940
请教下咯,这拷贝内存的函数最终调用系统的哪些函数哦?我看了DDK的定义就是memcpy,memset,这些,这不是DLL里的函数吗?

有点搞不明白了,请知道的人能指点下嘛,他最后是调用系统的哪个函数的哦!

[课程]FART 脱壳王!加量不加价!FART作者讲授!

收藏
免费 0
支持
分享
最新回复 (17)
雪    币: 364
活跃值: (152)
能力值: ( LV12,RANK:450 )
在线值:
发帖
回帖
粉丝
2
貌似是rep xx指令直接能实现的。没去看汇编,yy而已
2008-12-29 20:29
0
雪    币: 635
活跃值: (101)
能力值: ( LV12,RANK:420 )
在线值:
发帖
回帖
粉丝
3
一般会编译为汇编代码来做内存操作~
2008-12-29 21:08
0
雪    币: 129
活跃值: (31)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
4
晕,那就没办法了,那请问,能有什么办法对一断内存地址保护起来不给写吗?

本来我以为拷贝内存还会调用什么函数来实现,我以为HOOK那个函数就行了,来判断是否操作一个受保护的物理地址,现在看来不行了,

请大大指点指点,怎么可以保护一段物理地址不给读写..... 崩溃~
2008-12-29 22:09
0
雪    币: 635
活跃值: (101)
能力值: ( LV12,RANK:420 )
在线值:
发帖
回帖
粉丝
5
将页属性改了,然后HOOK INT 0E
或者设DRX
2008-12-29 22:15
0
雪    币: 129
活跃值: (31)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
6
这个行不通,因为我想某个进程不给写.其他可写..
2008-12-29 23:24
0
雪    币: 635
活跃值: (101)
能力值: ( LV12,RANK:420 )
在线值:
发帖
回帖
粉丝
7
在hook处判断current process即可~
2008-12-30 13:10
0
雪    币: 129
活跃值: (31)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
8
楼上的,谢谢哈,我不是很明白怎么HOOK,能否给点详细的例子呢?
不他明白调试寄 存器怎么设!
2008-12-30 15:54
0
雪    币: 44
活跃值: (133)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
9
直接汇编实现的
2008-12-30 16:42
0
雪    币: 129
活跃值: (31)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
10
汇编实现的呀?C++的汇编能写到指定的一段地址上吗?
_asm
{
     push eax
}
这样一段汇编好象不能写到指定的地址上吧?
只能在一个函数里写,这段汇编就写在函数指针下面了.
比如想把这段汇编写在80123456,好象不行吧?
2008-12-30 16:44
0
雪    币: 44
活跃值: (133)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
11
RtlCopyMemory一般是通过rep movs dword ptr es:[edi],dword ptr [esi]实现的,ecx作为计数器,一次传送4个字节,最后0-3个字节,每次传送一个字节
2008-12-30 16:56
0
雪    币: 129
活跃值: (31)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
12
谢谢楼上,明白RrlCopyMemory原来是汇编实现的..真苦恼!

只能通过寄存器来知道了
2008-12-30 17:23
0
雪    币: 315
活跃值: (23)
能力值: ( LV9,RANK:220 )
在线值:
发帖
回帖
粉丝
13
RrlCopyMemory, RtlZeroMemory等再cl编译器中,因为编译器默认为了效率所以采用了自己的一些静态库函数来做了代替。例如RtlZeroMemory通过memset来做了代替。

但是这些函数再ntoskrnl(ring3 ntdll)都有导出,你也可以通过动态获得这些函数地址来调用。
2008-12-31 15:06
0
雪    币: 635
活跃值: (101)
能力值: ( LV12,RANK:420 )
在线值:
发帖
回帖
粉丝
14
楼上说的完全不对

1.使用memset替代RtlZeroMemory 的是DDK的宏,本身ntoskrnl没有导出RtlZeroMemory这样一个函数,这件事和编译器没关系

2.这些函数会被直接编译为汇编实现的代码,在ntoskrnl里也不提供这些函数的导出
2008-12-31 15:22
0
雪    币: 129
活跃值: (31)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
15
是的ntoskrnl里没有这些函数~
2008-12-31 17:45
0
雪    币: 243
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
16
将页属性改了,然后HOOK INT 0E
或者设DRX

页属性,别人可以改回来的啊!!!HOOK INT OE 怎么实现??(提点原理就行。。真能保护住??)
2009-5-18 19:10
0
雪    币: 129
活跃值: (31)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
17
int hook坛子里有,这个帖子很老了,当时q说的我也不会没去做,但现在来想想,他的意思把内存保护页改了不可写以后,钩了0e号中断,这个中断号不太清楚是干什么用的,可能是来处理内存页属性修改会中断的吧,我也不太清楚猜测而已,当时Q说在0e号中断判断下Cur Pro,可能就是这样了,你可以查下中断号0E的作用.
2009-5-18 20:45
0
雪    币: 221
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
18
Interrupt 14—Page-Fault Exception (#PF)
Exception Class Fault.
Description
Indicates that, with paging enabled (the PG flag in the CR0 register is set), the
processor detected one of the following conditions while using the page-translation
mechanism to translate a linear address to a physical address:
• The P (present) flag in a page-directory or page-table entry needed for the
address translation is clear, indicating that a page table or the page containing
the operand is not present in physical memory.
• The procedure does not have sufficient privilege to access the indicated page
(that is, a procedure running in user mode attempts to access a supervisor-mode
page).
• Code running in user mode attempts to write to a read-only page. In the Intel486
and later processors, if the WP flag is set in CR0, the page fault will also be
triggered by code running in supervisor mode that tries to write to a read-only
user-mode page.
• An instruction fetch to a linear address that translates to a physical address in a
memory page with the execute-disable bit set (for Intel 64 and IA-32 processors
that support the execute disable bit, see Section 3.10, “PAE-Enabled Paging in
IA-32e Mode”).
• One or more reserved bits in page directory entry are set to 1. See description
below of RSVD error code flag.
The exception handler can recover from page-not-present conditions and restart the
program or task without any loss of program continuity. It can also restart the
program or task after a privilege violation, but the problem that caused the privilege
violation may be uncorrectable.
2009-5-18 21:11
0
游客
登录 | 注册 方可回帖
返回
//