PDA

View Full Version : Decoding javascript file



intxeon
12-17-2009, 10:50 AM
Hello
I have encoded same javascript file with "Microsoft script encode" and accidentally deleted the original file.There is a way to convert the encoded file into the original version..

The form of the encoded file is : <script type="text/jscript.encode">#@~^.....


Thank you and sorry for my bad english

Philip M
12-17-2009, 12:30 PM
Hello
I have encoded same javascript file with "Microsoft script encode" and accidentally deleted the original file.There is a way to convert the encoded file into the original version..


No. That is why it has been encoded - to stop people viewing the source.

If you have not only deleted the source file but emptied your Recycle Bin as well then the only possibility is to try one of the deleted file recovery programs. But you should know perfectly well that all data should be backed up (at least twice) - what about your back-up files? If there is no back-up system or file then you have asked for what you have got.


Caller: "I deleted a file from my PC last week and I have just realised that I need it. If I turn my system clock back two weeks will I have my file back again?".

oracleguy
12-17-2009, 05:03 PM
This is a good lesson is why you shouldn't "encrypt" your javascript. There is very little point to doing it and if you lose the original file, it can be very inconvenient.

There might be a way to get the original script back but all the variable and function names will be random characters I'd surmise.

rnd me
12-17-2009, 08:37 PM
Hello
I have encoded same javascript file with "Microsoft script encode" and accidentally deleted the original file.There is a way to convert the encoded file into the original version..

The form of the encoded file is : <script type="text/jscript.encode">#@~^.....


Thank you and sorry for my bad english

yes, you can get it back, intact!

not sure why the other guys said no, this is fairly common knowledge (i thought)...
you should also still have your full variable and function names, don't know where the notion you wouldn't came from...

luckily, microsoft's "protection" is skin deep.

you can find the formula with google.

here's an article: http://www.asp101.com/tips/index.asp?id=116
here's an online app that appears to decode them: http://www.greymagic.com/security/tools/decoder/

i didn't test the app, but this is really very basic reverse engineering, so i'd be surprised if it didn't work...

Philip M
12-17-2009, 08:59 PM
yes, you can get it back, intact!

not sure why the other guys said no, this is fairly common knowledge (i thought)...
you should also still have your full variable and function names, don't know where the notion you wouldn't came from...


I guess I had in mind something like stunnix http://www.stunnix.com/prod/jo/

which involves inter alia replacing symbol names with non-meaningful ones, e.g. replacing list_of_customers with zcadaa4fc81 and replacing numeric constants with expressions, e.g. replacing 232 with (0x14b6+2119-0x1c15).

So as to produce, for example,:-
<script language=javascript>
function z60b72bb3fe( z387ef0e78e, zd06054e7d1) { var z205fd1aa25= z387ef0e78e== (0x397+8978-0x26a8)? (0xd81+6110-0x255e): z60b72bb3fe( z387ef0e78e- (0x1083+838-0x13c8), (0x463+3498-0x120c)) * z387ef0e78e; if( ! zd06054e7d1) { document. write( "\x66\x61\x63\x74\x6f\x72\x69\x61\x6c\x20\x6f\x66\x20"+ z387ef0e78e+ "\x20\x69\x73\x3a\x20" + ret + "<br>") ;


Did not realise that the Microsft product was so feeble.

Old Pedant
12-17-2009, 09:56 PM
Did not realise that the Microsft product was so feeble.

You would think that people would learn to spell the name of the world's largest software company correctly, by now.

Philip: You should know perfectly well that the correct spelling is "Microslop".

<grin style="s.e."/>