????3??????VC++?????????????????????????????????

??????????????????????????VC++?????渭????????????????????????????????????

????????????????????? ?????泄??????????????????????????????????????????

??????1??????????overflow??

???????????????????????危?

????1??????????????????????Windows??????????1M??????????Project->Properties->Configuration Properties -> Linker->System?锌??????Stack Reserve Size????????????????????小??

????2???????貌??????睢�?????????校?????????call stack???????锌????????????????????

??????2??????????????????

???????????????????????危?

????1????????????写???????????围?????纾�???????????校?????????????????????????????????????????????????????煤????????????位?谩?

????2??????煤?????????煤?????????????????????????????????霉娣�???????

?????????????????????????????/GS??/RTCs?????????Project->Properties->Configuration Properties-> C/C++->Code Generation?????????

???????????????????????????????????锟�?

??????1?????写??纭�?????姹�?校??????写???纾�?????“Damage??after block...”???????????????写??????????“Damage?? before block...”??????????

??????2??????????????????姹�?校????未??????????????????????????_CrtIsValidHeapPointer???????

??????3??????????????姹�?校??????????????? ?????_BLOCK_TYPE_IS_VALID?????????????????????delete?????????????????????????????

????4??????Windows????????????????????姹�???????????

???????????????危???????????????????????????????????????????“????”?????????????????????????????????????????????????????????????????????????????????????????????????????????Windows????????????Structured Exception Handling??SEH??????[6]??MiniDumpWriteDump??dbghelp.dll??????? API???????慰?MSDN??????????????????????些??????????????????????????????????.dmp????????????????????????????VC++????WinDBG?????y????o???????????????dbghelp.h??dbghelp.lib??dbghelp.dll????些?????????Windows Platform SDK?????????

??????o????.dmp???????????????????姹�???????debug symbols ??pdb???????????????/DEBUG??????????.dmp????????VC++??.dmp?????????????校???F5??????????????????????????????[5]?????????????????????????????

????5??????

???????????????????????????????渭?????????????????????????????效????????????械???????????泄?????????????????????????????????????????效????????????????????????????????????Bug?????????纬????????效?????????????????????????????????????????????????谩?