¿ìËÙÒµÎñͨµÀ

Win32½á¹¹»¯Òì³£´¦Àí£¨SEH£©Ì½ÃØ(ÉÏ)

×÷Õß ØýÃû¼¼Êõ À´Ô´ ³ÌÐòÉè¼Æ ä¯ÀÀ ·¢²¼Ê±¼ä 2012-06-29
ÕâÁ½¸öº¯ÊýµÄʹÓ÷¶Î§ÁË¡££©

MOV¡¡EAX,DWORD¡¡PTR¡¡[EBP-14]¡¡;¡¡Ö´ÐÐÍê±Ï£¬EAXÖ¸ÏòEXCEPTION_POINTERS½á¹¹
MOV¡¡EAX,DWORD¡¡PTR¡¡[EAX]¡¡;¡¡Ö´ÐÐÍê±Ï£¬EAXÖ¸ÏòEXCEPTION_RECORD½á¹¹
MOV¡¡EAX,DWORD¡¡PTR¡¡[EAX]¡¡;¡¡Ö´ÐÐÍê±Ï£¬EAXÖÐÊÇExceptionCodeµÄÖµ

ÏÖÔڻص½À©Õ¹µÄ EXCEPTION_REGISTRATION ½á¹¹ÉÏÀ´¡£ÔÚÕâ¸ö½á¹¹¿ªÊ¼Ç°µÄ8¸ö×Ö½Ú´¦£¨¼´[EBP-18H]´¦£©£¬Visual C++ ±£ÁôÁËÒ»¸öDWORDÀ´±£´æËùÓÐprolog´úÂëÖ´ÐÐÍê±ÏÖ®ºóµÄ¶ÑÕ»Ö¸Õ루ESP£©µÄÖµ£¨Êµ¼ÊÉú³ÉµÄÖ¸ÁîΪMOV DWORD PTR [EBP-18H],ESP£©¡£Õâ¸öDWORDÖб£´æµÄÖµÊǺ¯ÊýÖ´ÐÐʱESP¼Ä´æÆ÷µÄÕý³£Öµ£¨³ýÁËÔÚ×¼±¸µ÷ÓÃÆäËüº¯Êýʱ°Ñ²ÎÊýѹÈë¶ÑÕ»Õâ¸ö¹ý³Ì»á¸Ä±ä ESP¼Ä´æÆ÷µÄÖµ²¢ÔÚº¯Êý·µ»Øʱ»Ö¸´ËüµÄÖµÍ⣬º¯ÊýÔÚÖ´Ðйý³ÌÖÐÒ»°ã²»¸Ä±äESP¼Ä´æÆ÷µÄÖµ£©¡£

¿´ÆðÀ´ºÃÏñÎÒÒ»ÏÂ×Ó¸øÄã¹àÊäÁËÌ«¶àµÄÐÅÏ¢£¬ÎÒ³ÐÈÏ¡£ÔÚ¼ÌÐøÏÂȥ֮ǰ£¬ÈÃÎÒÃÇÏÈÔÝÍ££¬À´»Ø¹ËһϠVisual C++ ΪʹÓýṹ»¯Òì³£´¦ÀíµÄº¯ÊýÉú³ÉµÄ±ê×¼Òì³£¶ÑÕ»Ö¡£¬Ëü¿´ÆðÀ´ÏñÏÂÃæÕâ¸öÑù×Ó£º

EBP-00¡¡_ebp
EBP-04¡¡trylevel
EBP-08¡¡scopetableÊý×éÖ¸Õë
EBP-0C¡¡handlerº¯ÊýµØÖ·
EBP-10Ö¸ÏòÇ°Ò»¸öEXCEPTION_REGISTRATION½á¹¹
EBP-14¡¡GetExceptionInformation
EBP-18¡¡Õ»Ö¡Öеıê×¼ESP

