How to unobfuscate java-script code [duplicate] - javascript
This question already has answers here:
Deobfuscating Javascript [closed]
(5 answers)
Closed 8 years ago.
How to un obfuscate java-script code like that : it takes alot of time to know the expression obfuscate for the javascript to protect the code , but I'm tring to get the main code of this script but don't know How ?
var _0x843d=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x53\x4C\x41\x4D\x52","\x6E\x61\x76","\x72\x65\x73\x69\x7A\x65","\x77\x69\x64\x74\x68","\x74\x6F\x70\x2D\x6E\x61\x76\x2D\x63\x6F\x6C\x6C\x61\x70\x73\x65","\x68\x61\x73\x43\x6C\x61\x73\x73","\x2E\x6E\x61\x76\x62\x61\x72\x2D\x66\x69\x78\x65\x64\x2D\x74\x6F\x70","\x61\x64\x64\x43\x6C\x61\x73\x73","\x72\x65\x6D\x6F\x76\x65\x43\x6C\x61\x73\x73","\x74\x6F\x70","\x6F\x66\x66\x73\x65\x74","\x2E\x6E\x61\x76\x62\x61\x72","\x73\x63\x72\x6F\x6C\x6C","\x64\x72\x6F\x70\x64\x6F\x77\x6E","\x61\x63\x74\x69\x76\x65\x2D\x73\x75\x62","\x65\x61\x73\x65\x4F\x75\x74\x45\x78\x70\x6F","\x3A\x6E\x6F\x74\x28\x2E\x65\x78\x29","\x6F\x6E\x65\x50\x61\x67\x65\x4E\x61\x76","\x2E\x6E\x61\x76\x62\x61\x72\x2D\x6E\x61\x76\x20\x2E\x64\x72\x6F\x70\x64\x6F\x77\x6E","\x61\x63\x74\x69\x76\x65","\x2E\x6E\x61\x76\x62\x61\x72\x2D\x6E\x61\x76","\x73\x6C\x69\x64\x65\x44\x6F\x77\x6E\x48\x65\x61\x64","\x2D\x35\x30\x30\x70\x78","\x30","\x63\x73\x73","\x2E\x70\x61\x67\x65\x48\x65\x61\x64","\x2E\x70\x61\x67\x65\x48\x65\x61\x64\x20\x2E\x68\x65\x72\x6F\x20\x68\x31\x2C\x20\x2E\x70\x61\x67\x65\x48\x65\x61\x64\x20\x2E\x68\x65\x72\x6F\x20\x68\x33","\x72\x65\x61\x64\x79","\x30\x70\x78","\x31","\x65\x61\x73\x65\x4F\x75\x74\x43\x75\x62\x69\x63","\x61\x6E\x69\x6D\x61\x74\x65","\x2E\x70\x61\x67\x65\x48\x65\x61\x64\x20\x2E\x68\x65\x72\x6F\x20\x68\x33","\x2E\x70\x61\x67\x65\x48\x65\x61\x64\x20\x2E\x68\x65\x72\x6F\x20\x68\x31","\x64\x65\x6C\x61\x79","\x73\x74\x6F\x70","\x6C\x6F\x61\x64","\x70\x61\x72\x61\x6C\x6C\x61\x78","\x74\x6F\x75\x63\x68","\x73\x65\x74","\x72\x61\x6E\x64\x6F\x6D","\x69\x6E\x69\x74","\x70\x72\x65\x6C\x6F\x61\x64\x65\x72","\x6F\x76\x65\x72\x66\x6C\x6F\x77","\x76\x69\x73\x69\x62\x6C\x65","\x62\x6F\x64\x79","\x66\x61\x64\x65\x4F\x75\x74","\x23\x70\x72\x65\x6C\x6F\x61\x64\x65\x72","\x73\x6C\x69\x64\x65\x72","\x73\x75\x70\x65\x72\x73\x6C\x69\x64\x65\x73","\x6F\x77\x6C\x43\x61\x72\x6F\x75\x73\x65\x6C","\x65\x61\x63\x68","\x73\x6B\x69\x6C\x6C\x62\x61\x72","\x61\x6E\x69\x6D\x61\x74\x65\x64","\x75\x73\x65\x72\x41\x67\x65\x6E\x74","\x74\x65\x73\x74","\x64\x61\x74\x61\x2D\x70\x65\x72\x63\x65\x6E\x74","\x61\x74\x74\x72","\x2E\x73\x6B\x69\x6C\x6C\x62\x61\x72\x2D\x62\x61\x72","\x66\x69\x6E\x64","\x68\x65\x69\x67\x68\x74","\x6F\x75\x74\x65\x72\x48\x65\x69\x67\x68\x74","\x77\x61\x79\x70\x6F\x69\x6E\x74","\x2E\x73\x6B\x69\x6C\x6C\x62\x61\x72","\x76\x69\x64\x65\x6F\x42\x67\x59\x54","\x74\x75\x62\x75\x6C\x61\x72","\x3C\x69\x6D\x67\x20\x73\x72\x63\x3D\x27\x69\x6D\x67\x2F\x62\x67\x2D\x68\x65\x61\x64\x2D\x31\x2E\x6A\x70\x67\x27\x20\x61\x6C\x74\x3D\x27\x27\x20\x2F\x3E","\x68\x74\x6D\x6C","\x62\x6F\x6F\x74\x73\x74\x72\x61\x70\x43\x61\x72\x6F\x75\x73\x65\x6C","\x63\x61\x72\x6F\x75\x73\x65\x6C","\x66\x69\x74\x56\x69\x64\x73","\x70\x6F\x72\x74\x66\x6F\x6C\x69\x6F\x46\x69\x6C\x74\x65\x72","\x70\x72\x65\x76\x65\x6E\x74\x44\x65\x66\x61\x75\x6C\x74","\x63\x75\x72\x72\x65\x6E\x74","\x64\x61\x74\x61\x2D\x67\x72\x6F\x75\x70","\x61\x6C\x6C","\x69\x6E\x61\x63\x74\x69\x76\x65","\x2E\x70\x6F\x72\x74\x66\x6F\x6C\x69\x6F\x2D\x6C\x69\x6E\x6B","\x75\x6E\x64\x65\x66\x69\x6E\x65\x64","\x2C","\x73\x70\x6C\x69\x74","\x63\x6C\x69\x63\x6B","\x68\x6F\x76\x65\x72","\x70\x6F\x72\x74\x66\x6F\x6C\x69\x6F","\x70\x6F\x72\x74\x66\x6F\x6C\x69\x6F\x45\x78\x70\x61\x6E\x64\x65\x72","\x73\x63\x72\x6F\x6C\x6C\x41\x6E\x69\x6D","\x79\x65\x73","\x64\x65\x66\x61\x75\x6C\x74\x73","\x66\x6E","\x61\x6E\x69\x6D\x61\x74\x69\x6F\x6E","\x64\x61\x74\x61","\x64\x61\x74\x61\x2D\x61\x6E\x69\x6D\x61\x74\x69\x6F\x6E","\x64\x61\x74\x61\x2D\x61\x6E\x69\x6D\x61\x74\x69\x6F\x6E\x2D\x64\x65\x6C\x61\x79","\x61\x6E\x69\x6D\x61\x74\x69\x6F\x6E\x2D\x64\x65\x6C\x61\x79","\x20\x76\x69\x73\x69\x62\x6C\x65","\x25","\x2E\x61\x6E\x69\x6D\x61\x74\x65\x64","\x76\x69\x73\x69\x62\x69\x6C\x69\x74\x79","\x66\x69\x78\x65\x64","\x2E\x62\x61\x63\x6B\x67\x72\x6F\x75\x6E\x64\x2D\x6D\x69\x64\x64\x6C\x65\x2D\x66\x75\x6C\x6C","\x6D\x61\x67\x6E\x69\x66\x69\x63","\x6D\x61\x67\x6E\x69\x66\x69\x63\x50\x6F\x70\x75\x70","\x63\x6F\x6E\x74\x61\x63\x74\x46\x6F\x72\x6D","\x63\x6C\x69\x63\x6B\x20\x74\x6F\x75\x63\x68\x73\x74\x61\x72\x74","\x64\x69\x73\x61\x62\x6C\x65\x64","\x70\x72\x6F\x70","\x3C\x69\x20\x63\x6C\x61\x73\x73\x3D\x27\x66\x61\x20\x66\x61\x2D\x63\x6F\x67\x20\x66\x61\x2D\x73\x70\x69\x6E\x27\x3E\x3C\x2F\x69\x3E\x20\x53\x45\x4E\x44\x49\x4E\x47","\x23\x63\x6F\x6E\x74\x61\x63\x74\x2D\x73\x75\x62\x6D\x69\x74","\x23\x63\x6F\x6E\x74\x61\x63\x74\x2D\x66\x6F\x72\x6D","\x73\x65\x72\x69\x61\x6C\x69\x7A\x65","\x50\x4F\x53\x54","\x69\x6E\x63\x2F\x63\x6F\x6E\x74\x61\x63\x74\x2E\x70\x68\x70","\x6A\x73\x6F\x6E","\x73\x74\x61\x74\x75\x73","","\x76\x61\x6C","\x23\x63\x6F\x6E\x74\x61\x63\x74\x2D\x66\x6F\x72\x6D\x20\x69\x6E\x70\x75\x74","\x23\x63\x6F\x6E\x74\x61\x63\x74\x2D\x66\x6F\x72\x6D\x20\x74\x65\x78\x74\x61\x72\x65\x61","\x65\x6D\x70\x74\x79","\x23\x63\x6F\x6E\x74\x61\x63\x74\x2D\x66\x6F\x72\x6D\x2D\x72\x65\x73\x70\x6F\x6E\x73\x65","\x3C\x69\x20\x63\x6C\x61\x73\x73\x3D\x27\x66\x61\x20\x66\x61\x2D\x63\x68\x65\x63\x6B\x27\x3E\x3C\x2F\x69\x3E\x20\x53\x55\x42\x4D\x49\x54","\x61\x6A\x61\x78","\x6F\x6E"];
I have another question related to that , Could I use this script as it's or I have to decode it to use at my HTML5 page ?
The point of obfuscation is to make it very challenging to restore the original code as written while maintaining the same functionality. So to answer your first question there really is no way to get back to the original code as the author clearly didn't want you to see it or be able to edit it. To answer your second question yes you should be able to use it normally assuming it was properly obfuscated.
I suggest you do a little reading on the topic: http://en.wikipedia.org/wiki/Obfuscation_%28software%29
There might be a few deobfuscation tools out there for javascript, but the chance that these work well is probably low.
Related
De"compressing" Javascript [duplicate]
This question already has answers here: Is there such a thing as a javascript deminifier (deobfuscator)? [closed] (10 answers) Closed 8 years ago. This will without a doubt be a duplicate, but I have no idea what else to call it. A friend of mine is trying to learn Javascript. He accidentally saved the "compressed" (all whitespace removed) version as the version he has, and wants me to help format it again. He's emailed me a massive .js file and... I'm not sure what to do. I don't want to install (no doubt Eclipse has one) a Javascript plugin for Eclipse just to right click and format once. Is there a tool for this? A parser that'll build an AST then format that AST?
Tool to Unminify / Decompress JavaScript Apparently JS beautifier will do the trick sometimes. There's a plethora of others on there.
Can i hide some code in Javascript from the user? [duplicate]
This question already has answers here: How can I obfuscate (protect) JavaScript? [closed] (22 answers) Closed 9 years ago. I want to have two separate files in JavaScript with the same name , can i do it in javascript ? I want to expose only part of the code to the user and not all the file (Do we have any concept on javascript like the c# partial classes ?) Thanks Shimon
In the Web Browser, all of the JavaScript code is interpreted locally on the user's machine. So for the Web Browser to be able to interpreted correctly it needs all of the source code. So the answer to your main question is "no". The closest solution to your problem is doing some sort of obfuscation of the source code. When you do that, it makes the source code very hard for the user to read the source code, but the Web Browser can still interpret it. To answer the last question, all objects in JavaScript can be extended like partial classes in C#.
Nope - you can't fully hide JavaScript from your end users. The users browser needs to be able to parse the code and as such the user will have access to it as well. What you can try to is use some form of code obfusication. This will still allow the user's browser to parse the code but will make it very difficult for a user to read and understand what's going on. That said, it's not impossible for a user to un-obfusicate the code and see the logic behind it - it is just another layer of security but by no means fool proof.
How algorithm of finding similar Q works? [duplicate]
This question already has answers here: How to build a 'related questions' engine? (5 answers) Closed 8 years ago. Maybe my question is not ask correctly but a this moment i don't know words how to say it better. I like "Questions that may already have your answer" or SimilarQuestion feature in SO. I want to try to create the same feature in my project. How algorithm of finding similar question works? in my opinion the good way to that is send ajax request while you typing text, and on server you create statement that find question in database by using like statement? Is this right way? Can you give me advice what better way to do this feature. Thanks in advanced. addition: i find that my question duplicated with How to build a 'related questions' engine?
Is not as trivial as it seems, indeed the referenced question gives you some pointers to it so try to start there. Basically you're trying to reproduce the functionality of a search engine... you type a series of terms (your question) and the algorithm needs to find a set of documents that more closely relate to the terms you typed. That being said you could try using something like apache lucene to try to implement fuzzy string searching in your app.
Is there way to hide the JavaScript code [duplicate]
This question already has answers here: Closed 11 years ago. Possible Duplicate: Is it possible to hide or scramble/obfuscate the javascript code of a webpage? Is there any way to hide the view of JavaScript code from the view page source action?
No. You can obfuscate it a lot, though.
No. It is the same with any content on the web. If you can see or hear it, you can download it.
No. If you have sensitive algorithms or implementations, run them on the server and access them through Ajax or at the time the page is requested. Keep the javascript on your page UI-centric.
You can hide your js code to unexpert eyes using obfuscate techniques: JS obfuscate but an expert js coder can reverse engineering and understand it
Javascript code encryption [duplicate]
This question already has answers here: Closed 12 years ago. Possible Duplicate: How can I obfuscate JavaScript? Hi there, is there any way to encrypt code written in javascript, that's displayed in the browsers window..
The below link has a similar discussion and has answer to that. How can I encrypt JavaScript code so that it's not decryptable? Hope this will be helpful.
You mean that you want to obfuscate your javascript code so that others cannot read it properly? Try jCompress or any other Javascript Minifiers
There is no way to encrypt (because otherwise the browser couldn't run the code) but you can obfuscate. Just search for 'Javascript Obfuscator' . I wouldn't recommend this though, as obfuscators can cause bugs and it is possible to deobfuscate them. Is there any reason why you want to encrypt the javascript?
If you mean a way to encrypt it so it can't be stolen than the answer is no. The browser needs to be able to read the code to be able to execute it. There are tools to make it harder to read for humans but in the end you can't avoid people stealing your code. Plenty of tools available on google. 1 Example: click