From: Bwig Zomberi on
anime wrote:
> well, poorly formulated :)
> 1) this is from pdf file. We know, pdf support javascript
> 2) its "header part", the next goes complete scrambled data like this
>
> x?}ZЩмёKE!ШZн?Й?-~щ╪0"R">з?3S]WЦB?
> HЙu?RJ?~│'SКюTR-у?я/Х{юmeЮi\?э-g?&??%х????g? k?ф9v i?<ф│г?МqJ[KUFЙ?*CЫK?9giыкя2?UL9Wмo?-?Ш?ч4JкF1К3]нB_yШ_°fR<-?EtКФ>м?|еsZФ�8VfM?Цц
> _) RMъ'ХZчX;ж┼??2tvN2я%Od%*?KЦю?E0(7z?Сж.Uз'?Ц\Р_ж-Цч
> ?уэr?'s"?RF-УMЗпнЛТ$Ге
>
> 3) I think, its contain a lot of obfuscated javascript code, may be in
> some unspecified way. Perhaps something else.
> OK, if it not an obfuscated javascript code, what is this?
>


A PDF file contains both text and binary data. So, it will be scrambled.
http://pdf.jpedal.org/java-pdf-blog/bid/30454/Why-can-t-I-just-open-and-edit-a-PDF-file

The code is not obfuscated. It is zipped using a loss-less compression
algorithm.

To process the JS, it is wiser to use a server-side PDF library - same
for adding the JS.

For more information on using JavaScript in your PDF documents, download:
Acrobat JavaScript Scripting Reference
http://partners.adobe.com/public/developer/en/acrobat/sdk/AcroJS.pdf

Acrobat JavaScript Scripting Guide
http://partners.adobe.com/public/developer/en/acrobat/sdk/AcroJSGuide.pdf

For help with PDF processing, go to comp.text.pdf newsgroup.






--
Bwig Zomberi

From: anime on
How we can see the decoded Javascript in object 6?

Thanks.


"Ant" <not(a)home.today> wrote in message
news:xpKdnbIDOKkD0rzRnZ2dnUVZ8mqdnZ2d(a)brightview.co.uk...
> "anime" wrote:
>
> > "Ant" wrote:
> >> The document contains javascript in object 6, if I'm remembering the
> >> PDF format correctly, and that stream needs to have FlateDecode (gz
> >> deflate) and ASCIIHexDecode (hexadecimal text to ASCII) applied so as
> >> to be readable.
>
> Correction: FlateDecode uses gz inflate to decompress.
>
> > it's important, as we can see, this two filters, FlateDecode and
> > ASCIIHexDecode are both deprecated lossy filters.
>
> Pardon? Neither are lossy. Deflate is used to compress data and is
> available in many application, for example PHP's gzcompress function.
> The zlib library's deflate and inflate routines are widely used, so I
> hardly think the method is deprecated.
>
> Encoding data as hex strings increases the size and would only be
> useful to keep any binary data in the document as plain text (or to
> hide something, as appears to be the case in this example).
>
> > What is better lossless filters (3-4 ones) for replacing this
> > old deprecated stuff?
>
> Deflate is fine for lossless compression but since you're working with
> PDF's, you'll have to use whatever the standard (or Adobe) provides.
> I'm not sure what this has to do with javascript.
>
>

From: Thomas 'PointedEars' Lahn on
anime wrote:

> How we can see the decoded Javascript in object 6?

Well, by applying the specified decompression and decoding algorithms.
Unless you have a question about JavaScript/JScript/ECMAScript programming,
I strongly suggest you go elsewhere.

> [Top post]

<http://jibbering.com/faq/#posting>


PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f806at$ail$1$8300dec7(a)news.demon.co.uk>
From: Ant on
"anime" wrote:

> How we can see the decoded Javascript in object 6?

There are several tools to unpack PDFs. Try didier stevens' Python
script (pdf-parser.py) here:
http://blog.didierstevens.com/programs/pdf-tools/