function(p,a,c,k,e,r) de-mystify trick
Friday, 21. September 2007, 17:40:41
eval(function(p,a,c,k,e,r)
here's a small demonstration of how to turn that code into something sensible..
A word of warning: I'm experimenting with Wink for creating Flash screencast-type demonstrations. That means you agree to receive a 1.5 M .swf file of screenshots and text by clicking through to the post.
I haven't quite mastered Wink, some unintentional mouse movement might occur but anything in the spirit of experimentation.. Feel free to tell me in comments whether you like more of those Flash-based visual demonstrations or prefer the old-fashioned screenshot approach.









Hallvord R. M. Steen # 21. September 2007, 17:44
http://www.hallvord.com/opera/unpack.htm
Andrey Petrov # 21. September 2007, 18:53
But it's mutch better to see this demo through Opera RSS reader.
Kyle Baker # 21. September 2007, 19:20
_Grey_ # 21. September 2007, 20:17
I kind of liked those flash tutorials that explain Opera functionality... they have a "next" button in the lower right corner imho.
"Normal" screenshots will do just fine, though
edit: Oh, nearly forgotten to add: I like this trick very much
Non-Troppo # 21. September 2007, 23:47
I've already made some buttons to use here: http://operawiki.info/MakingFlashTutorials
Lars Kleinschmidt # 21. September 2007, 23:53
Øyvind Østlund # 22. September 2007, 00:17
As I wrote about a long time ago, Firefox has an extension like this. It formats the source, and you can see the CSS applied to any element with it. Really helpful tool. Together with the CSSViewer you save yourself a lot of time.
Except that, I really hope you will show us more tricks of the trade Hallvord. This blog gets better every day!!!
- ØØ -
scipio # 22. September 2007, 07:36
Smir # 22. September 2007, 13:56
I knew of CTRL+A, CTRL+C in alert boxes. It is terrible annoying that this does not work in other browsers!
Hallvord R. M. Steen # 22. September 2007, 20:07
NoteMe: the "eval=alert" trick is somewhat beyond the scope of the Firefox tool (presuming it is a code beautifier only). This script is compressed in a way that means the original source code makes no sense, and you get source that makes sense to read only by actually running it. To see meaningful source here you'd need a combined JS debugger (to run the decompress routine and stop afterwards) and code beautifier (to format the generated scripts nicely).
Øyvind Østlund # 22. September 2007, 21:54
Even though I can't read the code in the flash movie, I should have taken a hint if I had read the first line again and understood it was the "re-compilation"/interpretation you where on about. Neither the less, thanks for correcting me back to the stone age there.
Firefox do have an uneval function as well for some reason. Although I can't see much use for it except doubling the amount of Fuzzytest bugs++.
- ØØ -
_Grey_ # 23. September 2007, 01:28
phamgiagia # 26. October 2007, 00:18
Ohwzay # 2. April 2008, 12:53
var n=document.createElement('textarea');document.body.appendChild(n);eval=function(s){n.value+=s;};
instead.
http://www.arachnoid.com/arachnophilia/index.html contains a beautifier, and http://www.prettyprinter.de/ usually works just fine. What is it Hallvord is using? No public script I assume?
Hallvord R. M. Steen # 2. April 2008, 18:42
I mostly use ad-hoc stuff, I've written one PHP script that does a pretty good job at being a minimal JS pretty-printer - knows just enough syntax to parse it - and I'm going to make that public at some point. When I get around to it.
Anonymous # 11. December 2008, 18:27
I don't understand ?
My Code:
eval(function(p,a,c,k,e,r){
[i][Edit: removed a very large section of unreadable code. Hallvord][/i]
_Grey_ # 12. December 2008, 19:57
Here, did that for you.
@Moderator: You can delete his code.
@topic: I recently found a blog post dealing with "unpacking" packer. Might be useful.
Hallvord R. M. Steen # 13. December 2008, 21:24
or
when you load the modified code, you will see the original, unpacked version.
Anonymous # 27. December 2008, 14:31
Your trick doesn't work for me but i found similar idea, just change
eval(function(p,a,c,k,e,r){...
on
alert(function(p,a,c,k,e,r){...
Anonymous # 30. January 2009, 22:58
How get the opposite? from a tidy javascript create the macro object?
Hallvord R. M. Steen # 3. February 2009, 20:26
Anonymous # 12. March 2009, 17:12
If you want to hack luckyzoom for whateverr reason then remove this code
'+xgdf7fsgd56('^bko}k.{~i|ojk.za.h{bb.xk|}ga`.ah.Coigm.Taac')+'
line beginning appendChild(this.bigImage);var str=
Anonymous # 21. April 2009, 20:59
thank you for the ideas here. On this first experience with a packer I needed them all. the alert box terminated my long unpack. I found a way with no practical limit on size:
make the function named>> eg. unPAC=(function(p,a,c,k,e,d){e=function(c){return.....
assign an html text node value to the value produce by unPAC . I cheated, avoid tough DOM stuff and used jQuery like this..
$j('.unP').text(unPAC)
works great. .unP is a div I gave a class="unP".
Anonymous # 4. August 2009, 11:04
Thanks to original poster and Ohwzay for the code.