{"id":3618,"date":"2016-03-12T13:29:13","date_gmt":"2016-03-12T05:29:13","guid":{"rendered":"http:\/\/blog.qdac.cc\/?p=3618"},"modified":"2016-03-12T13:29:13","modified_gmt":"2016-03-12T05:29:13","slug":"qamf-qamf-%e7%9a%84%e5%9f%ba%e6%9c%ac%e7%94%a8%e6%b3%95%e7%a4%ba%e4%be%8b","status":"publish","type":"post","link":"https:\/\/blog.qdac.cc\/?p=3618","title":{"rendered":"[QAMF] QAMF \u7684\u57fa\u672c\u7528\u6cd5\u793a\u4f8b"},"content":{"rendered":"<p>QAMF \u662f QDAC \u9879\u76ee\u4e2d\u7684\u4e00\u4e2a\u65b0\u6210\u5458\uff0c\u7528\u6765\u652f\u6301 AMF \u683c\u5f0f\u7684\u89e3\u6790\u3002\u53d7\u9650\u4e8e\u4f5c\u8005\u624b\u5934\u7684 AMF \u8d44\u6599\u7684\u6b20\u7f3a\uff0c\u53ef\u80fd\u6709\u4e9b\u5b9e\u73b0\u5e76\u4e0d\u4e00\u5b9a 100% \u6b63\u786e\uff0c\u5982\u679c\u5927\u5bb6\u5728\u4f7f\u7528\u8fc7\u7a0b\u4e2d\u53d1\u73b0\u4ec0\u4e48\u95ee\u9898\uff0c\u8bf7\u63d0\u4f9b\u4e00\u4e2a\u5177\u4f53\u7684\u8be6\u7ec6\u6d4b\u8bd5\u7528\u4f8b\uff0c\u5e76\u8bf7\u8bf4\u660e\uff1a<\/p>\n<blockquote><p>1\u3001\u539f\u59cb\u9700\u8981\u89e3\u6790\u6216\u751f\u6210\u7684\u6570\u636e\u5305\uff1b<\/p>\n<p>2\u3001\u91cd\u73b0\u95ee\u9898\u7684\u6d4b\u8bd5\u7a0b\u5e8f<\/p>\n<p>3\u3001\u95ee\u9898\u7684\u5177\u4f53\u63cf\u8ff0<\/p><\/blockquote>\n<p>\u518d\u6b21\u611f\u8c22\u5927\u5bb6\u5bf9 QDAC \u9879\u76ee\u7684\u652f\u6301\uff0c\u73b0\u5728\u8bf4\u660e\u4e00\u4e0b QAMF \u7684\u57fa\u672c\u7528\u6cd5\uff1a<\/p>\n<p>1\u3001\u89e3\u6790\u4e00\u4e2a\u5e26\u6709\u534f\u8bae\u5934\u90e8\u7684 AMF \u683c\u5f0f\u6570\u636e\u6d41\uff1a<\/p>\n<p>\u8fd9\u79cd\u683c\u5f0f\u7684\u6570\u636e\u6d41\uff0c\u5e26\u6709\u5b8c\u6574\u7684 AMF \u534f\u8bae\u5934\u90e8\uff0c\u800c\u4e0d\u662f\u5355\u7eaf\u7684\u6570\u636e\u5185\u5bb9\u3002QAMF \u63d0\u4f9b\u4e86\u4ee5\u4e0b\u51e0\u79cd\u65b9\u5f0f\u6765\u5b8c\u6210\u89e3\u6790\uff1a<\/p>\n<ul>\n<li>Parse\/TryParse<br \/>\nTryParse \u4f1a\u5c1d\u8bd5\u89e3\u6790\u5185\u5b58\u4e2d\u7684\u534f\u8bae\u6570\u636e\uff0c\u5982\u679c\u65e0\u6cd5\u6b63\u786e\u89e3\u6790\uff0c\u5219\u8fd4\u56de False\uff0c\u89e3\u6790\u6210\u529f\uff0c\u5219\u8fd4\u56de True\u3002\u800c Parse \u5219\u5728\u89e3\u6790\u5931\u8d25\u65f6\u629b\u51fa\u5f02\u5e38\u3002\u8bf7\u6839\u636e\u5b9e\u9645\u9700\u8981\u9009\u62e9\u3002<\/li>\n<li>LoadFromStream\/LoadFromFile<br \/>\n\u76f4\u63a5\u4ece\u6d41\u6216\u6587\u4ef6\u4e2d\u89e3\u6790 AMF \u6570\u636e\u3002\u5982\u679c\u89e3\u6790\u5931\u8d25\uff0c\u5219\u629b\u51fa\u5f02\u5e38\u3002<\/li>\n<\/ul>\n<p>\u8fd9\u79cd\u683c\u5f0f\u7684\u6570\u636e\u6d41\u7684\u683c\u5f0f\uff0c\u5305\u542b\u4e09\u4e2a\u7ec4\u6210\u90e8\u5206\uff1a<\/p>\n<ul>\n<li>\u6587\u4ef6\u5934<br \/>\n\u6587\u4ef6\u5934\u5305\u542b\u7248\u672c\u53f7\uff1a\u4e24\u4e2a\u5b57\u8282\uff0c\u4ee3\u8868\u534f\u8bae\u7684\u7248\u672c 00 03 \u4ee3\u8868\u662f AMF3\uff0c 00 00 \u4ee3\u8868 AMF 0\u3002\u4f46\u5b9e\u9645\u4e0a\u8fd9\u4e2a\u7248\u672c\u6807\u8bb0\u610f\u4e49\u4e0d\u5927\u3002\u56e0\u4e3a\u9ed8\u8ba4\u7684\u5b58\u8d2e\u662f\u4ee5AMF 0 \u6570\u636e\u5f00\u59cb\uff0c\u7136\u540e\u6839\u636e\u9700\u8981\u4e34\u65f6\u5207\u6362\u5230 AMF3 \u683c\u5f0f\u7684\u3002<\/li>\n<li>\u5934\u90e8\u5217\u8868<br \/>\n\u9996\u5148\u662f\u4e00\u4e2a BE \u7f16\u7801\u768416\u4f4d\u65e0\u7b26\u53f7\u6574\u6570\uff0c\u6765\u6807\u8bb0\u5934\u90e8\u7684\u6570\u91cf\u3002\u4e00\u822c\u5e38\u89c1\u7684\u6570\u636e\u5305\u8fd9\u91cc\u90fd\u662f0\uff0c\u5982\u679c\u4e0d\u662f0\uff0c\u5219\u540e\u9762\u662f\u5177\u4f53\u7684\u534f\u8bae\u5934\u90e8\u5b9a\u4e49\uff1a<br \/>\n\uff081\uff09\u3001\u4e00\u4e2a AMF0 \u5b57\u7b26\u4e32\u6765\u8bb0\u5f55\u5934\u90e8\u540d\u79f0<br \/>\n\uff082\uff09\u3001\u4e00\u4e2aAMF0 \u6570\u636e\u5b9e\u4f53\u8bb0\u5f55\u5177\u4f53\u7684\u5934\u90e8\u5185\u5bb9<\/li>\n<li>\u6d88\u606f\u6570\u636e\u5217\u8868<br \/>\n\u9996\u5148\u662f\u4e00\u4e2a BE \u7f16\u7801\u768416\u4f4d\u65e0\u7b26\u53f7\u6574\u6570\uff0c\u6765\u6807\u8bb0\u6d88\u606f\u7684\u6570\u91cf\uff0c\u7136\u540e\u540e\u9762\u8ddf\u5177\u4f53\u7684 AMF 0 \u683c\u5f0f\u7684\u6570\u636e\u5185\u5bb9\u3002\u5e38\u89c1\u7684\u683c\u5f0f\u5c01\u88c5\u5728\u8fd9\u91cc\u76f4\u63a5\u4ee5 0x11 \u5f00\u59cb\uff0c\u8f6c\u5165 AMF 3 \u683c\u5f0f\u7684\u5bf9\u8c61\uff0c\u4e5f\u6709\u7684\u662f\u4ee5 AMF0 \u6570\u7ec4\u5f00\u59cb\uff0c\u7136\u540e\u6570\u7ec4\u91cc\u9762\u662f AMF 3 \u683c\u5f0f\u7684\u5bf9\u8c61\u5217\u8868\u3002<\/li>\n<\/ul>\n<p>2\u3001\u89e3\u6790\u6ca1\u6709\u5934\u90e8\u6807\u8bb0\u7684\u7eaf\u6d88\u606f\u6570\u636e\u6d41<\/p>\n<p>\u8fd9\u79cd\u683c\u5f0f\u7684\u6570\u636e\u6d41\uff0c\u7528\u6237\u5fc5\u9700\u660e\u786e\u77e5\u9053\u5b83\u662f AMF 0 \u8fd8\u662f AMF 3 \u683c\u5f0f\u7684\uff0c\u5426\u5219\u5c31\u4f1a\u89e3\u6790\u5931\u8d25\u3002QAMF \u63d0\u4f9b\u4e86\u4e24\u4e2a\u51fd\u6570\u5206\u522b\u5bf9\u5e94\u8fd9\u4e2a\u89e3\u6790\uff1a<\/p>\n<ul>\n<li>ParseAMF3Data\/TryParseAMF3Data<br \/>\n\u89e3\u6790 AMF 3 \u683c\u5f0f\u7684\u6570\u636e\u5185\u5bb9\uff0c\u81f3\u4e8e\u52a0 Try \u7684\u533a\u522b\uff0c\u53c2\u8003\u4e0a\u9762\u7684\u63cf\u8ff0\uff1b<\/li>\n<li>ParseAMF0Data\/TryParseAMF0Data<br \/>\n\u89e3\u6790 AMF 0 \u683c\u5f0f\u7684\u6570\u636e\u5185\u5bb9\u3002<\/li>\n<\/ul>\n<p>\u6ce8\u610f\u4e00\u70b9\uff0c\u89e3\u6790\u65f6\uff0c\u4f1a\u5728 TQAMF \u5bf9\u8c61\u7684 Messages \u91cc\u521b\u5efa\u4e00\u4e2a\u5b50\u7ed3\u70b9\uff0c\u7136\u540e\u5c06\u89e3\u6790\u7684\u7ed3\u70b9\u4fdd\u5b58\u5230\u76f8\u5e94\u7684\u5b50\u7ed3\u70b9\u4e0b\u9762\u3002<\/p>\n<p>3\u3001\u7f16\u7801 AMF \u6570\u636e\u6d41<\/p>\n<p>QAMF \u76ee\u524d\u7684\u5185\u6d4b\u7248\u672c\u7f16\u7801\u5b58\u5728\u4e00\u4e9b\u9650\u5236\uff0c\u5982\uff1a\u5bf9\u8c61\u53ea\u4f1a\u7f16\u7801\u4e3a\u52a8\u6001\u5185\u8054\u7684\u5bf9\u8c61\uff08\u683c\u5f0f\u6807\u8bb0\u4e3a11\uff09\uff0c\u800c\u4e0d\u4f1a\u652f\u6301 DSK\u7b49\u5916\u90e8\u7c7b\u522b\u5bf9\u8c61\u7684\u7f16\u7801\u3002\u5c06\u6765\u968f\u7740\u5bf9\u683c\u5f0f\u7684\u8fdb\u4e00\u6b65\u7406\u89e3\uff0c\u4f1a\u8003\u8651\u6dfb\u52a0\u652f\u6301\uff1b<\/p>\n<p>\u800c\u7f16\u7801\u4e3a AMF \u6570\u636e\u6d41\u7684\u51fd\u6570\u4e3a Encode\u3002\u5b83\u4f1a\u8fd4\u56de\u4e00\u4e2a TBytes \u7c7b\u578b\u7684\u5b57\u8282\u6570\u7ec4\uff0c\u6765\u4fdd\u5b58\u7f16\u7801\u540e\u7684\u7ed3\u679c\u3002SaveToStream\/SaveToFile \u5b9e\u9645\u4e0a\u8c03\u7528\u4e86\u5b83\u4fdd\u5b58\u5230\u6d41\u6216\u6587\u4ef6\u5f53\u4e2d\u3002<\/p>\n<p>\u8fd9\u91cc\uff0c\u8981\u6ce8\u610f\uff1aTQAMF \u7684 Encode \u7f16\u7801\u4f1a\u5305\u542b\u5934\u90e8\uff0c\u5982\u679c\u8981\u4e0d\u5305\u542b\u5934\u90e8\u7684\u7ed3\u679c\uff0c\u76f4\u63a5\u8c03\u7528\u76f8\u5e94\u6d88\u606f\u7ed3\u70b9\u7684 Encode \u5c31\u53ef\u4ee5\u4e86\u3002\u6bd4\u5982\u4e0b\u9762\u7684\u4ee3\u7801\u662f\u5e26\u6709\u534f\u8bae\u5934\u90e8\u7684\uff1a<\/p>\n<pre class=\"lang:delphi decode:true\">var\r\n  AMF:TQAMF;\r\n  ABytes:TBytes;\r\nbegin\r\nAMF:=TQAMF.Create;\r\ntry\r\n  ....\r\n  ABytes:=AMF.Encode;\r\nfinally\r\n  FreeAndNil(AMF);\r\nend;\r\nend;<\/pre>\n<p>\u800c\u4e0b\u9762\u7684\u4ee3\u7801\u5c06\u53ea\u5305\u542b\u7b2c\u4e00\u4e2a\u6d88\u606f\u7684\u6570\u636e\u4f53\uff0c\u800c\u6ca1\u6709\u4efb\u4f55\u5934\u90e8\u5185\u5bb9\u3002<\/p>\n<pre class=\"lang:delphi decode:true \">var\r\n  AMF:TQAMF;\r\n  ABytes:TBytes;\r\nbegin\r\nAMF:=TQAMF.Create;\r\ntry\r\n  ....\r\n  ABytes:=AMF.Messages[0].Encode;\r\nfinally\r\n  FreeAndNil(AMF);\r\nend;\r\nend;<\/pre>\n<p>4\u3001\u7ed3\u70b9\u7684\u589e\u3001\u5220\u3001\u67e5\u3001\u6539<\/p>\n<p>\u597d\u5427\uff0c\u8fd9\u5757\u7b80\u5355\u8bf4\u4e00\u4e0b\uff1a<\/p>\n<ul>\n<li>\u8c03\u7528 Add \u589e\u52a0\u5b50\u7ed3\u70b9\uff0c\u7136\u540e\u7528 AsXXX \u8bbe\u7f6e\u5b50\u7ed3\u70b9\u7684\u503c\uff0c\u7528 KeyAsXXX \u8bbe\u7f6e\u5b50\u7ed3\u70b9\u7684\u952e\u503c\u3002<\/li>\n<li>\u8c03\u7528 Delete \u5220\u9664\u6307\u5b9a\u7684\u5b50\u7ed3\u70b9\uff0c\u8c03\u7528 Clear \u6e05\u9664\u6240\u6709\u7684\u5b50\u7ed3\u70b9\u3002<\/li>\n<li>\u67e5\u627e\u7684\u5b9e\u73b0\u6682\u65f6\u6ca1\u6709\u5904\u7406\uff0c\u5c06\u6765\u4f1a\u652f\u6301 ItemByName\/ItemByPath\/ItemByRegEx \u63a5\u53e3\uff08\u548c QJson\u4e00\u6837:) \uff09\u3002<\/li>\n<li>\u4fee\u6539\u7c7b\u578b\u7684\u8bdd\uff0c\u76f4\u63a5\u8bbe\u7f6e\u7ed3\u70b9\u7684 DataType \u5c5e\u6027\uff0c\u4fee\u6539\u503c\u7684\u8bdd\uff0c\u7528 AsXXX \uff0c\u4fee\u6539\u952e\u7684\u8bdd\uff0c\u7528 KeyAsXXX\u3002<\/li>\n<\/ul>\n<p>\u56e0\u4e3a\u662f\u5185\u6d4b\u7684\u7248\u672c\uff0c\u73b0\u5728\u4e3b\u8981\u662f\u5b8c\u6210\u89e3\u6790\u548c\u7f16\u7801\u8fd9\u5757\uff0c\u81f3\u4e8e\u5176\u5b83\u7684\uff0c\u518d\u6839\u636e\u9700\u8981\u4e00\u6b65\u6b65\u5b8c\u5584\uff0c\u5305\u62ec\u5c06\u6765\u7684 RTTI \u652f\u6301\u3002<\/p>\n<p>\u597d\u4e86\uff0c\u6e90\u7801\u662f\u6700\u597d\u7684\u8001\u5e08\uff0c\u6709\u95ee\u9898\u8bfb\u6e90\u7801\u548c\u683c\u5f0f\u89c4\u8303\u5427\u3002\u5e0c\u671b\u5927\u5bb6\u7528\u5f97\u6109\u5feb\u3002<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>QAMF \u662f QDAC \u9879\u76ee\u4e2d\u7684\u4e00\u4e2a\u65b0\u6210 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[145,69,8,565,9],"tags":[],"class_list":["post-3618","post","type-post","status-publish","format-standard","hentry","category-android","category-c-builder","category-delphi","category-qamf","category-qdac"],"views":3517,"_links":{"self":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/3618","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3618"}],"version-history":[{"count":1,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/3618\/revisions"}],"predecessor-version":[{"id":3619,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/3618\/revisions\/3619"}],"wp:attachment":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3618"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3618"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3618"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}