{"id":167375,"date":"2020-10-14T19:01:44","date_gmt":"2020-10-14T11:01:44","guid":{"rendered":"http:\/\/4563.org\/?p=167375"},"modified":"2020-10-14T19:01:44","modified_gmt":"2020-10-14T11:01:44","slug":"%e4%b8%80%e4%b8%aa%e6%96%b0%e7%9a%84%e7%8e%a9%e5%85%b7%ef%bc%8c%e5%9c%a8-js-%e9%87%8c%e5%a5%97%e5%a8%83-c-%e7%bc%96%e8%af%91%e5%99%a8","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=167375","title":{"rendered":"\u4e00\u4e2a\u65b0\u7684\u73a9\u5177\uff0c\u5728 js \u91cc\u5957\u5a03 c \u7f16\u8bd1\u5668"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u4e00\u4e2a\u65b0\u7684\u73a9\u5177\uff0c\u5728 js \u91cc\u5957\u5a03 c \u7f16\u8bd1\u5668               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : codehz <\/span>  <span><i><\/i> 0<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u4ed3\u5e93\u5730\u5740 https:\/\/github.com\/codehz\/tjs<\/p>\n<p>\u8fd9\u662f\u67d0\u5929\u6298\u817e tcc \u65f6\u7a81\u53d1\u5947\u60f3\u7684\u7684 idea\uff0c\u4e5f\u5c31\u662f\u7528 js \u505a\u811a\u672c\uff0c\u7136\u540e\u4efb\u4f55\u6d89\u53ca\u7cfb\u7edf\u7684\u529f\u80fd\u76f4\u63a5\u7528 tcc \u8fd0\u884c\u65f6\u7f16\u8bd1\u51fa\u6765\u8c03\u7528\uff08<\/p>\n<p>\u67e5\u4e86\u67e5 node \u65b9\u9762\u6709 node-ffi\uff0c\u4f46\u662f\u663e\u800c\u6613\u89c1\u90fd\u7528\u4e86 nodejs \u4e86\uff0c\u7cfb\u7edf\u4ea4\u4e92\u57fa\u672c\u5f88\u591a\u90fd\u80fd\u5728\u7eaf js \u5c42\u505a\u4e86\uff0c\u4e8e\u662f\u518d\u641e\u8fd9\u4e2a<\/p>\n<p>\u76ee\u524d\u6d4b\u8bd5\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528 windows api MessageBox \u5f39\u4e2a\u6846\uff08\u6682\u65f6\u53ea\u652f\u6301 win\uff0c32 \u4f4d+64 \u4f4d\uff09<\/p>\n<p>\u7279(que)\u8272(xian)\uff1a<\/p>\n<ol>\n<li>\u6ca1\u6709\u4e8b\u4ef6\u5faa\u73af\uff08\u5495\uff09<\/li>\n<li>\u6ca1\u6709\u5e38\u89c1 js \u51fd\u6570\uff0c\u9664\u4e86\u5185\u7f6e\u7684\uff08\u5495\uff09<\/li>\n<li>\u5f3a\u5236\u542f\u7528 ESM \uff08\u548c\u4e25\u683c\u6a21\u5f0f\uff09<\/li>\n<\/ol>\n<p>\u793a\u4f8b\u4ee3\u7801\uff1a<\/p>\n<pre><code>import { Compiler } from \"builtin:c\"; const compiler = new Compiler(\"memory\"); compiler.link(\"user32\"); compiler.compile(` #include &lt;windows.h&gt; void msgbox(char const *text) {   MessageBoxA(NULL, text, \"from js\", 0); } `); const obj = compiler.relocate({   msgbox: { arguments: [\"string\"] } }); obj.msgbox(`from ${import.meta.url}`); <\/code><\/pre>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>7<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"3710482\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : azh7138m <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3710483\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : charten <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u521a\u5f00\u59cb\u6ca1\u770b\u6e05\u4ee5\u4e3a windows api \u6307\u7684\u662f\u6d4f\u89c8\u5668\u5185\u7684\u90a3\u4e00\u5957\uff0c\u540e\u9762\u624d\u53d1\u73b0\u662f\u5fae\u8f6f\u7684 windows.h&#8230;.\u6d41\u6279\u554a\uff0c\u4e00\u8d77\u9ed1\u5b50\u4e0b\u53d1\u6076\u610f\u4ee3\u7801\u662f\u901a\u5e38\u662f vb\uff0c\u73b0\u5728\u53ef\u4ee5\u76f4\u63a5\u4e0b\u53d1 c \u4ee3\u7801\u641e\u7834\u574f\u4e86 hhhhhhh                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3710484\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : codehz <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @charten #2 \u7c7b\u4f3c\u60f3\u6cd5\u7684\u6076\u610f\u8f6f\u4ef6\u591a\u4e86\u53bb\u4e86\uff0c\u4e0d\u8fc7\u4e0d\u4f1a\u8fd9\u4e48 naive \u76f4\u63a5\u4e0b\u53d1 c \u4ee3\u7801\uff0c\u901a\u5e38\u662f\u76f4\u63a5\u4e0b\u53d1 shellcode\uff0c\u6700\u591a\u52a0\u4e0a\u70b9\u91cd\u5b9a\u4f4d\u7684\u64cd\u4f5c\uff0c\u5c31\u53ef\u4ee5\u8dd1\u4e86\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3710485\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Themyth <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6211\u60f3\u95ee\u3002\u3002\u3002<br \/>\u662f\u4e0d\u662f\u628a\u8fd9\u4e2a\u4ee3\u7801\u6539\u6210.js \u653e\u5230 html \u91cc\u9762 \u7136\u540e\u8bbf\u95ee\u5c31\u53ef\u4ee5\u5f39\u7a97\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3710486\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : codehz <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @Themyth #4 \u4f60\u5728 peach\uff0c\u8fd9\u662f\u72ec\u7acb\u7684\u8fd0\u884c\u65f6                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3710487\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : sologgfun <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8fd9\u662f\u4e2a\u5565\u963f\uff1f\u5728 node \u91cc\u9762\u5199 c \u8bed\u8a00-\u7f16\u8bd1-\u8c03\u7528\u7cfb\u7edf api \uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3710488\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : codehz <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @sologgfun #6 \u4e0d\u662f node\uff0c\u7528 quickjs \u505a\u7684\u4e00\u4e2a\u5f88\u5c0f\u7684 js \u8fd0\u884c\u65f6\uff0c\u538b\u7f29\u540e&lt;4MB\uff0cnode \u8bf7\u76f4\u63a5\u7528 node-ffi \uff08                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u4e2a\u65b0\u7684\u73a9\u5177\uff0c\u5728 js \u91cc\u5957\u5a03 c&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/167375"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=167375"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/167375\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=167375"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=167375"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=167375"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}