|
[求助]VS2003+DDKWizard出错[已解决]
我也遇到了这个问题,经过我4、5个小时的排除法找错,终于把问题给找出来了。 这个问题不会出现在使用英文版的机器上。 出错原因是DDKWizard\Wizards\Driver\HTML\1033\default.htm指定了使用UTF-8编码,而这个htm会调用Microsoft Visual Studio .NET 2003\Vc7\VCWizards\2052里面的common.js文件,而common.js文件里面有一些中文的字符串定义,但是它是GB2312编码的,这样一来两者的编码不应不上,一些以“果”、“件”这类F0-FF结尾的字符串定义就会出错。 原因找到了,就容易解决了,可以把common.js另存为unicode编码,不过这样可能会给其他向导带来问题,所以不推荐。 最好的方法是修改default.htm,把指定编码类型的代码注释掉,只要去掉 <meta http-equiv="Content-type" content="text/html;charset=UTF-8">这行,向导就可以正常工作。 那个536行的OnWizFinish报错也是这个原因。因为OnWizFinish这个函数是写在common.js里面,而common.js由于之前报了一个151行缺少;的错误(“果”字结尾的字符串),因此没有被完全加载进来,那么调用OnWizFinish当然就找不到了。 |
|
[讨论]支付宝控件的低级键盘钩子是怎么实现的?
呃,挂了一下CreateFileA,发现打开了\\.\alidevice,看来确实是用驱动实现的…… |
|
[求助]不用异常处理,如何判断是否可以在栈上面执行代码?
这个跟ebp有关系么?用ebp来保存当时的esp,只不过是为了访问调用参数更方便一点,好像GCC还有一个编译参数可以禁用ebp保存esp的编译行为,使得ebp成为一个普通的寄存器。 另外,call没有修改除esp以外的任何一个寄存器,esp也只是减小4,ret的时候esp就变回来了,堆栈上有问题么? 不过我用的VS2003在RELEASE下编译这两条语句,会把code=0xC3优化没掉,所以要用_asm mov dword ptr[code], 0xC3来确保赋值语句正常。 可能这个问题是DEP引起的吧?LS的是不是开启DEP以后,EXE执行这两条语句也出抛异常? |
|
[求助]不用异常处理,如何判断是否可以在栈上面执行代码?
这个ret对应的是((FARPROC)&code)()的call,只是返回到这句的下一句而已,又不是返回到外面了,堆栈怎么可能会不平衡呢?而且对于没有参数的函数而言,_cdcel和_stdcall也没啥区别。 不过你说你启用DEP后,普通Exe也一样抛STATUS_ACCESS_VIOLATION(0xc0000005),那可能就是DEP的原因了。不过不知道为什么我这台机,即使是启用了DEP,也只有rundll32会抛这个异常,其他的则是正常执行。我的CPU是T7300。 |
|
[求助]不用异常处理,如何判断是否可以在栈上面执行代码?
可以明确的告诉你,确实是在栈上面, 在code的内存空间,只不过call进去以后,第一条指令ret,又返回了出来。 如果不是在栈上面执行的,甚至不能解释为什么rundll32加载会出错。 |
|
[求助]不用异常处理,如何判断是否可以在栈上面执行代码?
顶楼我就已经说过了,如果在Rundll32加载的DLL里面执行那段代码,出异常,你说我这块CPU支持么? |
|
[求助]不用异常处理,如何判断是否可以在栈上面执行代码?
我刚才试了一下,发现即便选成“为所有程序和服务启用DEP”,然后再重启,在EXE里面,在栈上面执行也不会出错。 似乎不是2L说的原因啊!?到底怎么回事? |
|
|
|
[讨论]有没有可能用VC编写一个EXE、DLL两用的可执行文件?
同意你的观点,只是你前面说的让人感觉似乎有其他解决方法似的。 其实我是在想有没有可能做一个单文件的全局消息钩子,临时释放文件的方法不算,钩子的目的还是DLL注入,再做APIHook。其实注入方法有很多,不一定要用消息钩子,不过我希望可以完美的退出并还原现场,这似乎只有消息钩子可以胜任了吧!?不过其他进程的消息钩子,只能是通过DLL来实现,虽然可以通过rundll32来调用DLL,不过用起来毕竟不方便。因为是注入,其他进程只会通过LoadLibrary这种传统的方式来加载,我们没有办法去做些小动作,来让它正常起来,可能这确实没有什么办法了吧。 传了份测试代码上来,VS2003编译的,直接F5是用rundll32加载dll。 对于已经生成的dll,把它扩展名改成EXE,用LordPE把PE文件头的特征值那一项21OE修改成010E就可以双击直接运行。(如果手头上没有LordPE,也可以用UE找到"PE\0\0",往后数18个字节,把21 0E修改成01 0E就行了,改一个字节) |
|
[讨论]有没有可能用VC编写一个EXE、DLL两用的可执行文件?
发觉LS都不看他人说话内容的…… |
|
[讨论]有没有可能用VC编写一个EXE、DLL两用的可执行文件?
本来就是已经做成DLL了,只不过只要一修改类型标志为EXE,LoadLibrary加载后,运行就会失败,出错的地方在API调用;不修改当作DLL当然是问题,不过不管是双击,还是命令行,系统都会提示不是有效的WIN32应用程序。 原因是已经找到了,将EXE用LoadLibrary加载的话,IAT表不会帮你生成,EP入口函数也不会被调用。 根据MSDN的说法,他说将EXE用LoadLibrary加载的目的是取得其中的资源,而不是用来作代码执行。可能正是这个原因才没有做IAT表生成和入口函数调用,这样看来,这帖标题只能是假命题了…… |
|
[讨论]有没有可能用VC编写一个EXE、DLL两用的可执行文件?
不知道奇虎360有啥比赛?对了我这里说的这个Exe是可以通过正常手段被LoadLibrary的,而不是VirtualAlloc分配内存,再自己去做重定位的…… LS说说思路看看…… |
|
[求助]是EXE还是DLL可以通过PE文件头的那个成员来判断呢?
找到了,是_IMAGE_FILE_HEADER::Characteristics,如果是0x010F是exe,如果是0x210E就是dll。 |
|
|
|
[求助]APIHOOK碰到问题
exe被钩住的时机发生在尝试去取消息的时刻,如果该exe运行时直接调用CreateMutex,这时候钩子是还没来得及挂钩的。 这一点LZ可以自己写一个调用CreateMutex的程序作测试,你可以发现,只有在CreateMutex之前执行过GetMessage的才可以被成功挂钩。 至于3L的问题,很可能是因为你自己调用的那次还没有勾搭上,勾搭上以后,被你截获的那次可能是其他库里面自己的调用。 |
操作理由
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 }}
勋章
兑换勋章
证书
证书查询 >
能力值