ÔÚ²Ù×÷ϵͳ¿´À´£¬Ö»´æÔÚ×é³Éԭʼ EXCEPTION_REGISTRATION ½á¹¹µÄÁ½¸öÓò£º¼´[EBP-10h]´¦µÄprevÖ¸ÕëºÍ[EBP-0Ch]´¦µÄhandlerº¯ÊýÖ¸Õë¡£Õ»Ö¡ÖеÄÆäËüËùÓÐÄÚÈÝÊÇÕë¶ÔÓÚVisual C++µÄ¡£°ÑÕâ¸öVisual C++Éú³ÉµÄ±ê×¼Òì³£¶ÑÕ»Ö¡¼Çµ½ÄÔ×ÓÀïÖ®ºó£¬ÈÃÎÒÃÇÀ´¿´Ò»ÏÂÕæÕýʵÏÖ±àÒëÆ÷²ãÃæSEHµÄÕâ¸öVisual C++ÔËÐÐʱ¿âÀý³Ì——__except_handler3¡£

__except_handler3 ºÍ scopetable

ÎÒÕæµÄºÜÏ£ÍûÈÃÄã¿´Ò»¿´Visual C++ÔËÐÐʱ¿âÔ´´úÂ룬ÈÃÄã×Ô¼ººÃºÃÑо¿Ò»ÏÂ__except_handler3º¯Êý£¬µ«ÊÇÎÒ°ì²»µ½¡£ÒòΪ Microsoft²¢Ã»ÓÐÌṩ¡£ÔÚÕâÀïÄã¾Í½«¾Í×Å¿´Ò»ÏÂÎÒΪ__except_handler3º¯ÊýдµÄα´úÂë°É£º¡£

ͼ¾Å __except_handler3º¯ÊýµÄα´úÂ룺

