Planet PDF Forum Planet PDF Forum
  New Posts New Posts RSS Feed - Script Object and bytecode loader
  FAQ FAQ  Forum Search   Register Register  Login Login

Hi, welcome to the Foxit Planet PDF Forum. If you have PDF or Adobe Acrobat questions then the right place to ask them is here, in this forum.

Script Object and bytecode loader

 Post Reply Post Reply
bulk88 View Drop Down
New Member
New Member

Joined: 23 Apr 2014
Points: 1
Post Options Post Options   Quote bulk88 Quote  Post ReplyReply Direct Link To This Post Topic: Script Object and bytecode loader
    Posted: 23 Apr 2014 at 3:54pm
Ever wondered how the JSByteCodeWin.bin binary blob bytecode file works?  Here is some undocumented code explaining how to create and load bytecode. Run it in Acrobat's JS Console. It is not in the same format as JSByteCodeWin.bin. JSByteCodeWin.bin looks like 2 bytes per character UTF16, the string returned by freeze() has normal looking words in it. Loading from disk is a separate API and is not part of Script class so you have to figure out yourself how to get it into a JS string.  The output of freeze() is probably unique to build of Acrobat, so you cant use it to obfuscate code.

    this.level1 = new Object();
    delete this.level1.testcomp;
    s = new Script();
    s.compile("this.level1.testcomp = function () {return \"retval\";}");
    t = new Script();
    app.alert("toSource is "+t.toSource());
    app.alert("testcomp is "+this.level1.testcomp);
    app.alert("testcomp is "+this.level1.testcomp);

Back to Top
try67 View Drop Down
Senior Member
Senior Member

Joined: 15 Jul 2011
Points: 634
Post Options Post Options   Quote try67 Quote  Post ReplyReply Direct Link To This Post Posted: 23 Apr 2014 at 5:40pm
Interesting stuff... Thanks!
- Acrobat Expert - Contact me personally at
Check out my custom-made scripts website:
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.10
Copyright ©2001-2017 Web Wiz Ltd.

This page was generated in 0.047 seconds.