Embed binary data in script

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: Tom, Kukurykus

lalvarez

Embed binary data in script

Post by lalvarez »

Hi,

I am trying to embed an executable binary that for security reasons I want to decode to disk, run it and then delete it again at script runtime. The file is about 100k and I am able to do what I want but encoding the file using base64 into a string that I put into my .jsx that I then decode and write to disk at runtime, however, decoding the 100k takes between 20-30 seconds which is too long for what I need. My question is whether there is a more efficient way to encode the binary into a string or can I embed the raw binary data in the script somehow (like a serialized blob for example).

I am wondering if there is something in stream.js that I can use but I am not sure I am clear on how to use it and I can't seem to find docs on it to help me out.

Cheers.