cat, head, tail #14
Replies: 3 comments 2 replies
-
I used
We can keep track of offsets in a JSON array to support extraction of multiple files concatenated to the executable, without recompiling. |
Beta Was this translation helpful? Give feedback.
-
Yep, this is in the right direction, and the base concept that we are thinking about implementing. The main problems with that are:
Our starting point was not too different from what you are suggesting, but we ended up pivoting the approach to https://github.com/postmanlabs/postject because of those security concerns. You can think of Postject as a
I think @RaisinTen can expand more on the second point, as he faced these limitations and fixed them himself. |
Beta Was this translation helpful? Give feedback.
-
Simply appending stuff to the end of the binary makes $ strip node_example
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip: fatal error: the __LINKEDIT segment does not cover the end of the file (can't be processed) in: /some/arbitrary/path/node_example
$ echo $?
1 Haven't tested on other platforms yet but I believe this is something we should keep in mind. Folks might want the binaries to be compliant with what And I wrote about how this doesn't work well with codesigning on macOS in nodejs/node#42334 (comment). Fwiw, pkg does some additional bit fiddling after the naive append on macOS - vercel/pkg#1164. |
Beta Was this translation helpful? Give feedback.
-
We can do
We just need a means to create symbolic links to parts of a file and modify
exec
https://man7.org/linux/man-pages/man3/exec.3.html to accept symbolic link to parts of a single file rather thanpathname
or execute raw string.Beta Was this translation helpful? Give feedback.
All reactions