当前位置: 首页 > news >正文

做固定背景网站免费发布信息网平台

做固定背景网站,免费发布信息网平台,兴国建设局网站,seo快速排名上首页突然看到了一种反调试的手段#xff0c;检测api函数的首字节是否为0xcc#xff0c;即int 3类型的断点#xff0c;来反调试#xff0c;尝试一下 #includestdio.h #includestdlib.h void fun(int a) {a;a--;a 5;a - 5;return; } int main() {void (*ptr)(i…突然看到了一种反调试的手段检测api函数的首字节是否为0xcc即int 3类型的断点来反调试尝试一下 #includestdio.h #includestdlib.h void fun(int a) {a;a--;a 5;a - 5;return; } int main() {void (*ptr)(int) NULL;ptr fun;int i 0; char *arr(char*)(ptr);for (i 0; i 99; i) {printf(0x%2x\t, arr[i]);}return 0; } 最开始的时候就遇到了一个问题我用的virtual studio 但是这是c编译的导致最后的函数指针不是指向的fun函数这里可以很清楚的看到。 额不太清楚编译的原理那我用纯c直接用devc里面有自带的gcc编译器 然后就和我预想的一样了fun就是那个函数指针在fun里多打一点断点有个问题为什么fun函数编译出来会有个nop不是很懂 执行结果上面就有预期的0xCC了可见ida确实是用的int 3断点 这种方法很简单也很容易绕过我们来看一下硬件断点硬件断点基于DRx寄存器换句话说可以通过检测DRx寄存器来检测硬件断点 可以通过SetThreadContext直接设置指定线程的调试寄存器 DRx寄存器可以直接操作但是需要设置特权级CPL等于0这里采用比较简单的方法直接用GetThreadContext获取当前线程的上下文 我一共下了3个硬件断点执行结果如下 可见确实用DRx寄存器来设置了硬件断点而该程序正常执行情况没有断点如下 #includestdio.h #includestdlib.h #includeWindows.h const char *strr (const char*)hello touful; int main() { printf(enter\n);//获取当前线程的句柄HANDLE hThread GetCurrentThread();//创建一个CONTEXT结构体CONTEXT threadContext;threadContext.ContextFlags CONTEXT_ALL;//获取当前线程的运行上下文if (!GetThreadContext(hThread, threadContext)){printf(GetThreadContext failed\n);return 0;}printf(DRO 0x%x\n, threadContext.Dr0);printf(DR1 0x%x\n, threadContext.Dr1);printf(DR2 0x%x\n, threadContext.Dr2);printf(DR3 0x%x\n, threadContext.Dr3);printf(exit\n);return 0; } 这里顺便贴出CONTEXT结构体的定义 typedef struct DECLSPEC_NOINITALL _CONTEXT {//// The flags values within this flag control the contents of// a CONTEXT record.//// If the context record is used as an input parameter, then// for each portion of the context record controlled by a flag// whose value is set, it is assumed that that portion of the// context record contains valid context. If the context record// is being used to modify a threads context, then only that// portion of the threads context will be modified.//// If the context record is used as an IN OUT parameter to capture// the context of a thread, then only those portions of the threads// context corresponding to set flags will be returned.//// The context record is never used as an OUT only parameter.//DWORD ContextFlags;//// This section is specified/returned if CONTEXT_DEBUG_REGISTERS is// set in ContextFlags. Note that CONTEXT_DEBUG_REGISTERS is NOT// included in CONTEXT_FULL.//DWORD Dr0;DWORD Dr1;DWORD Dr2;DWORD Dr3;DWORD Dr6;DWORD Dr7;//// This section is specified/returned if the// ContextFlags word contians the flag CONTEXT_FLOATING_POINT.//FLOATING_SAVE_AREA FloatSave;//// This section is specified/returned if the// ContextFlags word contians the flag CONTEXT_SEGMENTS.//DWORD SegGs;DWORD SegFs;DWORD SegEs;DWORD SegDs;//// This section is specified/returned if the// ContextFlags word contians the flag CONTEXT_INTEGER.//DWORD Edi;DWORD Esi;DWORD Ebx;DWORD Edx;DWORD Ecx;DWORD Eax;//// This section is specified/returned if the// ContextFlags word contians the flag CONTEXT_CONTROL.//DWORD Ebp;DWORD Eip;DWORD SegCs; // MUST BE SANITIZEDDWORD EFlags; // MUST BE SANITIZEDDWORD Esp;DWORD SegSs;//// This section is specified/returned if the ContextFlags word// contains the flag CONTEXT_EXTENDED_REGISTERS.// The format and contexts are processor specific//BYTE ExtendedRegisters[MAXIMUM_SUPPORTED_EXTENSION];} CONTEXT; 对于内存断点是以页的方式添加的设置页的权限位就行了最常用的两种断点实现了最常用的检测方式
http://www.yutouwan.com/news/117038/

相关文章:

  • 高端设计网站建设德清网站建设
  • wordpress网站模板下载失败如何做新闻自动采集网站
  • 莱芜泉网站建设谁告诉你j2ee是做网站的
  • 安全电子商务网站设计开发软件大全
  • 面包店网站建设规划书怎么免费建立自己网站
  • 做自己网站彩票安徽建站
  • 网站制作教程西安百度百科
  • 手机自助建站永久免费厦门php网站建设
  • 电子商务网站建设 填空题郑州建网站企业
  • 英文网站建设中百度浏览器入口
  • 兰州交通发展建设集团公司网站建设摩托车官网报价及图片
  • 做网站题材同步修改 wordpress
  • 公司网站转微信小程序做电商网站用什么语言
  • 瑞安网站四川省建设厅
  • 南京新标特企业网站哪家广告做的wordpress标签后缀名html
  • 网站毕业设计代做公司管理系统是系统软件吗
  • 查找做影评的工作网站淮北市建筑
  • 运输网站建设网店美工设计实训步骤
  • 自己建设网站赚钱网站推广成功案例
  • 海城区建设局网站一个微信小程序要多少钱
  • 秦皇岛网站设计制作石家庄369招聘信息网
  • 怎么用lls做网站导航网站 php
  • 万江区网站建设在北京注册公司有什么好处
  • 网站建站方式有哪些app开发做网站
  • 做网站去哪里找客户广安市城乡建设规划局网站
  • 网站视频制作五河网站建设哪家好
  • 什么主题的网站容易做点备案网站的黑名单
  • 阿里云网站备案入口湖北省建设信息港网站
  • 建设银行镇海支行网站奉贤注册公司
  • 网站建设服务哪家好 价格多少钱天津大型网站建设风格