Win32½á¹¹»¯Òì³£´¦Àí£¨SEH£©Ì½ÃØ(ÉÏ)
£¬»ØÏëһϽṹ»¯Òì³£´¦ÀíÊÇÒÔÏß³ÌΪ»ù´¡£¬²¢×÷ÓÃÔÚÿ¸öÏß³ÌÉÏ£¬Ã÷°×ÕâÒ»µãÊÇÓÐÖúÓÚÀí½âµÄ¡£Ò²¾ÍÊÇ˵£¬Ã¿¸öÏ߳̾߱¸Æä×Ô¼ºµÄÒì³£´¦Àí»Øµ÷º¯Êý¡£ÔÚÎÒ1996Äê5ÔµÄרÀ¸ÎÄÕÂÖУ¬ÎÒÃèÊöÁËÒ»¸ö¹Ø¼üµÄ Win32 Êý¾Ý½á¹¹——Ïß³ÌÐÅÏ¢¿é£¨¼´ TEB ºÍ TIB£©¡£¸ÃÊý¾Ý½á¹¹µÄijЩÓòÔÚ Windows NT¡¢Windows 95¡¢Win32s ºÍ OS/2 ƽ̨ÉÏÊÇÒ»ÑùµÄ¡£TIB ÖеĵÚÒ»¸ö DWORD ÊÇÖ¸ÏòÏß³Ì EXCEPTION_REGISTRATION ½á¹¹µÄÖ¸Õë¡£ÔÚ Intel Win32 ƽ̨ÉÏ£¬FS ¼Ä´æÆ÷×ÜÊÇÖ¸Ïòµ±Ç°µÄ TIB¡£Òò´Ë£¬ÔÚ FS:[0]λÖã¬ÄãÄÜÕÒµ½ EXCEPTION_REGISTRATION ½á¹¹µÄÖ¸Õë¡£
ÏÖÔÚÎÒÃÇÖªµÀÁË£¬µ±Òì³£·¢Éúʱ£¬ÏµÍ³¼ì²é³ö´íÏß³ÌµÄ TIB ²¢»ñÈ¡ EXCEPTION_REGISTRATION ½á¹¹µÄÖ¸Õë¡£Õâ¸ö½á¹¹ÖоÍÓÐÒ»¸ö _except_handler »Øµ÷º¯ÊýµÄÖ¸Õë¡£ÕâЩÐÅÏ¢×ãÒÔÈòÙ×÷ϵͳ֪µÀÔÚÄÄÀïÒÔ¼°ÈçºÎµ÷Óà _except_handler º¯Êý£¬Èçͼ¶þËùʾ£º ͼ¶þ _except_handler º¯Êý ͨ¹ýÇ°ÃæµÄÃèÊö£¬ÎÒдÁËÒ»¸öС³ÌÐòÀ´¶Ô²Ù×÷ϵͳ²ãµÄ½á¹¹»¯Òì³£½øÐÐʾ·¶¡£³ÌÐò´úÂëÈçÏ£º ¡¡//================================================== DWORD¡¡scratch; EXCEPTION_DISPOSITION //¡¡Indicate¡¡that¡¡we¡¡made¡¡it¡¡to¡¡our¡¡exception¡¡handler //¡¡Change¡¡EAX¡¡in¡¡the¡¡context¡¡record¡¡so¡¡that¡¡it¡¡points¡¡to¡¡someplace //¡¡Tell¡¡the¡¡OS¡¡to¡¡restart¡¡the¡¡faulting¡¡instruction int¡¡main() ´úÂëÖÐÖ»ÓÐÁ½¸öº¯Êý£¬main º¯ÊýʹÓÃÁËÈý²¿·ÖÄÚÁª»ã±à¿é ASM¡£µÚÒ»¸ö ASM ¿éͨ¹ýÁ½¸ö PUSH Ö¸Á¼´£º“PUSH handler”ºÍ“PUSH FS:[0]”£©ÔÚ¶ÑÕ»ÉϽ¨Á¢Ò»¸ö EXCEPTION_REGISTRATION ½á¹¹¡£PUSH FS:[0] ±£´æÒÔÇ° FS:[0] µÄÖµ£¬ËüÊǽṹµÄÒ»²¿·Ö£¬µ«Ä¿Ç°Õâ¸öÖµ¶ÔÎÒÃDz»ÖØÒª¡£ÖØÒªµÄÊÇÔÚ¶ÑÕ»ÉÏÓÐÒ»¸ö 8-byte µÄ EXCEPTION_REGISTRATION ½á¹¹¡£½ô½Ó×ŵÄÖ¸ÁMOV FS:[0],ESP£©ÊÇÈÃÏß³ÌÐÅÏ¢¿éÖеĵÚÒ»¸ö DWORD Ö¸µ½Ð嵀 EXCEPTION_REGISTRATION Ö¸Áî¡£ Èç¹ûÄãÏëÖªµÀΪ |
ÁèÖڿƼ¼×¨ÒµÌṩ·þÎñÆ÷×âÓᢷþÎñÆ÷Íйܡ¢ÆóÒµÓʾ֡¢ÐéÄâÖ÷»úµÈ·þÎñ£¬¹«Ë¾ÍøÕ¾£ºhttp://www.lingzhong.cn ΪÁ˸ø¹ã´ó¿Í»§Á˽â¸ü¶àµÄ¼¼ÊõÐÅÏ¢£¬±¾¼¼ÊõÎÄÕÂÊÕ¼¯À´Ô´ÓÚÍøÂç,ÁèÖڿƼ¼×ðÖØÎÄÕÂ×÷ÕߵİæȨ£¬Èç¹ûÓÐÉæ¼°ÄãµÄ°æȨÓбØҪɾ³ýÄãµÄÎÄÕ£¬ÇëºÍÎÒÃÇÁªÏµ¡£ÒÔÉÏÐÅÏ¢ÓëÎÄÕÂÕýÎÄÊDz»¿É·Ö¸îµÄÒ»²¿·Ö,Èç¹ûÄúҪתÔر¾ÎÄÕÂ,Çë±£ÁôÒÔÉÏÐÅÏ¢£¬Ð»Ð»! |