Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ÉîÈëC/C++Ö®»ùÓÚCheckStackVarsµÄ°²È«¼ì²é£¨VS2008£©

×î½üһֱæ±ÏÒµµÄÏà¹ØÊÂÇ飬¼ÓÉϹ¤×÷£¬×ªÑۼ䣬ÓÖµ½Ôµ×ÁË£¬Ö®Ç°³ÐŵµÄÿÔÂһƪ²©ÎÄ£¬Ç°¼¸Ìì¾ÍÒ»Ö±ÔÚÑ°ÕÒµ½µ×Ҫдʲô£¬½üÁ½ÌìÓÖͻȻ·¢ÏÖÓкܶණÎ÷¿ÉÒÔд¡£±¾Æª¾ÍÏÈÑÓÐø֮ǰµÄһƪ»ùÓÚCookieµÄ°²È«¼ì²é»úÖÆ£¨ÉîÈëC/C++Ö®»ùÓÚCookieµÄ°²È«¼ì²é£¨VS2005£©£©À´½éÉÜÏÂÁíÍâÒ»ÖÖÔÚDEBUG°æ±¾Ïµİ²È«¼ì²é£¬Ò²¾ÍÊÇCheckStackVars¼ì²é£¬»°²»¶à˵£¬Ö±½Ó½øÈëÕýÌâ¡£
ÔÚVS2008Ï£¬º¯ÊýµÄÕ»¿Õ¼äÀïÈç¹û´æÔÚÊý×飬¾Í»á×Ô¶¯¼ÓÉÏCheckStackVars¼ì²é£¬¹ËÃû˼Ò壬¾ÍÊÇÓÃÀ´¼ì²é¾Ö²¿Êý¾ÝÊÇ·ñ·ÃÎÊÔ½½ç¡£Ïà¶ÔÀ´Ëµ£¬ÕâÖÖ¼ì²éÖ»ÄÜÆðµ½Ò»¶¨µÄ×÷Ó㬲¢²»»áËùÓÐÔ½½ç·ÃÎʶ¼Äܼì²éµ½£¬¸ù¾ÝºóÃæµÄÔ­Àí½éÉÜ»áÁ˽⵽Õâµã¡£¼ÈÈ»ÊǼì²é¾Ö²¿µÄ£¬ÄÇôÔÚº¯ÊýÄÚ¶¨ÒåµÄstaticÀàÐÍÊý×é»òÕߺ¯ÊýÍⲿµÄÈ«¾ÖÊý×é²¢²»»á²ÉÓô˼ì²é£¬¼ÈÈ»ÊǼì²éÊý×飬ÄÇôÈç¹ûº¯ÊýÄÚûÓоֲ¿Êý×éʱ£¬´Ë¼ì²éÒ²²»»á´æÔÚ¡£
Ê×ÏÈÀ´¿´Ò»¸ö¼òµ¥µÄÀý×Ó£¬ÑéÖ¤Õâ¸ö¼ì²éµÄ´æÔÚ£º
void TestVars( void )
{
    int bf = 0xeeeeeeee;
    char array[10] = { 0 };
    int bk = 0xffffffff;
   
    strcpy( array, "masefee" );
}
int main( void )
{
    TestVars();
    return 0;
}
ÔÚÕâ¸öÀý×ÓÖУ¬´æÔÚÒ»¸öÊý×éarray£¬ÕâÀï¿ÌÒⶨÒåÁËÁíÍâÁ½¸ö±äÁ¿£¬ÓÃÓÚ¿´ÕâÁ½¸ö±äÁ¿ÓëÊý×éarrayµÄÄÚ´æ·Ö²¼Çé¿ö¡£ÕâÑù¾ÍÄÜÇåÎúµÄÁ˽⵽CheckStackVarsÕâ¸ö¼ì²éµÄÔ­Àí¡£È»ºóÀ´¿´¿´DebugÏ£¬TestVarsº¯ÊýÄÚ²¿µÄ3¸ö¾Ö²¿±äÁ¿µÄÄÚ´æ·Ö²¼Çé¿ö¡£¶Ïµã´òÔÚstrcpyÕâ¾äÉÏ£¬·Ö²¼ÈçÏ£º
ff ff ff ff cc cc cc cc cc cc cc cc 00 00 00 00 00 00 00 00 00 00cc cc cc cc cc cc cc cc cc cc ee ee ee ee  
   bk                                                           array                                &nbs


