nodejs / postject

Easily inject arbitrary read-only resources into executable formats (Mach-O, PE, ELF) and use it at runtime.
Other
188 stars 14 forks source link

Provide a way to fetch the file offset of the embedded data #2

Closed RaisinTen closed 2 years ago

RaisinTen commented 2 years ago

Problem

The current mechanism returns a pointer to the embedded data and its size. Passing it into V8 forces us to load the entire embedded data into a buffer in memory. It is not efficient to prematurely store the entire payload in memory, especially if the payload is huge.

See https://github.com/nodejs/node/pull/42334#issuecomment-1184718946.

Suggested solution

If the Postject Api returns the file offset of the embedded data, we will be able to parse only the parts that we are interested in.

RaisinTen commented 2 years ago

This is not needed anymore, see https://github.com/nodejs/node/pull/42334#issuecomment-1192467831