单个可执行应用创建过程


¥Single executable application creation process

旨在创建单个可执行 Node.js 应用的工具必须将 JavaScript 文件的内容注入到:

¥A tool aiming to create a single executable Node.js application must inject the contents of a JavaScript file into:

  • 如果 node 二进制文件是 PE 文件,则名为 NODE_JS_CODE 的资源

    ¥a resource named NODE_JS_CODE if the node binary is a PE file

  • 如果 node 二进制文件是 Mach-O 文件,则 NODE_JS 段中名为 NODE_JS_CODE 的部分

    ¥a section named NODE_JS_CODE in the NODE_JS segment if the node binary is a Mach-O file

  • 如果 node 二进制文件是 ELF 文件,则名为 NODE_JS_CODE 的注释

    ¥a note named NODE_JS_CODE if the node binary is an ELF file

在二进制文件中搜索 NODE_JS_FUSE_fce680ab2cc467b6e072b8b5df1996b2:0 fuse 字符串并将最后一个字符翻转为 1 以指示已注入资源。

¥Search the binary for the NODE_JS_FUSE_fce680ab2cc467b6e072b8b5df1996b2:0 fuse string and flip the last character to 1 to indicate that a resource has been injected.