1414#include " simdjson.h"
1515#include " util-inl.h"
1616
17- // The POSTJECT_SENTINEL_FUSE macro is a string of random characters selected by
18- // the Node.js project that is present only once in the entire binary. It is
19- // used by the postject_has_resource() function to efficiently detect if a
20- // resource has been injected. See
21- // https://github.com/nodejs/postject/blob/35343439cac8c488f2596d7c4c1dddfec1fddcae/postject-api.h#L42-L45.
22- #define POSTJECT_SENTINEL_FUSE " NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2"
23- #include " postject-api.h"
24- #undef POSTJECT_SENTINEL_FUSE
25-
2617#include < memory>
2718#include < string_view>
2819#include < tuple>
@@ -233,33 +224,6 @@ SeaResource SeaDeserializer::Read() {
233224 exec_argv};
234225}
235226
236- std::string_view FindSingleExecutableBlob () {
237- #if !defined(DISABLE_SINGLE_EXECUTABLE_APPLICATION)
238- CHECK (IsSingleExecutable ());
239- static const std::string_view result = []() -> std::string_view {
240- size_t size;
241- #ifdef __APPLE__
242- postject_options options;
243- postject_options_init (&options);
244- options.macho_segment_name = " NODE_SEA" ;
245- const char * blob = static_cast <const char *>(
246- postject_find_resource (" NODE_SEA_BLOB" , &size, &options));
247- #else
248- const char * blob = static_cast <const char *>(
249- postject_find_resource (" NODE_SEA_BLOB" , &size, nullptr ));
250- #endif
251- return {blob, size};
252- }();
253- per_process::Debug (DebugCategory::SEA,
254- " Found SEA blob %p, size=%zu\n " ,
255- result.data (),
256- result.size ());
257- return result;
258- #else
259- UNREACHABLE ();
260- #endif // !defined(DISABLE_SINGLE_EXECUTABLE_APPLICATION)
261- }
262-
263227} // anonymous namespace
264228
265229bool SeaResource::use_snapshot () const {
@@ -283,9 +247,6 @@ SeaResource FindSingleExecutableResource() {
283247 return sea_resource;
284248}
285249
286- bool IsSingleExecutable () {
287- return postject_has_resource ();
288- }
289250
290251void IsSea (const FunctionCallbackInfo<Value>& args) {
291252 args.GetReturnValue ().Set (IsSingleExecutable ());
0 commit comments