mov eax,dword ptr fs:[0] 指令

FS寄存器指向当前活动线程的TEB结构(线程结构)

 

偏移 说明
000 指向SEH链指针
004 线程堆栈顶部
008 线程堆栈底部
00C SubSystemTib
010 FiberData
014 ArbitraryUserPointer
018 FS段寄存器在内存中的镜像地址
020 进程PID
024 线程ID
02C 指向线程局部存储指针
030 PEB结构地址(进程结构)
034 上个错误号




得到KERNEL32.DLL基址的方法
assume fs:nothing             ;打开FS寄存器
mov eax,fs:[30h]            ;得到PEB结构地址
mov eax,[eax + 0ch]        ;得到PEB_LDR_DATA结构地址
mov esi,[eax + 1ch]        ;InInitializationOrderModuleList
lodsd                      ;得到KERNEL32.DLL所在LDR_MODULE结构的InInitializationOrderModuleList地址
mov edx,[eax + 8h]         ;得到BaseAddress,既Kernel32.dll基址

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
SEH异常的应用 SEH异常就是结构化异常处理,程序遇到SEH异常时,异常交给系统处理(这讲是一个非常负责的过程,很容易跟飞),所以利用SEH异常时可以一定程度的防止程度调试(SEH异常在壳里是很常见的)。 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ push ******** //地址压入堆栈 mov eax,dword ptr fs:[0] push eax //fs[0]压入堆栈,执行完成后fs[0]指向堆栈 mov dword ptr fs:[0],esp //构造一个ERR结构 mov esi,0 //简单的赋值语句 mov eax,dword ptr ds:[esi] //产生异常 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ push ******** mov eax,dword ptr fs:[0] push eax mov dword ptr fs:[0],esp mov ebx,0 div ebx ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nop push ******** mov eax,dword ptr fs:[0] push eax mov dword ptr fs:[0],esp int 3 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ push ******** mov eax,dword ptr fs:[0] push eax mov dword ptr fs:[0],esp nop int 68 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ push ******** mov eax,dword ptr fs:[0] push eax mov dword ptr fs:[0],esp nop vxdcall 134543 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ push ******** mov eax,dword ptr fs:[0] push eax mov dword ptr fs:[0],esp ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ push xxx push dword ptr fs:[0] mov fs:[0], esp stc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ push xxx push dword ptr fs:[0] mov fs:[0], esp JMP 0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ push xxx push dword ptr fs:[0] mov fs:[0], esp ret ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ push xxx push dword ptr fs:[0] mov fs:[0], esp pop ss

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值