|
|
|
代码蓝屏
看过了你上面的帖子,原始的函数头为: nt!NtOpenProcess: 805727c7 68c4000000 push 0C4h 805727cc 68d8b04e80 push offset nt!ObWatchHandles+0x25c (804eb0d8) 那段内联汇编改为: __asm{ push 0C4h push 804eb0d8 jmp [JmpAddress] } 这样就解决了蓝屏的问题,但这还是硬编码 |
|
代码蓝屏
貌似你保存的10个字节的硬编码的代码有问题,压栈的两个参数肯定和你自己系统的内核上原来的不一样,想不蓝屏都难啊! 如果你的 NtOpenProcess 干净的话,你可以自己在调试器里看一下函数头。 |
|
|
|
求助。。我的CreateRemoteThread注入为什么被注入进程会崩溃呢?
你在定义函数指针时,忽略了调用类型为 __stdcall , 导致堆栈不平衡,这是崩溃的直接原因。 除此之外,还有许多细节错误,最好也一起改了。 |
|
[求助]关于GetExceptionInformation函数的调用
稍微提一下, GetExceptionInformation 是个宏,被定义为 _exception_info ,是SEH实现使用的关键字,只能用于捕获异常的过滤条件表达式中。 |
|
发布一个项目的构思,愿意做的来看看
这句是真真正正的漏底了,人肉明鉴,晒的好-_-! |
|
关于地址重定位的代码如何验证
一般情况下,程序若是正常运行,而不是被加载到其它进程空间中,程序的默认基址0x00400000是不会被任何模块使用的,故程序的基址就是默认基址,因而大多数的EXE程序是没有重定位节的,也就不存在你说的重定位问题~ 若是程序被加载到其它的基址上,还需要自验证,当然是必须拒绝执行的... |
|
|
|
|
|
还是新手问题,关于暂停法,调用堆栈的解读
堆栈中保存的是调用者的下一指令的EIP的值,也就是CALL指令之后的第一条指令,以边RET指令返回后继续执行。 MFC有消息映射机制,具体调用过程大致如下: MFC42.73D323BA 指令调用主程序的消息处理函数 堆栈中保存MFC42.73D324BD Urlegal.004026D0 主程序显示出错对话框,调用AfxMessageBox 堆栈中保存Urlegal.004025D5 接下去,AfxMessageBox就会调用MessageBoxA,出错对话框就显示出来了~ 只要搞清楚调用堆栈中的调用关系就OK! |
|
还是新手问题,关于暂停法,调用堆栈的解读
你是指调用堆栈里的每一层调用? |
|
还是新手问题,关于暂停法,调用堆栈的解读
这是一个MFC写的程序,你中断在了MessageBoxA的内部消息循环中,看以下这一行: 0012FB14 004026D5 ? <JMP.&MFC42.#1200_AfxMessageBox> Urlegal.004026D0 0012FA74 返回地址明显在主程序的代码段中,调用的是AfxMessageBox,目的是显示出错对话框。 你再从地址 004026D5 向上看,应该就能找到关键代码了~ |
|
函数指针与typedef
我前面提过,把函数指针进行转换后,唯一的区别是在调用时进行参数检查才会体现出来。 纯粹就赋值而言,因为指针都是32位的,在机器内部的二进制表示上是没有差异的,也就是说在汇编代码中并不体现。 |
|
函数指针与typedef
用ASM模拟一下吧 假设如下: ProcAdd 变量地址 0x402000 LibHandle 变量地址 0x402010 GetProcAddress IAT地址 0x401100 MessageBoxA 函数地址 0x778899AA ""MessageBoxA" 字符串地址 0x403000 ProcAdd=(void (*)(LPTSTR))GetProcAddress(LibHandle,"MessageBoxA"); push 403000h ;"MessageBoxA" push [402010h] ;LibHandle call [401100h] ;GetProcAddress ;执行后,eax=778899AAh mov [402000h],eax ;ProcAdd |
|
函数指针与typedef
[QUOTE=wonderu;762139]终于懂你的意思了,强制转换的是返回值,也就是把FARPROC转成MYPROC啊...... 注意优先级的问题[/QUOTE] 没有强制转换GetProcAddress啊 是返回的FARPROC类型的指针变量...... |
|
|
|
函数指针与typedef
C语言同时给了程序员最大的编程自由度和严格的类型检查机制。 FARPROC定义如下: typedef int (__stdcall *FARPROC)(); 明显与MYPROC定义不兼容,显示的强制转换是因为编译器希望确认这的确是你希望要做的。 正因为如此,显示的强制类型转换是不安全的。 |
|
函数指针与typedef
函数指针在x86平台长度是4字节,其本质上还是指针,指向的内容为函数的首地址。 申明一般如下: 返回值类型 (*变量名)(形参列表); 形参列表是可选的。 例如: void (*ProcAdd)(LPTSTR); 声明了名为ProcAdd的指针,他指向的函数接受1个LPTSTR类型参数,无返回值。 |
|
函数指针与typedef
首先,你的那段代码是有错误的... 函数指针本质上也是指针,内容为函数的首地址。 GetProcAddress 的返回值类型为 FARPROC 因为 FARPROC 和 MYPROC 不兼容,所以你在赋值时使用了强制转换... 声明只是在编译阶段起到检查作用,所以不会阻止你进行强制类型转换,但当你使用时: (*ProcAdd)(...); 你便会发现只有输入单个 LPTSTR 类型时才能编译通过,但运行时是肯定会崩溃的~ 因为实际上函数接受4个参数,这就说明使用函数指针的危险性,关键是要理解函数指针的正确声明。 |
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值