今天帮同事调试一个.Net程序,结果发现一个很奇怪的问题:
同事的.Net程序通过PInvoke调用一个native exe模块(A.exe)中的函数B()。(类似于调用Dll中的函数,我不懂.Net,不知道这么描述对吗)
运行的时候发生AV。
跟踪发现B()又调用了另一个native dll模块(C.dll)中的输出函数D()。
AV发生的过程是B()通过IAT调用D(),但是IAT中D()的地址明显有问题。
通过观察IAT中附近的其他地址,我感觉这个A.exe的IAT在被load到.Net进程的地址空间的时候没有被重定位。
所以A.exe的IAT中的地址都是有问题的。
现在的问题是,这种情况有可能发生吗?是Loader的问题还是正常情况?
有什么好地解决办法?
往各路大侠指点。多谢。
根据描述,涉及两个进程是吧?无论是哪个进程发生AV,都可以使用JIT调试方法在发生AV后以JIT方式附加调试器。如果是本地程序发生AV,那么WinDBG.exe -I将WinDBG设置为JIT调试器。如果是.Net程序发生AV,那么需要产生一个netapp.exe.config文件放在同一目录中,并保有如下内容:
<configuration> <system.windows.forms jitDebugging="true" /></configuration>
如果确实需要调试.Net进程,那么使用WinDBG+SOS扩展模块可以很好的按照需要做本地调试和观察.Net的世界。
依稀记得VC编译的EXE默认是不带重定位表的
这个应该就是原因吧
刚才做了个实验,跟.Net无关。
两个exe都是native的也一样。
等我想明白了再更新
Golf Brilliant - Tiger Dupe 12 Review
Well it looks like even the Tiger can get out of the Woods. Every year Tiger Dupe Golf set the ambition for all over amateur in this genre. Like the John Madden amateur set the ambition for NFL Amateur Tiger Dupe has consistently set the golf clubs for sale
ambition for golf games. Admitting contempo ..should we say troubles, the Tiger has kept his top contour job with EA Sports. Afterwards all Lee Westwood golf would be boring, lets be honest!.This years Tiger Dupe golf, Tiger Dupe 12 brings you that little bit added as you can now play the Augusta masters!. The angelic beaker has assuredly TaylorMade R11 Driver
been brought to Tiger Dupe Golf. It seems that the Augusta Master accept been adored until the cartoon engine can accord this august beforehand the amends it deserves.The aboriginal affair you will apprehension about Tiger Dupe 12 is the absorption to detail as the 3D GRASS acts added like grass and the beheld presentation and annotation gives the bold that added bit of accuracy and adds to the drama.