int¡¡__except_handler3(
struct¡¡_EXCEPTION_RECORD¡¡*¡¡pExceptionRecord,
struct¡¡EXCEPTION_REGISTRATION¡¡*¡¡pRegistrationFrame,
struct¡¡_CONTEXT¡¡*pContextRecord,
void¡¡*¡¡pDispatcherContext¡¡)
{
LONG¡¡filterFuncRet;
LONG¡¡trylevel;
EXCEPTION_POINTERS¡¡exceptPtrs;
PSCOPETABLE¡¡pScopeTable;
CLD¡¡//¡¡½«·½Ïò±êÖ¾¸´Î»£¨²»²âÊÔÈκÎÌõ¼þ£¡£©
//¡¡Èç¹ûûÓÐÉèÖÃEXCEPTION_UNWINDING±êÖ¾»òEXCEPTION_EXIT_UNWIND±êÖ¾
//¡¡±íÃ÷ÕâÊǵÚÒ»´Îµ÷ÓÃÕâ¸ö´¦Àí³ÌÐò£¨Ò²¾ÍÊÇ˵£¬²¢·Ç´¦ÓÚÒì³£Õ¹¿ª½×¶Î£©
if¡¡(¡¡!¡¡(pExceptionRecord->ExceptionFlags
&¡¡(EXCEPTION_UNWINDING¡¡|¡¡EXCEPTION_EXIT_UNWIND))¡¡)
{
//¡¡ÔÚ¶ÑÕ»ÉÏ´´½¨Ò»¸öEXCEPTION_POINTERS½á¹¹
exceptPtrs.ExceptionRecord¡¡=¡¡pExceptionRecord;
exceptPtrs.ContextRecord¡¡=¡¡pContextRecord;
//¡¡°ÑÇ°Ã涨ÒåµÄEXCEPTION_POINTERS½á¹¹µÄµØÖ··ÅÔÚ±È
//¡¡establisherÕ»Ö¡µÍ4¸ö×Ö½ÚµÄλÖÃÉÏ¡£²Î¿¼Ç°ÃæÎÒ½²
//¡¡µÄ±àÒëÆ÷ΪGetExceptionInformationÉú³ÉµÄ»ã±à´ú
//¡¡Âë*(PDWORD)((PBYTE)pRegistrationFrame¡¡-¡¡4)¡¡=¡¡&exceptPtrs;
//¡¡»ñÈ¡³õʼµÄ“trylevel”Öµ
trylevel¡¡=¡¡pRegistrationFrame->trylevel;
//¡¡»ñÈ¡Ö¸ÏòscopetableÊý×éµÄÖ¸Õë
scopeTable¡¡=¡¡pRegistrationFrame->scopetable;
search_for_handler:
if¡¡(¡¡pRegistrationFrame->trylevel¡¡!=¡¡TRYLEVEL_NONE¡¡)
{
if¡¡(¡¡pRegistrationFrame->scopetable[trylevel].lpfnFilter¡¡)
{
PUSH¡¡EBP¡¡//¡¡±£´æÕâ¸öÕ»Ö¡Ö¸Õë
//¡¡£¡£¡£¡·Ç³£ÖØÒª£¡£¡£¡Çл»»ØÔ­À´µÄEBP¡£ÕýÊÇÕâ¸ö²Ù×÷²ÅʹµÃ
//¡¡Õ»Ö¡ÉϵÄËùÓоֲ¿±äÁ¿Äܹ»ÔÚÒì³£·¢ÉúºóÈÔÈ»±£³ÖËüµÄÖµ²»±ä¡£
EBP¡¡=¡¡&pR

ÁèÖڿƼ¼×¨ÒµÌṩ·þÎñÆ÷×âÓᢷþÎñÆ÷Íйܡ¢ÆóÒµÓʾ֡¢ÐéÄâÖ÷»úµÈ·þÎñ£¬¹«Ë¾ÍøÕ¾£ºhttp://www.lingzhong.cn ΪÁ˸ø¹ã´ó¿Í»§Á˽â¸ü¶àµÄ¼¼ÊõÐÅÏ¢£¬±¾¼¼ÊõÎÄÕÂÊÕ¼¯À´Ô´ÓÚÍøÂç,ÁèÖڿƼ¼×ðÖØÎÄÕÂ×÷ÕߵİæȨ£¬Èç¹ûÓÐÉæ¼°ÄãµÄ°æȨÓбØҪɾ³ýÄãµÄÎÄÕ£¬ÇëºÍÎÒÃÇÁªÏµ¡£ÒÔÉÏÐÅÏ¢ÓëÎÄÕÂÕýÎÄÊDz»¿É·Ö¸îµÄÒ»²¿·Ö,Èç¹ûÄúҪתÔر¾ÎÄÕÂ,Çë±£ÁôÒÔÉÏÐÅÏ¢£¬Ð»Ð»!

·ÖÏíµ½£º ¸ü¶à
ÚµÄÒ»Öֳ־ÿò¼Ü - ±à³ÌÈëÃÅÍø" target="_blank">iBATIS 3ÄÚµÄÐÂÌØÐÔ£º½«iBATISÓÃ×÷Ó¦ÓóÌÐòÄÚµÄÒ»Öֳ־ÿò¼Ü - ±à³ÌÈëÃÅÍø
  • Photoshop»æÖƸ߹âË®¾§ÖʸÐË®¾§Æ»¹û
  • Copyright ©1999-2011 ÏÃÃÅÁèÖڿƼ¼ÓÐÏÞ¹«Ë¾ ÏÃÃÅÓÅͨ»¥Áª¿Æ¼¼¿ª·¢ÓÐÏÞ¹«Ë¾ All rights reserved

    µØÖ·(ADD)£ºÏÃÃÅÈí¼þÔ°¶þÆÚÍûº£Â·63ºÅ701E£¨¶«ÄÏÈÚͨÅÔ£© Óʱà(ZIP)£º361008

    µç»°£º0592-5908028 ´«Õ棺0592-5908039 ×ÉѯÐÅÏ䣺web@lingzhong.cn ×ÉѯOICQ£º173723134

    ¡¶ÖлªÈËÃñ¹²ºÍ¹úÔöÖµµçÐÅÒµÎñ¾­ÓªÐí¿ÉÖ¤¡·ÃöB2-20100024  ICP±¸°¸:ÃöICP±¸05037997ºÅ