Ïà¹ØÎĵµ£º

s3c2410 RTCÇý¶¯¿ò¼ÜlinuxÄÚºËÔ´Âë·ÖÎö

ʵÔÚÎÞÁÄÖоͽ«Ô­À´µÄһЩ¶«Î÷ÕûÀíÁËһϣ¬×Ô¼ºÊǸö¼ÇÐÔ²»ºÃµÄÈË£¬¸ô¶Ïʱ¼äÕûÀí×Ô¼º£¬Í¬Ê±Ò²Ï£Íû¿ÉÒÔ·½±ãËûÈË¡£
----------------------------------------------------------------------------------------------------------------------------------------
/**//*************************************************** ......

Îĵµ´¦ÀíµÄcº¯Êý

Îļþº¯Êý´ò¿ªÎļþº¯Êý
[º¯ÊýÍ·]
FILE *fopen£¨char *filename, Char *mode£© 
[²ÎÊý]
filename ×Ö·ûÐÍÖ¸Õ룬ָÏòµÄ×Ö·û´®ÊÇÒª´ò¿ªµÄ´ÅÅÌÎļþÃû£»mode ×Ö·ûÐÍÖ¸Õ룬ָÏòµÄ×Ö·û´®ÊÇÎļþʹÓ÷½Ê½¡£ÕâÁ½¸ö²ÎÊý¶ÔÓ¦µÄʵ²Î¿ÉÒÔÊÇ×Ö·ûÖг£Á¿£¬Ò²¿ÉÒÔÊDz¹·ûÊý×éÊ×µØÖ·£¬»òÕßÊÇÖ¸Ïò×Ö·û´®µÄÖ¸Õë±äÁ¿¡£ 
ÎļþʹÓ÷½Ê½¿ ......

20100527 CÏÝÚåÓëȱÏݶÁÊé±Ê¼Ç£¨Ò»¡¢¶þÕ£©

  µÚÒ»Õ£º´Ê·¨“ÏÝÚå”
  ×Öĸ±¾ÉíûÓÐÒâ˼£¬µ«Êǽ«×Öĸ×é³ÉµÄµ¥´Ê¾Í±»¸³ÓèÁËÒâÒå¡£ÔÚCÓïÑÔÖУ¬×Ö·û×éºÏ³ÉÁËÕû¸ö´úÂ룬ÓÉ×Ö·ûÊéд´øÀ´µÄ±ÊÎó»á´øÀ´²»ÉÙÂé·³¡£×÷Ϊ³ÌÐòÔ±£¬²»ÄÜÖ¸Íû¿¿±àÒëÆ÷À´ÌáÐÑ¡£Òò´Ë£¬ÐèҪעÒ⣺
  1.CÓïÑÔÖУ¬·ûºÅÖ®¼äµÄ¿Õ°×£¨°üÀ¨¿Õ¸ñ·û£¬ÖƱí·û£¬»»Ðзû£© ......

C±ê×¼Ô¤¶¨Òåºê

ANSI C±ê×¼ÖÐÓм¸¸ö±ê×¼Ô¤¶¨Òåºê£º__FILE__     __DATE__   __TIME___    __LINE__   µÈ
__LINE__£ºÔÚÔ´´úÂëÖвåÈ뵱ǰԴ´úÂëÐкţ»
__FILE__£ºÔÚÔ´ÎļþÖвåÈ뵱ǰԴÎļþÃû£»
__DATE__£ºÔÚÔ´ÎļþÖвåÈ뵱ǰµÄ±àÒëÈÕÆÚ
__TIME__£ºÔÚÔ´ÎļþÖвåÈ뵱ǰ±àÒëʱ¼ä£» ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