{"id":35937,"date":"2025-01-06T11:05:21","date_gmt":"2025-01-06T03:05:21","guid":{"rendered":"https:\/\/www.deepin.org\/?p=35937"},"modified":"2025-01-06T11:07:16","modified_gmt":"2025-01-06T03:07:16","slug":"debug-problems-with-wine-logs","status":"publish","type":"post","link":"https:\/\/www.deepin.org\/zh\/debug-problems-with-wine-logs\/","title":{"rendered":"\u5982\u4f55\u4f7f\u7528 Wine \u65e5\u5fd7\u8c03\u8bd5\u95ee\u9898"},"content":{"rendered":"<img loading=\"lazy\" class=\"alignnone size-full wp-image-35941\" src=\"https:\/\/www.deepin.org\/wp-content\/uploads\/2025\/01\/02-zh.png\" alt=\"\" width=\"900\" height=\"383\" srcset=\"https:\/\/www.deepin.org\/wp-content\/uploads\/2025\/01\/02-zh.png 900w, https:\/\/www.deepin.org\/wp-content\/uploads\/2025\/01\/02-zh-300x128.png 300w, https:\/\/www.deepin.org\/wp-content\/uploads\/2025\/01\/02-zh-150x64.png 150w, https:\/\/www.deepin.org\/wp-content\/uploads\/2025\/01\/02-zh-768x327.png 768w, https:\/\/www.deepin.org\/wp-content\/uploads\/2025\/01\/02-zh-24x10.png 24w, https:\/\/www.deepin.org\/wp-content\/uploads\/2025\/01\/02-zh-36x15.png 36w, https:\/\/www.deepin.org\/wp-content\/uploads\/2025\/01\/02-zh-48x20.png 48w\" sizes=\"(max-width: 900px) 100vw, 900px\" \/><\/p>\n<p>\u8f93\u51fa\u8c03\u8bd5\u65e5\u5fd7\u662f\u8c03\u8bd5\u7a0b\u5e8f\u7684\u4e00\u79cd\u5e38\u89c1\u65b9\u6cd5\uff0c\u5c24\u5176\u662f\u5904\u7406\u90a3\u4e9b\u96be\u4ee5\u6349\u6478\u7684\u591a\u7ebf\u7a0b\u9519\u8bef\u3001\u968f\u673a\u5d29\u6e83\u7b49\u95ee\u9898\u65f6 \u3002\u901a\u8fc7\u5728\u5408\u9002\u7684\u4f4d\u7f6e\u8f93\u51fa\u8c03\u8bd5\u65e5\u5fd7\uff0c\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u66f4\u5feb\u5730\u5b9a\u4f4d\u95ee\u9898\u6240\u5728\u3002<\/p>\n<p>\u5bf9\u4e8e\u4e0d\u719f\u6089\u7684\u4ee3\u7801\uff0c\u7ecf\u5e38\u6253\u65e5\u5fd7\u4e5f\u6709\u52a9\u4e8e\u5feb\u901f\u7406\u89e3\u4ee3\u7801\u7684\u6267\u884c\u6d41\u7a0b\u548c\u529f\u80fd\u3002\u5728\u5927\u578b\u9879\u76ee\u4e2d\uff0c\u901a\u5e38\u4f1a\u5148\u5b9e\u73b0\u4e00\u5957\u81ea\u5df1\u7684\u8c03\u8bd5\u65e5\u5fd7\u6846\u67b6\uff0c\u4e3b\u8981\u6709\u4e24\u4e2a\u76ee\u7684\uff1a<\/p>\n<ul class=\"list-paddingleft-1\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\u7edf\u4e00\u65e5\u5fd7\u98ce\u683c\u548c\u5b58\u50a8\uff1a\u786e\u4fdd\u65e5\u5fd7\u683c\u5f0f\u4e00\u81f4\uff0c\u5e76\u4e14\u6709\u7edf\u4e00\u7684\u5b58\u50a8\u65b9\u5f0f\uff0c\u8fd9\u6709\u52a9\u4e8e\u7528\u6237\u66f4\u5bb9\u6613\u5730\u62a5\u544a\u95ee\u9898\u3002<\/li>\n<li>\u65b9\u4fbf\u5f00\u53d1\u4eba\u5458\uff1a\u5f00\u53d1\u4eba\u5458\u80fd\u591f\u8f7b\u677e\u5730\u8bb0\u5f55\u65e5\u5fd7\uff0c\u4ece\u800c\u5feb\u901f\u8c03\u8bd5\u95ee\u9898\u3002<\/li>\n<\/ul>\n<p>Wine \u9879\u76ee\u4e5f\u4e0d\u4f8b\u5916\uff0c\u5b83\u4e5f\u5b9e\u73b0\u4e86\u4e00\u5957\u81ea\u5df1\u7684\u65e5\u5fd7\u7cfb\u7edf\u3002\u8fd9\u5957\u7cfb\u7edf\u975e\u5e38\u7b80\u6d01\uff0c\u4e0b\u9762\u6211\u4eec\u5c31\u6765\u8be6\u7ec6\u4ecb\u7ecd\u3002<\/p>\n<p>&nbsp;<\/p>\n<h1 style=\"text-align: center;\"><strong>Wine \u7684\u8c03\u8bd5\u65e5\u5fd7\u5b9e\u73b0<\/strong><\/h1>\n<h2><strong>\u8c03\u8bd5\u901a\u9053\uff08debug channel\uff09<\/strong><\/h2>\n<p>Wine \u5b9a\u4e49\u4e86\u8c03\u8bd5\u901a\u9053\u7684\u6982\u5ff5\u6765\u5206\u7c7b\u65e5\u5fd7\uff0c\u5c06\u65e5\u5fd7\u7684\u8bb0\u5f55\u548c\u5b9e\u9645\u7684\u8f93\u51fa\u5206\u79bb\uff0c\u65e0\u9700\u91cd\u65b0\u7f16\u8bd1 Wine\uff0c\u5c31\u80fd\u52a8\u6001\u5730\u7075\u6d3b\u63a7\u5236 Wine \u8fd0\u884c\u65f6\u7684\u65e5\u5fd7\u8f93\u51fa\u3002<\/p>\n<ul class=\"list-paddingleft-1\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\u6bcf\u4e2a\u8c03\u8bd5\u901a\u9053\u6709\u4e00\u4e2a\u552f\u4e00\u7684\u540d\u5b57, \u957f\u5ea6\u4e0d\u8d85\u8fc714\u4e2a\u53ef\u89c1\u7684 ASCII \u5b57\u7b26\uff0c \u4e00\u822c\u4e00\u4e2a\u6a21\u5757\u81f3\u5c11\u5b9a\u4e49\u4e86\u4e00\u4e2a\u8c03\u8bd5\u901a\u9053\uff0c\u6bd4\u5982 gdi32.dll \u6a21\u5757\uff0c\u6709\u4e00\u4e2a\u540d\u79f0\u53eb gdi \u7684\u8c03\u8bd5\u901a\u9053\u3002<\/li>\n<li>\u590d\u6742\u7684\u6a21\u5757\uff0c\u4e3a\u4e86\u7ec6\u5206\u65e5\u5fd7\u5b9a\u4e49\u4e86\u591a\u4e2a\u8c03\u8bd5\u901a\u9053\uff0c\u6bd4\u5982 gdi32.dll \u6a21\u5757\uff0c\u8fd8\u5b9a\u4e49\u4e86clipping\u3001region\u3001font\u3001bitmap\u3001print\u3001bitblt \u7b49\u8c03\u8bd5\u901a\u9053\u3002<\/li>\n<li>\u8c03\u8bd5\u901a\u9053\u5728\u4ee3\u7801\u91cc\u9762\u6765\u770b\u5b9e\u9645\u662f\u4e00\u4e2a<code>__wine_debug_channel <\/code> \u7684\u7ed3\u6784\u4f53\uff0c\u521a\u597d16\u4e2a\u5b57\u8282\uff0c\u975e\u5e38\u7b26\u5408 UNIX \u7b80\u5355\u539f\u5219\u7684\u54f2\u5b66\u7406\u5ff5\uff1a<\/li>\n<\/ul>\n<blockquote><p>struct\u00a0__wine_debug_channel<br \/>\n{<br \/>\nunsigned\u00a0char\u00a0flags;<br \/>\nchar\u00a0name[15];<br \/>\n};<\/p><\/blockquote>\n<ul>\n<li>\n<section>\u65e5\u5fd7\u4e00\u6b21\u53ea\u53d1\u9001\u7ed9\u4e00\u4e2a\u8c03\u8bd5\u901a\u9053\u3002<\/section>\n<\/li>\n<li>\n<section>\u4ee3\u7801\u91cc\u589e\u52a0\u4e00\u4e2a\u65b0\u7684\u8c03\u8bd5\u901a\u9053\uff0c\u975e\u5e38\u7b80\u5355\uff1a<\/section>\n<p>&nbsp;<\/li>\n<\/ul>\n<section>1. \u5305\u542b <code>include\/wine\/debug.h <\/code>\uff1b<\/section>\n<p>2. \u7136\u540e\u7528<code>WINE_DEFAULT_DEBUG_CHANNEL<\/code>\u6216<code>WINE_DEFAULT_DEBUG_CHANNEL<\/code>\u5b8f\u6765\u58f0\u660e\u3002<\/p>\n<ul>\n<li>\u8981\u77e5\u9053\u4e00\u4e2a\u6a21\u5757\u5b9a\u4e49\u4e86\u54ea\u4e9b\u8c03\u8bd5\u901a\u9053\uff0c\u53ea\u9700\u8fd9\u6837\u641c\u7d22\u8be5\u6a21\u5757\u7684\u6240\u6709\u6e90\u7801:<code>git grep _DEBUG_CHANNEL <\/code>\u3002<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h2><strong>\u5411\u8c03\u8bd5\u901a\u9053\u53d1\u9001\u65e5\u5fd7<\/strong><\/h2>\n<p>Wine \u628a\u65e5\u5fd7\u5206\u6210\u4e864\u4e2a\u7ea7\u522b\uff0c\u4ece\u9ad8\u5230\u4f4e\u4f9d\u6b21\u662f\uff1afixme\/ err(or)\/ warn\/ trace\uff0c\u5bf9\u5e94\u7684\u63d0\u4f9b\u4e864\u4e2a\u5b8f\u6765\u8f93\u51fa\u4e0d\u540c\u7ea7\u522b\u7684\u65e5\u5fd7\u5230\u8c03\u8bd5\u901a\u9053\uff1aFIXME\/ ERR\/\u00a0WARN\/ TRACE\uff0c\u975e\u5e38\u7b80\u5355\u3001\u6e05\u6670\u3002<\/p>\n<blockquote><p>#define\u00a0__WINE_DPRINTF(dbcl,dbch)\u00a0\\<br \/>\ndo\u00a0{\u00a0if(__WINE_GET_DEBUGGING(dbcl,(dbch)))\u00a0{\u00a0\\<br \/>\nstruct\u00a0__wine_debug_channel\u00a0*\u00a0const\u00a0__dbch\u00a0=\u00a0(dbch);\u00a0\\<br \/>\nconst\u00a0enum\u00a0__wine_debug_class\u00a0__dbcl\u00a0=\u00a0__WINE_DBCL##dbcl;\u00a0\\<br \/>\n__WINE_DBG_LOG<\/p>\n<p>#define\u00a0__WINE_DBG_LOG(args...)\u00a0\\<br \/>\nwine_dbg_log(\u00a0__dbcl,\u00a0__dbch,\u00a0__FUNCTION__,\u00a0args);\u00a0}\u00a0}\u00a0while(0)<\/p>\n<p>#define\u00a0TRACE\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0__WINE_DPRINTF(_TRACE,__wine_dbch___default)<br \/>\n#define\u00a0TRACE_(ch)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0__WINE_DPRINTF(_TRACE,&amp;__wine_dbch_##ch)<br \/>\n#define\u00a0TRACE_ON(ch)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0__WINE_IS_DEBUG_ON(_TRACE,&amp;__wine_dbch_##ch)<\/p>\n<p>#define\u00a0WARN\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0__WINE_DPRINTF(_WARN,__wine_dbch___default)<br \/>\n#define\u00a0WARN_(ch)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0__WINE_DPRINTF(_WARN,&amp;__wine_dbch_##ch)<br \/>\n#define\u00a0WARN_ON(ch)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0__WINE_IS_DEBUG_ON(_WARN,&amp;__wine_dbch_##ch)<\/p>\n<p>#define\u00a0FIXME\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0__WINE_DPRINTF(_FIXME,__wine_dbch___default)<br \/>\n#define\u00a0FIXME_(ch)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0__WINE_DPRINTF(_FIXME,&amp;__wine_dbch_##ch)<br \/>\n#define\u00a0FIXME_ON(ch)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0__WINE_IS_DEBUG_ON(_FIXME,&amp;__wine_dbch_##ch)<\/p>\n<p>#define\u00a0ERR\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0__WINE_DPRINTF(_ERR,__wine_dbch___default)<br \/>\n#define\u00a0ERR_(ch)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0__WINE_DPRINTF(_ERR,&amp;__wine_dbch_##ch)<br \/>\n#define\u00a0ERR_ON(ch)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0__WINE_IS_DEBUG_ON(_ERR,&amp;__wine_dbch_##ch)<\/p><\/blockquote>\n<p>\u6700\u7ec8\u90fd\u662f\u8c03\u7528\u51fd\u6570 wine_dbg_log \u6765\u6253\u65e5\u5fd7\uff1a<\/p>\n<blockquote><p>int\u00a0wine_dbg_log(\u00a0enum\u00a0__wine_debug_class\u00a0cls,\u00a0struct\u00a0__wine_debug_channel\u00a0*channel,<br \/>\nconst\u00a0char\u00a0*func,\u00a0const\u00a0char\u00a0*format,\u00a0...\u00a0)<br \/>\n{<br \/>\nint\u00a0ret;<br \/>\nva_list\u00a0valist;<\/p>\n<p>if\u00a0(!(__wine_dbg_get_channel_flags(\u00a0channel\u00a0)\u00a0&amp;\u00a0(1\u00a0&lt;&lt;\u00a0cls)))\u00a0return\u00a0-1;<\/p>\n<p>va_start(valist,\u00a0format);<br \/>\nret\u00a0=\u00a0funcs.dbg_vlog(\u00a0cls,\u00a0channel,\u00a0func,\u00a0format,\u00a0valist\u00a0);<br \/>\nva_end(valist);<br \/>\nreturn\u00a0ret;<br \/>\n}<\/p><\/blockquote>\n<p>\u5176\u4e2d\u7684 funcs.dbg_vlog \u521d\u59cb\u5316\u65f6\u4f1a\u6307\u5411 default_dbg_vlog\uff1a<\/p>\n<blockquote><p>static\u00a0int\u00a0default_dbg_vlog(\u00a0enum\u00a0__wine_debug_class\u00a0cls,\u00a0struct\u00a0__wine_debug_channel\u00a0*channel,<br \/>\nconst\u00a0char\u00a0*func,\u00a0const\u00a0char\u00a0*format,\u00a0va_list\u00a0args\u00a0)<\/p><\/blockquote>\n<p>\u5728Wine\u7ebf\u7a0b\u521b\u5efa\u6210\u529f\u540e funcs.dbg_vlog \u4f1a\u6307\u5411 ntdll\/debugtools.c \u7684<\/p>\n<blockquote><p>\u00a0\u00a0static\u00a0int\u00a0NTDLL_dbg_vlog(\u00a0enum\u00a0__wine_debug_class\u00a0cls,\u00a0struct\u00a0__wine_debug_channel\u00a0*channel,<br \/>\nconst\u00a0char\u00a0*function,\u00a0const\u00a0char\u00a0*format,\u00a0va_list\u00a0args\u00a0)<\/p><\/blockquote>\n<p>&nbsp;<\/p>\n<h2><strong>\u7a0b\u5e8f\u8fd0\u884c\u524d\u5f00\u542f\u8c03\u8bd5\u901a\u9053<\/strong><\/h2>\n<p>\u7528\u8fd9\u6837\u7684\u683c\u5f0f\u5b9a\u4e49\u73af\u5883\u53d8\u91cf\uff1a<code>\u00a0WINEDEBUG=[class][+\/-]channel[,[class2][+\/-]channel2]<\/code><\/p>\n<p>\u5176\u4e2d\uff1a<\/p>\n<ul class=\"list-paddingleft-1\">\n<li><span class=\"wx_text_underline\">class\uff1a\u662f\u4ee3\u8868 <\/span><span class=\"wx_text_underline\">fixme\/ err\/ warn\/ trace<\/span><span class=\"wx_text_underline\"> \u8fd9\uff14\u4e2a\u65e5\u5fd7\u7ea7\u522b\u7684\u4e00\u4e2a\u5355\u8bcd\uff0c\u5982\u679c\u6ca1\u6709\u6307\u5b9a\u5c31\u5f00\u5173\u6240\u6709\u7684\u65e5\u5fd7\u7ea7\u522b\u3002<\/span><\/li>\n<li><span class=\"wx_text_underline\">channel\uff1a\u5c31\u662f\u8981\u5f00\u5173\u7684\u8c03\u8bd5\u901a\u9053\u7684\u540d\u79f0\uff0call \u4ee3\u8868\u6240\u6709\u7684\u901a\u9053\u3002<\/span><\/li>\n<li><span class=\"wx_text_underline\">+\uff1a\u5c31\u662f\u5f00\u542f\u6307\u5b9a\u8c03\u8bd5\u901a\u9053\u7684\u5bf9\u5e94\u7684\u65e5\u5fd7\u7ea7\u522b\u3002<\/span><\/li>\n<li><span class=\"wx_text_underline\">-\uff1a\u5c31\u662f\u5173\u95ed\u6307\u5b9a\u8c03\u8bd5\u901a\u9053\u7684\u5bf9\u5e94\u7684\u65e5\u5fd7\u7ea7\u522b\u3002<\/span><\/li>\n<\/ul>\n<p><span class=\"wx_text_underline\">\u4f8b\uff1a<\/span><\/p>\n<blockquote><p>WINEDEBUG=warn+all<br \/>\nWINEDEBUG=warn+dll,+heap<br \/>\nWINEDEBUG=fixme-all,warn+cursor,+relay<\/p><\/blockquote>\n<p>\u5982\u679c\u6ca1\u6709\u5b9a\u4e49<code>WINEDEBUG<\/code>\u73af\u5883\u53d8\u91cf\uff0c\u53d1\u7ed9\u6bcf\u4e2a\u8c03\u8bd5\u901a\u9053\u7684 fixme \u548c err \u7ea7\u522b\u7684\u65e5\u5fd7\u90fd\u4f1a\u8f93\u51fa\uff1bWine \u9ed8\u8ba4\u540c\u65f6\u5f00\u542f\u8fd0\u884c\u7684\u8c03\u8bd5\u901a\u9053\u662f 256\u4e2a\uff0c\u7531\u8fd9\u4e2a\u5b8f <code>MAX_DEBUG_OPTIONS<\/code> \u51b3\u5b9a\u3002<\/p>\n<p>\u5173\u952e\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<blockquote><p>enum\u00a0__wine_debug_class<br \/>\n{<br \/>\n__WINE_DBCL_FIXME,<br \/>\n__WINE_DBCL_ERR,<br \/>\n__WINE_DBCL_WARN,<br \/>\n__WINE_DBCL_TRACE,<\/p>\n<p>__WINE_DBCL_INIT\u00a0=\u00a07\u00a0\u00a0\/*\u00a0lazy\u00a0init\u00a0flag,\u00a0bit7\u00a0*\/<br \/>\n};<\/p>\n<p>static\u00a0unsigned\u00a0char\u00a0default_flags\u00a0=\u00a0(1\u00a0&lt;&lt;\u00a0__WINE_DBCL_ERR)\u00a0|\u00a0(1\u00a0&lt;name,\u00a0debug_options,\u00a0nb_debug_options,<br \/>\nsizeof(debug_options[0]),\u00a0cmp_name\u00a0);<br \/>\nif\u00a0(opt)\u00a0return\u00a0opt-&gt;flags;<br \/>\n}<br \/>\n\/*\u00a0no\u00a0option\u00a0for\u00a0this\u00a0channel\u00a0*\/<br \/>\nif\u00a0(channel-&gt;flags\u00a0&amp;\u00a0(1\u00a0&lt;flags\u00a0=\u00a0default_flags;<br \/>\nreturn\u00a0default_flags;<br \/>\n}<\/p><\/blockquote>\n<p>&nbsp;<\/p>\n<h2><strong>\u4ec5\u6807\u8bb0\u4f5c\u7528\u7684\u8c03\u8bd5\u901a\u9053<\/strong><\/h2>\n<ul class=\"list-paddingleft-1\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section>pid\uff1a\u5728\u6bcf\u4e2a\u65e5\u5fd7\u7684\u524d\u9762\u63d2\u5165\u5f53\u524d\u8fdb\u7a0b\u7684 ID\u53f7\uff0c\u683c\u5f0f\uff1a%04x\u3002<\/section>\n<\/li>\n<li>\n<section>tid\uff1a\u5728\u6bcf\u4e2a\u65e5\u5fd7\u7684\u524d\u9762\u63d2\u5165\u5f53\u524d\u7ebf\u7a0b\u7684 ID\u53f7\uff0c\u683c\u5f0f\uff1a%04x\u3002<\/section>\n<\/li>\n<li>\n<section>timestamp\uff1a\u5728\u6bcf\u4e2a\u65e5\u5fd7\u7684\u524d\u9762\u63d2\u5165\u65f6\u95f4\u6233\uff0c\u76f8\u5bf9\u7cfb\u7edf\u542f\u52a8\u7684\u65f6\u95f4\u3001\u5355\u4f4d\u79d2\u3001\u4fdd\u75593\u4f4d\u5c0f\u6570\u3002<\/section>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h2><strong>\u6bd4\u8f83\u7279\u6b8a\u7684\u9ad8\u7ea7\u8c03\u8bd5\u901a\u9053<\/strong><\/h2>\n<ul>\n<li>seh\uff1a\u8bb0\u5f55\u6240\u6709\u7684\u5f02\u5e38\u60c5\u51b5\uff0c\u5feb\u901f\u5b9a\u4f4d\u7a0b\u5e8f\u5d29\u6e83\u5730\u5740\u3002<\/li>\n<\/ul>\n<blockquote><p>0009:trace:seh:raise_exception\u00a0code=c00002b5\u00a0flags=0\u00a0addr=0xc4194be\u00a0ip=0c4194be\u00a0tid=0009<br \/>\n0009:trace:seh:raise_exception\u00a0\u00a0info[0]=00000000<br \/>\n0009:trace:seh:raise_exception\u00a0\u00a0eax=00000006\u00a0ebx=0b6f4f58\u00a0ecx=08b44020\u00a0edx=0033d15c\u00a0esi=0dfde520\u00a0edi=0df80020<br \/>\n0009:trace:seh:raise_exception\u00a0\u00a0ebp=0033d0d0\u00a0esp=0033d0c0\u00a0cs=0023\u00a0ds=002b\u00a0es=002b\u00a0fs=0063\u00a0gs=006b\u00a0flags=00210206<\/p><\/blockquote>\n<ul>\n<li>relay\uff1a\u65e0\u9700\u4fee\u6539\u4ee3\u7801\uff0c\u8bb0\u5f55\u7a0b\u5e8f\u8c03\u7528 Wine \u5b9e\u73b0\u7684\u6240\u6709 API \u7684\u8be6\u7ec6\u53c2\u6570\u548c\u8fd4\u56de\u503c\u3002<\/li>\n<\/ul>\n<blockquote><p>...<br \/>\n0017:Call\u00a0KERNEL32.CreateFileA(7ea8e936\u00a0\"CONIN$\",c0000000,00000003,00000000,00000003,00000000,00000000)\u00a0ret=7ea323fd<br \/>\n0017:Ret\u00a0\u00a0KERNEL32.CreateFileA()\u00a0retval=00000023\u00a0ret=7ea323fd<br \/>\n...<\/p><\/blockquote>\n<ul>\n<li>snoop\uff1a\u65e0\u9700\u4fee\u6539\u4ee3\u7801\uff0c\u8bb0\u5f55\u7a0b\u5e8f\u5bf9\u7b2c\u4e09\u65b9 native \u6a21\u5757\u7684\u6240\u6709\u5bfc\u51fa\u51fd\u6570\u7684\u8c03\u7528\u53c2\u6570\u548c\u8fd4\u56de\u503c\u3002<\/li>\n<\/ul>\n<p>Snoop \u662f\u81ea\u5df1\u68c0\u67e5 stack \u6570\u636e\u548c\u53cd\u6c47\u7f16\u6765\u63a2\u6d4b\u51fd\u6570\u8c03\u7528\u7ea6\u5b9a\u3001\u53c2\u6570\u548c\u8fd4\u56de\u5730\u5740\u7684\uff0c \u5982\u679c\u63a2\u6d4b\u9519\u4e86\u4f1a\u5f71\u54cd\u7a0b\u5e8f\u7684\u7a33\u5b9a\uff0c\u751a\u81f3\u5bfc\u81f4\u7a0b\u5e8f\u5d29\u6e83\uff0c\u5efa\u8bae\u4ec5\u5728\u975e\u5e38\u89c4\u60c5\u51b5\u4e0b\u4f7f\u7528\u3002<\/p>\n<blockquote><p>...<br \/>\ntrace:snoop:SNOOP_SetupDLL\u00a0hmod=0x4ae90000,\u00a0name=gdiplus.dll<br \/>\n0043:CALL\u00a0MSVCR100_CLR0400.wcscpy_s(04b7c808,0000000c,0033d188\u00a0L\"gdiplus.dll\")\u00a0ret=79203d6b<br \/>\n0043:RET\u00a0\u00a0MSVCR100_CLR0400.wcscpy_s()\u00a0retval=00000000\u00a0ret=79203d6b<br \/>\n0043:CALL\u00a0MSVCR100_CLR0400.memset(0033dc9c,00000000,00000010)\u00a0ret=792bd727<br \/>\n0043:RET\u00a0\u00a0MSVCR100_CLR0400.memset()\u00a0retval=0033dc9c\u00a0ret=792bd727<br \/>\n0043:CALL\u00a0gdiplus.GdiplusStartup()\u00a0ret=04b8e775<br \/>\n0043:RET\u00a0\u00a0gdiplus.GdiplusStartup(03c00ae0,0033dc9c,0033dcec)\u00a0retval=00000000\u00a0ret=04b8e775<br \/>\n...<br \/>\n0043:CALL\u00a0gdiplus.GdipCreateFromHWND()\u00a0ret=04b8e8b3<br \/>\n0043:RET\u00a0\u00a0gdiplus.GdipCreateFromHWND(0004003a,0033e988)\u00a0retval=00000000\u00a0ret=04b8e8b3<br \/>\n...<\/p><\/blockquote>\n<p>Relay \u548c snoop \u7684\u7f3a\u70b9\u662f\u8bb0\u5f55\u7684\u65e5\u5fd7\u5de8\u5927\u5bfc\u81f4\u7a0b\u5e8f\u53cd\u5e94\u975e\u5e38\u6162\uff0c\u53ea\u5efa\u8bae\u5728\u6ca1\u6709\u4efb\u4f55\u601d\u8def\u3001\u4e00\u7b79\u83ab\u5c55\u65f6\u4f7f\u7528\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2><strong>\u7a0b\u5e8f\u8fd0\u884c\u4e2d\u52a8\u6001\u5f00\u5173\u8c03\u8bd5\u901a\u9053<\/strong><\/h2>\n<ul>\n<li>\n<section>\u65b9\u6cd51\uff1a\u8fd0\u884c\u4efb\u52a1\u7ba1\u7406\u5668(wine taskmgr)\uff0c\u6253\u5f00\u201c\u8fdb\u7a0b\u201d\u6807\u7b7e\u9875\uff0c\u53f3\u952e\u9009\u4e2d\u8fdb\u7a0b\uff0c\u5728\u53f3\u952e\u83dc\u5355\u91cc\u9762\u9009\u4e2d\u201c\u7f16\u8f91\u8c03\u8bd5\u9891\u9053\u201d\u3002\u8fd9\u4e2a\u65b9\u6cd5\u53ea\u80fd\u5f00\u5173\u4e8b\u5148\u5728<code>WINEDEBUG<\/code>\u73af\u5883\u53d8\u91cf\u91cc\u9762\u5217\u51fa\u7684\u8c03\u8bd5\u901a\u9053\u3002<\/section>\n<\/li>\n<li>\n<section>\u65b9\u6cd52\uff1a\u5728 Winedbg \u91cc attach \u6307\u5b9a\u7684 Wine \u8fdb\u7a0b\uff0c\u7136\u540e\u7528 set \u547d\u4ee4\uff1a<\/section>\n<p>&nbsp;<\/li>\n<\/ul>\n<p>1. set + channel\uff1a\u5f00\u542f\u6307\u5b9a\u901a\u9053\u7684\u6240\u6709 fixme\/ err\/ warn\/ trace \u65e5\u5fd7\u3002<\/p>\n<p>2. set - channel\uff1a\u5173\u95ed\u6307\u5b9a\u901a\u9053\u7684\u6240\u6709 fixme\/ err\/ warn\/ trace \u65e5\u5fd7\u3002<\/p>\n<p>3. set class + channel\uff1a\u5f00\u542f\u6307\u5b9a\u901a\u9053\u7684\u00a0fixme\/ err\/ warn\/ trace\u00a0\u65e5\u5fd7\u4e2d\u7684\u67d0\u4e00\u7c7b\u3002class \u66ff\u6362\u4e3a\u00a0fixme\/ err\/ warn\/ trace\u00a0\u8fd94\u4e2a\u5355\u8bcd\u4e2d\u7684\u4efb\u610f\u4e00\u4e2a\u3002<\/p>\n<p>4. set class - channel\uff1a\u5173\u95ed\u6307\u5b9a\u901a\u9053\u7684\u00a0fixme\/ err\/ warn\/ trace\u00a0\u65e5\u5fd7\u4e2d\u7684\u67d0\u4e00\u7c7b\u3002<\/p>\n<p>Winedbg \u7684 set \u547d\u4ee4\u4e5f\u53ea\u80fd\u8bbe\u7f6e\u5728<code>WINEDEBUG<\/code>\u5df2\u7ecf\u5f00\u542f\u4e86\u7684\u8c03\u8bd5\u901a\u9053\u3002\u5982\u679c\u6ca1\u6709\u5728<code>WINEDEBUG<\/code>\u91cc\u9762\u5b9a\u4e49\u7684\uff0c\u5c31\u4f1a\u63d0\u793a: <code>Unable to find debug channel xxx<\/code> \u3002<\/p>\n<ul>\n<li>\n<section>\u65b9\u6cd53\uff1a\u5728\u00a0Winedbg \u91cc\u00a0attach \u6307\u5b9a\u7684 Wine \u8fdb\u7a0b\uff0c\u624b\u52a8\u4fee\u6539<code>debug_options<\/code>\u548c<code>nb_debug_options<\/code>\u7684\u6570\u636e\u3002\u56e0\u4e3a<code>debug_options<\/code>\u662f\u6309\u7167\u8c03\u8bd5\u901a\u9053\u540d\u79f0\u5b57\u7b26\u4e32\u6bd4\u8f83\u6392\u5e8f\u7684\uff0c\u6240\u4ee5\u5f00\u542f\u591a\u4e2a\u901a\u9053\u9700\u8981\u624b\u52a8\u6392\u5e8f\u3002\u8fd9\u4e2a\u65b9\u6cd5\u9002\u5408\u8fd0\u884c\u7a0b\u5e8f\u65f6\u5fd8\u8bb0\u8bbe\u7f6e<code>WINEDEBUG<\/code>\uff0c\u4f46\u662f\u60f3\u67e5\u770b\u67d0\u4e2a\u8c03\u8bd5\u901a\u9053\u65e5\u5fd7\u65f6\u53c8\u4e0d\u60f3\u91cd\u65b0\u8fd0\u884c\u7a0b\u5e8f\u7684\u65f6\u5019\u4f7f\u7528\u3002<\/section>\n<p>&nbsp;<\/li>\n<\/ul>\n<blockquote><p>Wine-dbg&gt;set\u00a0+\u00a0win<br \/>\nUnable\u00a0to\u00a0find\u00a0debug\u00a0channel\u00a0win<br \/>\nWine-dbg&gt;p\u00a0debug_options[0]\n{flags=0,\u00a0name=\"\"}<br \/>\nWine-dbg);set\u00a0debug_options[0].flags=0xf<br \/>\nWine-dbg&gt;p\u00a0debug_options[0]\n{flags=f,\u00a0name=\"\"}<br \/>\nWine-dbg&gt;set\u00a0debug_options[0].name[0]='w'<br \/>\nWine-dbg&gt;set\u00a0debug_options[0].name[1]='i'<br \/>\nWine-dbg&gt;set\u00a0debug_options[0].name[2]='n'<br \/>\nWine-dbg&gt;set\u00a0debug_options[0].name[3]=\u00a00<br \/>\nWine-dbg&gt;p\u00a0debug_options[0]\n{flags=f,\u00a0name=\"\u6977n\"}<br \/>\nWine-dbg&gt;p\u00a0&amp;debug_options[0]\n0xf77092d0<br \/>\nWine-dbg&gt;x\u00a0\/s\u00a00xf77092d1<br \/>\nwin<br \/>\nWine-dbg&gt;p\u00a0nb_debug_options<br \/>\n0<br \/>\nWine-dbg&gt;set\u00a0nb_debug_options=1<\/p><\/blockquote>\n<ul class=\"list-paddingleft-1\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section>\u65b9\u6cd54\uff1a\u4e00\u822c\u6b63\u5f0f\u53d1\u5e03\u7684 libwine.so \u6ca1\u6709\u8c03\u8bd5\u7b26\u53f7\uff0c\u5c31\u53ea\u80fd\u53cd\u6c47\u7f16\u5b9a\u4f4d<code>debug_options<\/code>\u548c<code>nb_debug_options<\/code>\u7684\u5730\u5740\u3002<\/section>\n<\/li>\n<\/ul>\n<p>1.\u00a0 \u5148\u67e5\u8be2 __wine_dbg_get_channel_flags \u7684\u504f\u79fb\uff0creadelf -s libwine.so.1.0 | grep __wine_dbg \uff1a<\/p>\n<blockquote><p>109: 00005110\u00a0\u00a0\u00a0206 FUNC\u00a0\u00a0\u00a0\u00a0GLOBAL DEFAULT\u00a0\u00a0\u00a012 __wine_dbg_set_channel_fl@@WINE_1.0<br \/>\n166: 00005030\u00a0\u00a0\u00a0223 FUNC\u00a0\u00a0\u00a0\u00a0GLOBAL DEFAULT\u00a0\u00a0\u00a012 __wine_dbg_get_channel_fl@@WINE_1.0<br \/>\n172: 00005390\u00a0\u00a0\u00a0253 FUNC\u00a0\u00a0\u00a0\u00a0GLOBAL DEFAULT\u00a0\u00a0\u00a012 __wine_dbg_set_functions@@WINE_1.0<\/p><\/blockquote>\n<p>2.\u00a0 \u518d\u67e5\u8be2 libwine.so \u7684\u57fa\u5730\u5740\u5f97\u5230 __wine_dbg_get_channel_flags \u7684\u5730\u5740\uff1a<\/p>\n<blockquote><p>Wine-dbg&gt;info\u00a0share<br \/>\nModule\u00a0Address\u00a0\u00a0\u00a0Debug\u00a0info\u00a0Name\u00a0(23\u00a0modules)<br \/>\n...<br \/>\nELF\u00a0f75d5000-f778c000\u00a0Dwarf\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0libwine.so.1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0@,\/opt\/cxoffice\/bin\/..\/lib\/libwine.so.1<br \/>\n...<\/p><\/blockquote>\n<p>3. \u63a5\u7740\u770b __wine_dbg_get_channel_flags \u53cd\u6c47\u7f16\uff1a<\/p>\n<blockquote><p>Wine-dbg&gt;disass\u00a00xf75d5000+0x5030<br \/>\n0xf75da030\u00a0__wine_dbg_get_channel_flags\u00a0in\u00a0libwine.so.1:\u00a0push\u00a0ebp<br \/>\n0xf75da031\u00a0__wine_dbg_get_channel_flags+0x1\u00a0in\u00a0libwine.so.1:\u00a0mov\u00a0ebp,\u00a0esp<br \/>\n0xf75da033\u00a0__wine_dbg_get_channel_flags+0x3\u00a0in\u00a0libwine.so.1:\u00a0push\u00a0edi<br \/>\n0xf75da034\u00a0__wine_dbg_get_channel_flags+0x4\u00a0in\u00a0libwine.so.1:\u00a0push\u00a0esi<br \/>\n0xf75da035\u00a0__wine_dbg_get_channel_flags+0x5\u00a0in\u00a0libwine.so.1:\u00a0push\u00a0ebx<br \/>\n0xf75da036\u00a0__wine_dbg_get_channel_flags+0x6\u00a0in\u00a0libwine.so.1:\u00a0call\u00a00xf75d81a0<br \/>\n0xf75da03b\u00a0__wine_dbg_get_channel_flags+0xb\u00a0in\u00a0libwine.so.1:\u00a0add\u00a0ebx,\u00a00x19dfc5<br \/>\n0xf75da041\u00a0__wine_dbg_get_channel_flags+0x11\u00a0in\u00a0libwine.so.1:\u00a0sub\u00a0esp,\u00a00x1c<br \/>\n0xf75da044\u00a0__wine_dbg_get_channel_flags+0x14\u00a0in\u00a0libwine.so.1:\u00a0mov\u00a0ecx,\u00a0[ebx+0x134]\u00a0\u00a0--&gt;\u00a0nb_debug_options<br \/>\n0xf75da04a\u00a0__wine_dbg_get_channel_flags+0x1a\u00a0in\u00a0libwine.so.1:\u00a0cmp\u00a0ecx,\u00a00xffffffff<br \/>\n0xf75da04d\u00a0__wine_dbg_get_channel_flags+0x1d\u00a0in\u00a0libwine.so.1:\u00a0jz\u00a00xf75da0f0<br \/>\n0xf75da053\u00a0__wine_dbg_get_channel_flags+0x23\u00a0in\u00a0libwine.so.1:\u00a0test\u00a0ecx,\u00a0ecx<br \/>\n0xf75da055\u00a0__wine_dbg_get_channel_flags+0x25\u00a0in\u00a0libwine.so.1:\u00a0jz\u00a00xf75da0c0<br \/>\n0xf75da057\u00a0__wine_dbg_get_channel_flags+0x27\u00a0in\u00a0libwine.so.1:\u00a0mov\u00a0eax,\u00a0[ebp+0x8]\n0xf75da05a\u00a0__wine_dbg_get_channel_flags+0x2a\u00a0in\u00a0libwine.so.1:\u00a0mov\u00a0edi,\u00a0ecx<br \/>\n0xf75da05c\u00a0__wine_dbg_get_channel_flags+0x2c\u00a0in\u00a0libwine.so.1:\u00a0mov\u00a0dword\u00a0[ebp-0x1c],\u00a00x0<br \/>\n0xf75da063\u00a0__wine_dbg_get_channel_flags+0x33\u00a0in\u00a0libwine.so.1:\u00a0add\u00a0eax,\u00a00x1<br \/>\n0xf75da066\u00a0__wine_dbg_get_channel_flags+0x36\u00a0in\u00a0libwine.so.1:\u00a0mov\u00a0[ebp-0x24],\u00a0eax<br \/>\n0xf75da069\u00a0__wine_dbg_get_channel_flags+0x39\u00a0in\u00a0libwine.so.1:\u00a0lea\u00a0eax,\u00a0[ebx+0x260]\u00a0\u00a0--&gt;\u00a0debug_options<br \/>\n0xf75da06f\u00a0__wine_dbg_get_channel_flags+0x3f\u00a0in\u00a0libwine.so.1:\u00a0mov\u00a0[ebp-0x28],\u00a0eax<br \/>\n0xf75da072\u00a0__wine_dbg_get_channel_flags+0x42\u00a0in\u00a0libwine.so.1:\u00a0jmp\u00a00xf75da07f\u00a0\u00a0__wine_dbg_get_channel_flags+0x4f\u00a0in\u00a0libwine.so.1<br \/>\n0xf75d3074\u00a0__wine_dbg_get_channel_flags+0x44\u00a0in\u00a0libwine.so.1:\u00a0lea\u00a0esi,\u00a0[esi]\n...<br \/>\n0xf75d81a0:\u00a0mov\u00a0ebx,\u00a0[esp]\n0xf75d81a3:\u00a0ret<\/p><\/blockquote>\n<p>GCC \u4e60\u60ef\u901a\u8fc7 ebx \u5bc4\u5b58\u5668\u6765\u5f15\u7528\u5168\u5c40\u53d8\u91cf\uff0c\u6240\u4ee5<code>nb_debug_options<\/code>\u7684\u5730\u5740\u662f\uff1a<code>0xf75d303b+0x19dfc5+0x134<\/code>\uff1b<code>debug_options<\/code>\u7684\u5730\u5740\u662f\uff1a<code>0xf75d303b+0x19dfc5+0x260<\/code>\uff1b\u7136\u540e\u53c2\u8003\u65b9\u6cd5 2 \u7684 set \u547d\u4ee4\u4fee\u6539\u5185\u5b58\u5373\u53ef\u3002<\/p>\n<p>&nbsp;<\/p>\n<h1 style=\"text-align: center;\"><strong>Relay \u8c03\u8bd5\u901a\u9053\u5b9e\u73b0\u539f\u7406<\/strong><\/h1>\n<p>\u5728 LoadLibrary \u5185\u90e8\uff0c\u5982\u679c\u68c0\u67e5\u5230\u5df2\u7ecf\u5f00\u542f\u4e86 relay \u901a\u9053\uff0c\u5e76\u4e14\u5df2\u52a0\u8f7d Wine \u5185\u5efa\u7684 DLL \u6587\u4ef6\uff0c\u90a3\u4e48\u5c31\u8c03\u7528 RELAY_SetupDLL \u6765\u89e3\u6790 DLL \u7684\u5bfc\u51fa\u51fd\u6570\u8868\uff08IMAGE_DIRECTORY_ENTRY_EXPORT\uff09\u3002\u5bf9\u4e8e\u5bfc\u51fa\u8868\u4e2d\u7684 AddressOfFunctions \u6570\u7ec4\u4e2d\u7684\u6bcf\u4e2a\u6761\u76ee\uff0c\u5148\u5907\u4efd\u539f\u59cb\u503c\uff0c\u7136\u540e\u5c06\u6bcf\u4e2a\u6761\u76ee\u503c\u4fee\u6539\u4e3a\u53ef\u8df3\u8f6c relay_call \u51fd\u6570\u7684 hack \u51fd\u6570\u5730\u5740\u3002hack \u51fd\u6570\u5728 faked PE \u6a21\u5757\u4e2d\uff0c\u56fa\u5b9a\u4e3a 24 \u5b57\u8282\u5927\u5c0f\uff0c\u5f62\u5f0f\u5982\u4e0b\uff1a<\/p>\n<blockquote><p>0x7e7a4210:\u00a0push\u00a0esp<br \/>\n0x7e7a4211:\u00a0push\u00a00x50000<br \/>\n0x7e7a4216:\u00a0call\u00a00x7e7a6a40\u00a0\u00a0__wine_spec_get_pc_thunk_eax\u00a0in\u00a0gdi32<br \/>\n0x7e7a421b:\u00a0lea\u00a0eax,\u00a0[eax+0xadd31]\n0x7e7a4221:\u00a0push\u00a0eax<br \/>\n0x7e7a4222:\u00a0call\u00a0dword\u00a0[eax+0x4]\u00a0--&gt;\u00a0relay_call<br \/>\n0x7e7a4225:\u00a0ret\u00a00x14<\/p><\/blockquote>\n<p>\u4e0d\u540c\u7684 API \u53d8\u5316\u7684\u53ea\u662f\u91cc\u9762\u7684\u6570\u5b57\u5e38\u91cf\u3002\u5728 GetProcAddress \u5185\u90e8\u68c0\u67e5\u662f\u5426\u5f00\u542f\u4e86 relay \u901a\u9053\uff0c\u5982\u5df2\u5f00\u542f\u5c31\u8c03\u7528 RELAY_GetProcAddress \u8fd4\u56de hack \u7684\u51fd\u6570\u5730\u5740\u3002\u4ee5 user32 \u6a21\u5757\u7684GetMenu \u4e3e\u4f8b\uff0c\u8fd4\u56de\u7684 hack \u7684 GetMenu \u51fd\u6570\u5982\u4e0b\uff1a<\/p>\n<blockquote><p>FARPROC\u00a0RELAY_GetProcAddress(\u00a0HMODULE\u00a0module,\u00a0const\u00a0IMAGE_EXPORT_DIRECTORY\u00a0*exports,<br \/>\nDWORD\u00a0exp_size,\u00a0FARPROC\u00a0proc,\u00a0DWORD\u00a0ordinal,\u00a0const\u00a0WCHAR\u00a0*user\u00a0)<br \/>\n{<br \/>\nstruct\u00a0relay_private_data\u00a0*data;<br \/>\nconst\u00a0struct\u00a0relay_descr\u00a0*descr\u00a0=\u00a0(const\u00a0struct\u00a0relay_descr\u00a0*)((const\u00a0char\u00a0*)exports\u00a0+\u00a0exp_size);<\/p>\n<p>if\u00a0(descr-&gt;magic\u00a0!=\u00a0RELAY_DESCR_MAGIC\u00a0||\u00a0!(data\u00a0=\u00a0descr-&gt;private))\u00a0return\u00a0proc;\u00a0\u00a0\/*\u00a0no\u00a0relay\u00a0data\u00a0*\/<br \/>\nif\u00a0(!data-&gt;entry_points[ordinal].orig_func)\u00a0return\u00a0proc;\u00a0\u00a0\/*\u00a0not\u00a0a\u00a0relayed\u00a0function\u00a0*\/<br \/>\nif\u00a0(check_from_module(\u00a0debug_from_relay_includelist,\u00a0debug_from_relay_excludelist,\u00a0user\u00a0))<br \/>\nreturn\u00a0proc;\u00a0\u00a0\/*\u00a0we\u00a0want\u00a0to\u00a0relay\u00a0it\u00a0*\/<br \/>\nreturn\u00a0data-&gt;entry_points[ordinal].orig_func;<br \/>\n}<\/p>\n<p>Wine-dbg&gt;disass\u00a0proc<br \/>\n0x7e8d7cf0:\u00a0push\u00a0esp<br \/>\n0x7e8d7cf1:\u00a0push\u00a00x10130<br \/>\n0x7e8d7cf6:\u00a0call\u00a00x7e8dae44\u00a0\u00a0__wine_spec_get_pc_thunk_eax\u00a0in\u00a0user32<br \/>\n0x7e8d7cfb:\u00a0lea\u00a0eax,\u00a0[eax+0xd9fcd]\n0x7e8d7d01:\u00a0push\u00a0eax<br \/>\n0x7e8d7d02:\u00a0call\u00a0dword\u00a0[eax+0x4]\n0x7e8d7d05:\u00a0ret\u00a00x4<br \/>\nWine-dbg&gt;p\u00a00x7e8d7cfb+0xd9fcd+0x4<br \/>\n0x7e9b1ccc<br \/>\nWine-dbg&gt;x\u00a0\/4x\u00a00x7e9b1ccc<br \/>\n0x7e9b1ccc:\u00a0\u00a07bc76c2c\u00a07bc77270\u00a000124640\u00a07e8d615d<br \/>\nWine-dbg&gt;disass\u00a00x7bc76c2c<br \/>\n0x7bc76c2c\u00a0relay_call\u00a0in\u00a0ntdll:\u00a0push\u00a0ebp<br \/>\n0x7bc76c2d\u00a0relay_call+0x1\u00a0in\u00a0ntdll:\u00a0mov\u00a0ebp,\u00a0esp<br \/>\n0x7bc76c2f\u00a0relay_call+0x3\u00a0in\u00a0ntdll:\u00a0push\u00a0esi<br \/>\n0x7bc76c30\u00a0relay_call+0x4\u00a0in\u00a0ntdll:\u00a0push\u00a0edi<br \/>\n0x7bc76c31\u00a0relay_call+0x5\u00a0in\u00a0ntdll:\u00a0push\u00a0ecx<br \/>\n0x7bc76c32\u00a0relay_call+0x6\u00a0in\u00a0ntdll:\u00a0push\u00a0dword\u00a0[ebp+0x10]\n0x7bc76c35\u00a0relay_call+0x9\u00a0in\u00a0ntdll:\u00a0push\u00a0dword\u00a0[ebp+0xc]\n0x7bc76c38\u00a0relay_call+0xc\u00a0in\u00a0ntdll:\u00a0push\u00a0dword\u00a0[ebp+0x8]\n0x7bc76c3b\u00a0relay_call+0xf\u00a0in\u00a0ntdll:\u00a0call\u00a00x7bc76835\u00a0\u00a0relay_trace_entry\u00a0[..\/wine_git\/dlls\/ntdll\/relay.c:334]\u00a0in\u00a0ntdll<br \/>\n0x7bc76c40\u00a0relay_call+0x14\u00a0in\u00a0ntdll:\u00a0movzx\u00a0ecx,\u00a0byte\u00a0[ebp+0xe]\n...<\/p><\/blockquote>\n<p>\u539f\u59cb\u7684 GetMenu \u5730\u5740\uff1a<\/p>\n<blockquote><p>Wine-dbg&gt;info\u00a0local<br \/>\n0x7bc772f4\u00a0RELAY_GetProcAddress+0x75:\u00a0(0033eac8)<br \/>\nHMODULE\u00a0module=0x7e8d0000\u00a0(parameter\u00a0[EBP+8])<br \/>\nIMAGE_EXPORT_DIRECTORY*\u00a0exports=0x7e9ad19c\u00a0(parameter\u00a0[EBP+12])<br \/>\nDWORD\u00a0exp_size=0x4b2c\u00a0(parameter\u00a0[EBP+16])<br \/>\nFARPROC\u00a0proc=0x7e8d7cf0\u00a0(parameter\u00a0[EBP+20])<br \/>\nDWORD\u00a0ordinal=0x130\u00a0(parameter\u00a0[EBP+24])<br \/>\nWCHAR*\u00a0user=0x0(nil)\u00a0(parameter\u00a0[EBP+28])<br \/>\nstruct\u00a0relay_private_data*\u00a0data=0x124640\u00a0(local\u00a0[EBP-12])<br \/>\nstruct\u00a0relay_descr*\u00a0descr=0x7e9b1cc8\u00a0(local\u00a0[EBP-16])<br \/>\nWine-dbg&gt;p\u00a0*descr<br \/>\n{magic=0xdeb90001,\u00a0relay_call=0x7bc76c2c,\u00a0relay_call_regs=0x7bc77270,<br \/>\nprivate=0x124640,\u00a0entry_point_base=\"\u604c\u6032h\",\u00a0entry_point_offsets=0x7e9744f8,\u00a0arg_types=0x7e975048}<br \/>\nWine-dbg&gt;x\u00a0\/14x\u00a00x124640<br \/>\n0x00124640:\u00a0\u00a07e8d0000\u00a000000001\u00a072657375\u00a000003233<br \/>\n0x00124650:\u00a0\u00a000000000\u00a000000000\u00a000000000\u00a000000000<br \/>\n0x00124660:\u00a0\u00a000000000\u00a000000000\u00a000000000\u00a000000000<br \/>\n0x00124670:\u00a0\u00a07e913010\u00a07e9aee17<br \/>\nWine-dbg&gt;x\u00a0\/10x\u00a00x00124670+0x130*8<br \/>\n0x00124ff0:\u00a0\u00a07e928890\u00a07e9b018c\u00a07e92c6d0\u00a07e9b0194<br \/>\n0x00125000:\u00a0\u00a07e927fc0\u00a07e9b01a3\u00a07e92cc30\u00a07e9b01be<br \/>\n0x00125010:\u00a0\u00a07e92b680\u00a07e9b01d3<br \/>\nWine-dbg&gt;x\u00a0\/10c\u00a00x7e9b018c<br \/>\n0x7e9b018c:\u00a0\u00a0G\u00a0e\u00a0t\u00a0M\u00a0e\u00a0n\u00a0u\u00a0\u00a0\u00a0G\u00a0e<br \/>\nWine-dbg&gt;disass\u00a00x7e928890<br \/>\n0x7e928890\u00a0GetMenu\u00a0[..\/wine_git\/dlls\/user32\/menu.c:4208]\u00a0in\u00a0user32:\u00a0lea\u00a0ecx,\u00a0[esp+0x4]\n0x7e928894\u00a0GetMenu+0x4\u00a0[..\/wine_git\/dlls\/user32\/menu.c:4208]\u00a0in\u00a0user32:\u00a0and\u00a0esp,\u00a00xfffffff0<br \/>\n0x7e928897\u00a0GetMenu+0x7\u00a0[..\/wine_git\/dlls\/user32\/menu.c:4208]\u00a0in\u00a0user32:\u00a0push\u00a0dword\u00a0[ecx-0x4]\n0x7e92889a\u00a0GetMenu+0xa\u00a0[..\/wine_git\/dlls\/user32\/menu.c:4208]\u00a0in\u00a0user32:\u00a0push\u00a0ebp<br \/>\n0x7e92889b\u00a0GetMenu+0xb\u00a0[..\/wine_git\/dlls\/user32\/menu.c:4208]\u00a0in\u00a0user32:\u00a0mov\u00a0ebp,\u00a0esp<br \/>\n0x7e92889d\u00a0GetMenu+0xd\u00a0[..\/wine_git\/dlls\/user32\/menu.c:4208]\u00a0in\u00a0user32:\u00a0push\u00a0edi<br \/>\n0x7e92889e\u00a0GetMenu+0xe\u00a0[..\/wine_git\/dlls\/user32\/menu.c:4208]\u00a0in\u00a0user32:\u00a0push\u00a0esi<br \/>\n0x7e92889f\u00a0GetMenu+0xf\u00a0[..\/wine_git\/dlls\/user32\/menu.c:4208]\u00a0in\u00a0user32:\u00a0push\u00a0ebx<br \/>\n0x7e9288a0\u00a0GetMenu+0x10\u00a0[..\/wine_git\/dlls\/user32\/menu.c:4208]\u00a0in\u00a0user32:\u00a0push\u00a0ecx<br \/>\n0x7e9288a1\u00a0GetMenu+0x11\u00a0[..\/wine_git\/dlls\/user32\/menu.c:4208]\u00a0in\u00a0user32:\u00a0call\u00a00x7e8d5b60\u00a0\u00a0__x86.get_pc_thunk.bx\u00a0in\u00a0user32<br \/>\n...<\/p><\/blockquote>\n<p>Relay_call \u91cc\u9762\u8c03\u7528 relay_trace_entry\/relay_trace_exit \u6765\u8bb0\u5f55\u51fd\u6570\u7684\u8fdb\u548c\u51fa\uff0c\u4ee5\u53ca\u8c03\u7528\u771f\u5b9e\u7684API\u3002<\/p>\n<p>&nbsp;<\/p>\n<h1 style=\"text-align: center;\"><strong>Snoop \u8c03\u8bd5\u901a\u9053\u7684\u5b9e\u73b0\u539f\u7406<\/strong><\/h1>\n<p>\u5728 LoadLibrary \u5185\u90e8\u68c0\u67e5\u5230\u5df2\u5f00\u542f snoop \u901a\u9053\u5e76\u4e14\u52a0\u8f7d\u4e86 native \u7684 DLL\uff0c\u5c31\u8c03\u7528 SNOOP_SetupDLL \u89e3\u6790 DLL \u7684\u5bfc\u51fa\u51fd\u6570\uff0c\u5bf9\u6bcf\u4e2a\u5bfc\u51fa\u51fd\u6570\u52a8\u6001\u5206\u914d\u4e00\u5757\u53ef\u8bfb\u5199\u548c\u6267\u884c\u7684 hack \u5185\u5b58\u3002<\/p>\n<p>\u5728 GetProcAddress \u5185\u90e8\u68c0\u67e5\u5230\u5df2\u5f00\u542f snoop \u901a\u9053\uff0c\u5c31\u8c03\u7528 SNOOP_GetProcAddress\uff0c\u5bf9 hack \u5185\u5b58\u586b\u5145\u4e00\u4e2a\u53ef\u4ee5\u8df3\u5230 SNOOP_Entry \u51fd\u6570\u7684 jmp \u6307\u4ee4\uff0c\u7136\u540e\u8fd4\u56de\u8fd9\u4e2a hack \u5185\u5b58\u5757\u7684\u9996\u5730\u5740\u3002<\/p>\n<p>SNOOP_Entry \u63a2\u6d4b\u51fd\u6570\u7684\u8fd4\u56de\u5730\u5740\u3001\u8c03\u7528\u7ea6\u5b9a\u3001\u8c03\u7528\u53c2\u6570\uff0c\u6253\u5370\u51fa\u6765\uff0c\u7136\u540e\u628a\u5f53\u524d EIP \u8bbe\u7f6e\u6210\u771f\u5b9e\u7684\u5bfc\u51fa\u51fd\u6570\uff0c\u628a\u8fd4\u56de\u5730\u5740\u8bbe\u7f6e\u4e3a SNOOP_Return\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u603b\u4e4b\uff0c\u5728\u89e3\u51b3\u5b9e\u9645\u95ee\u9898\u7684\u65f6\u5019\uff0c \u6211\u4eec\u5148\u6536\u96c6\u65e5\u5fd7\uff0c\u7136\u540e\u91cd\u70b9\u770b err:\u3001fixme:\u3001seh: \u7684\u65e5\u5fd7\uff0c\u4e00\u822c\u80fd\u4ece\u4e2d\u627e\u5230\u95ee\u9898\u7684\u76f8\u5173\u7ebf\u7d22\u3002<\/p>\n<p>&nbsp;<\/p>\n<h1><strong>\u76f8\u5173\u9605\u8bfb\uff1a<\/strong><\/h1>\n<p>\uff081\uff09<a href=\"https:\/\/distrowatch.com\/table.php?distribution=deepin\">\u652f\u6301 deepin\uff08\u6df1\u5ea6\uff09\u793e\u533a<\/a><\/p>\n<p>\uff082\uff09<a href=\"https:\/\/www.deepin.org\/zh\/getting-started-with-wine\/\">Wine \u5f00\u53d1\u7cfb\u5217 -01<\/a><\/p>\n<p>\uff083\uff09<a href=\"https:\/\/www.deepin.org\/zh\/category\/technology-sharing\/\">deepin \u6280\u672f\u5206\u4eab\u5408\u96c6<\/a><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: right;\">\u5185\u5bb9\u6765\u6e90\uff1adeepin\uff08\u6df1\u5ea6\uff09\u793e\u533a<\/p>\n<p style=\"text-align: right;\">\u8f6c\u8f7d\u8bf7\u6ce8\u660e\u51fa\u5904<\/p>","protected":false},"excerpt":{"rendered":"<p>\u8f93\u51fa\u8c03\u8bd5\u65e5\u5fd7\u662f\u8c03\u8bd5\u7a0b\u5e8f\u7684\u4e00\u79cd\u5e38\u89c1\u65b9\u6cd5\uff0c\u5c24\u5176\u662f\u5904\u7406\u90a3\u4e9b\u96be\u4ee5\u6349\u6478\u7684\u591a\u7ebf\u7a0b\u9519\u8bef\u3001\u968f\u673a\u5d29\u6e83\u7b49\u95ee\u9898\u65f6 \u3002\u901a\u8fc7\u5728\u5408\u9002\u7684\u4f4d\u7f6e\u8f93\u51fa\u8c03\u8bd5\u65e5\u5fd7\uff0c\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u66f4\u5feb\u5730\u5b9a\u4f4d\u95ee\u9898\u6240\u5728\u3002 \u5bf9\u4e8e\u4e0d\u719f\u6089\u7684\u4ee3\u7801\uff0c\u7ecf\u5e38\u6253\u65e5\u5fd7\u4e5f\u6709\u52a9\u4e8e\u5feb\u901f\u7406\u89e3\u4ee3\u7801\u7684\u6267\u884c\u6d41\u7a0b\u548c\u529f\u80fd\u3002\u5728\u5927\u578b\u9879\u76ee\u4e2d\uff0c\u901a\u5e38\u4f1a\u5148\u5b9e\u73b0\u4e00\u5957\u81ea\u5df1\u7684\u8c03\u8bd5\u65e5\u5fd7\u6846\u67b6\uff0c\u4e3b\u8981\u6709\u4e24\u4e2a\u76ee\u7684\uff1a \u7edf\u4e00\u65e5\u5fd7\u98ce\u683c\u548c\u5b58\u50a8\uff1a\u786e\u4fdd\u65e5\u5fd7\u683c\u5f0f\u4e00\u81f4\uff0c\u5e76\u4e14\u6709\u7edf\u4e00\u7684\u5b58\u50a8\u65b9\u5f0f\uff0c\u8fd9\u6709\u52a9\u4e8e\u7528\u6237\u66f4\u5bb9\u6613\u5730\u62a5\u544a\u95ee\u9898\u3002 \u65b9\u4fbf\u5f00\u53d1\u4eba\u5458\uff1a\u5f00 ...<a href=https:\/\/www.deepin.org\/zh\/debug-problems-with-wine-logs\/>\u9605\u8bfb\u66f4\u591a<\/a><\/p>\n","protected":false},"author":11164,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[155],"tags":[],"_links":{"self":[{"href":"https:\/\/www.deepin.org\/zh\/wp-json\/wp\/v2\/posts\/35937"}],"collection":[{"href":"https:\/\/www.deepin.org\/zh\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.deepin.org\/zh\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.deepin.org\/zh\/wp-json\/wp\/v2\/users\/11164"}],"replies":[{"embeddable":true,"href":"https:\/\/www.deepin.org\/zh\/wp-json\/wp\/v2\/comments?post=35937"}],"version-history":[{"count":2,"href":"https:\/\/www.deepin.org\/zh\/wp-json\/wp\/v2\/posts\/35937\/revisions"}],"predecessor-version":[{"id":35943,"href":"https:\/\/www.deepin.org\/zh\/wp-json\/wp\/v2\/posts\/35937\/revisions\/35943"}],"wp:attachment":[{"href":"https:\/\/www.deepin.org\/zh\/wp-json\/wp\/v2\/media?parent=35937"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.deepin.org\/zh\/wp-json\/wp\/v2\/categories?post=35937"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.deepin.org\/zh\/wp-json\/wp\/v2\/tags?post=35937"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}