Reverse Engineer Packer javascript

June 11th, 2009   Filed Under Good to know, Javascript, Tips & Tricks, browser, debuggers, firefox, gyan  

Have you ever seen a code something like this:

eval(function(p,a,c,k,e,r){e=funct.... etc....

And you suffer reading the encoded code. No suffers now; because I am going to tell you a trick  that will convert your packer code in a readable script.

And it is really simple …. just replace the eval word with alert and refresh your page. You can now copy the code from the alert box.

If you face the problem of copying it from the alert box then open firefox browser with firebug pre-installed.

Open the console using F12 key and paste the code in the editable window.

Now replace the first word “eval” with “console.log” and hit run.

Probably you would need Javascript Tidy to make it properly readable.

Enjoy Madi!!

Internet Explorer 8 Beta - Download

March 7th, 2008   Filed Under browser, comparisons, debuggers  

Download Windows Internet Explorer 8 Beta for Windows XP

http://www.microsoft.com/downloads/thankyou.aspx?familyId=1a2e3ddd-b38b-439d-bba7-f179a5d3ecaf&displayLang=en

Microsoft has released its Beta version of highly disgussed(disgusting discussions) IE 8. You can download it from the following link. By default you will be prompted to download Silverlight. You can download it if you wish to.

However, this version of browser will not be installed on checked(debug) version of Windows Vista, Windows Vista SP1, or Windows Server 2008.

IE 8 Installer Screenshot

What does it copy? Copies so many things from Firefox and its plugins.
Restore Session: Just as FF plugin, it restores the previous session of opened tabs if because of some exception your browser closed unexpectedly.
IEr Bug: Just removed the F from the Firebug and has given almost the same functionalities as Firebug plugin for Firefox. Just removed the “flexibility” and ease Firebug provides you. But appreciate the copy, as it will reduce a lot of unwanted efforts for the UI developers.
Compatibility Modes: While debugging, you can change the browser version compatibility to test if it works with IE5, IE7 and IE8… oops missed IE6.. maybe in the final release they will add IE6.
No live CSS edit: As you get a live css edit in Firefox, here you cannot do that. You need to go to each and every element on the HTML tab and turn on or off the applied styles. No way to add new CSS Text.
Inspect: Here it is “Select element by click”, but does pretty much the same thing. Good CTRL + C. But oops… while inspecting in FF on an element the click event is not registered for the element, but it is transferred to Inspector. IE8 … I think thats a bug probably!!
Activities: A good add-on feature that enables your users to find for contextual services like map, restaurants etc etc in place. This is an extendible tool for the users. You can even copy text to you blogs or web pages. Microsoft appreciates copying?? Thats just a prank… but its cool thing to have.
WebSlices: WebSlices is a new feature for websites to connect to their users by subscribing to content directly within a webpage. WebSlices behave just like feeds where clients can subscribe to get updates and notify the user of changes
CSS 2.1: Hmm sounds good
Data URI Support: Now you can embed your images as you can do it in Firefox: <img alt=”Image fed from data url” src=”data:image/png;base64,iVBORw0KGgoAAA…” />. Good to have for the bloggers who don’t want to have images repository anywhere.
Versioning and Cross-document Interaction: This is just what I wished. I told that to Sudipto. Internet Explorer 8 introduces the IE8 standards mode by default—this lets Web designers use the latest rendering features available in Internet Explorer 8. In addition to layout changes, IE8 standards mode will also affect the behavior of scripted APIs (DOM).
To opt-out of IE8 standards mode, the META tag may be used to obtain IE7 compatibility mode:
<meta http-equiv="X-UA-Compatible" content="IE=7">
Whooooo Hoooooo
But we need compatibility with IE6 and Quirks too.

Now the copies from FF3:
AJAX Navigation: Enables users to navigate back and forth without leaving the AJAX application and could be used navigating a page without performing a traditional full navigation. This allows websites to trigger an update to browser components like the address bar by setting the window.location.hash value, firing an event to alert components in the page and even creating an entry in the travel log.

DOM Storage: Concept pretty much around classic asp session variables, but will not be available in previous versions or other browser vendors. This is a simple-to-use method for storing and retrieving strings of key/value pair data. Data can be stored per tab instance for a session or persisted to the local machine. This allows pages to cache text on the machine which reduces the effect of network latencies by providing faster access to pre-cached data. Several innovative uses are possible. For example, use this in combination with the new network connectivity event to allow a page to cache data if it detects that the computer is offline.

Connectivity events allow websites to check when the user is connected to the network and receive notification of connectivity changes. FF you inspire.

Six connections per host instead of two for broadband scenarios and a scriptable property allow for more improved performance by allowing parallelization of downloads in Internet Explorer 8. In addition, this increases functionality by ensuring a request is not blocked to a host if two connections already exist. Websites can optimize their downloads based on a scriptable property.

XMLHTTPRequest Enhancements include a timeout property that can be set to cancel the request if necessary, allowing developers to manage the request better.

Cross domain requests(XDR): A new jargon, but also a feature to communicate across domains. Firefox 3 has also done the same. I am not sure about the code we need to write to allow this feature. But suspect to be different from Firefox … so again and if… else perhaps.

Selectors API: This is the most wanted feature. Copied from jQuery. This enables you to select your web page elements like CSS. For Example:

For selecting some required fields in your form you write something like this:

function doValidation(){ // Retrieve all the required elements by ID
var name = document.getElementById('fld_name');
var empnum = document.getElementById('fld_emp');
var ssn = document.getElementById('fld_ssn');
var ccnum = document.getElementById('fld_ccNum');
var bribe = document.getElementById('fld_cost');
// Set the flag to false by default
var missingRequiredField = false;
// Validate each of the elements
if (name.childNodes[1].value == "") missingRequiredField = true;
if (empnum.childNodes[1].value == "") missingRequiredField = true;
if (ssn.childNodes[1].value == "") missingRequiredField = true;
if (ccnum.childNodes[1].value == "") missingRequiredField = true;
if (bribe.childNodes[1].value == "") missingRequiredField = true;

But now with Selector API you do this:

function doValidation () {
// Retrieve the required elements by using Selectors
// Selects all the form fields with 'required' classes
var reqs = document.querySelectorAll(".required");
// Set the flag to false by default
var missingRequiredField = false;
// Validate that the form data is not empty
for (var i = 0; i < reqs.length; i++)
{
if (reqs[i].value == "") missingRequiredField = true;
}

Coool No?
Whatever it copies doesn’t actually matter too much because, its all the need of the time. And after all its a race. To compete one need to imitate all that is needed.

Debugger for Internet Explorer

February 15th, 2008   Filed Under Javascript, Tips & Tricks, browser, debuggers  

If there was no Firebug this would be a great tool to have for any developer, but as firebug has set the benchmark in quality debugging, this tool has become mere an information plugin for Microsoft’s Grade-A browser.

But definitely its a sigh for the web developers to see something at last for the black boxed IE.