SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Evangelist
    Join Date
    Dec 2005
    Posts
    527
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    javascript encoding

    Hello

    What is the type of this encoding ?:
    Code:
    if(typeof(DMAPI)=="undefined")DMAPI={ii:[],ht:[],jb:"DMPPC",jd:1000,kn:function(de,i){var ey=de.frames;for(var u=0;u<ey.length;u++){var ct=ey[u];try{if(ct.name==i)return ct;ct=this.kn(ct,i);if(ct)return ct}catch(e){}}return null},mc:function(h){this.h=h;this.gt=function(){var s=h.bu();s.ke(h)}},fl:[],gt:function(){var b=this;if(b.jp)b.jp();for(var bc=0;bc<b.fl.length;bc++)b.fl[bc].gt()},la:function(ic){var b=this;if(b.fl.length==0){b.jp=window.onload;window.onload=function(){DMAPI.gt()}}b.fl[b.fl.length]=ic},ms:function(r){var b=this;var gd=document.getElementsByTagName("SELECT");if(gd&&gd.length>0){var gf=b.ds(r);var gj=b.cs(r);gj.x+=gf.x;gj.y+=gf.y;var he=[];for(var u=0;u<gd.length;u++){var bi=gd[u];if(!b.ii[bi.uniqueID]){if(bi.style&&bi.style.visibility!="hidden"){var gm=b.ds(bi);if(gm.x<=gj.x&&gm.y<=gj.y){var gn=b.cs(bi);gn.x+=gm.x;gn.y+=gm.y;if(gn.x>gf.x&&gn.y>gf.y){bi.style.visibility="hidden";he[he.length]=bi;b.ii[bi.uniqueID]=r}}}}}if(he.length)b.ht[r.uniqueID]=he}},ma:'',mp:function(r){var ib=this.ht[r.uniqueID];if(ib){for(var i=0;i<ib.length;i++){var bi=ib[i];bi.style.visibility="visible";delete this.ii[bi.uniqueID]}}delete this.ht[r.uniqueID]},mf:function(de){return this.kl(de.document)},kl:function(o){var b=o.body;var x=o.clientHeight?o:b;return  ....
    How can I decode it ?

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,815
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    It is written in javascript and is instructions for creating an object if it doesn't already exist. It is using the shorter version of the notation - here is a longer equivalent:

    Code:
    if(typeof(DMAPI)=="undefined") {
    var DMAPI= new Object();
    DMAPI.ii = new Array();
    DMAPI.ht = new Array();
    DMAPI.jb = "DMPPC";
    DMAPI.jd = 1000;
    DMAPI.kn = function(de,i){var ey=de.frames;for(var u=0;u<ey.length;u++){var ct=ey[u];try{if(ct.name==i)return ct;ct=this.kn(ct,i);if(ct)return ct}catch(e){}}return null};
    DMAPI.mc = function(h){this.h=h;this.gt=function(){var s=h.bu();s.ke(h)}};
    DMAPI.fl = new Array();
    DMAPI.gt = function(){var b=this;if(b.jp)b.jp();for(var bc=0;bc<b.fl.length;bc++)b.fl[bc].gt()};
    DMAPI.la = (ic){var b=this;if(b.fl.length==0){b.jp=window.onload;window.onload=function(){DMAPI.gt()}}b.fl[b.fl.length]=ic},ms:function(r){var b=this;var gd=document.getElementsByTagName("SELECT");if(gd&&gd.length>0){var gf=b.ds(r);var gj=b.cs(r);gj.x+=gf.x;gj.y+=gf.y;var he=[];for(var u=0;u<gd.length;u++){var bi=gd[u];if(!b.ii[bi.uniqueID]){if(bi.style&&bi.style.visibility!="hidden"){var gm=b.ds(bi);if(gm.x<=gj.x&&gm.y<=gj.y){var gn=b.cs(bi);gn.x+=gm.x;gn.y+=gm.y;if(gn.x>gf.x&&gn.y>gf.y){bi.style.visibility="hidden";he[he.length]=bi;b.ii[bi.uniqueID]=r}}}}}if(he.length)b.ht[r.uniqueID]=he}};
    DMAPI.ma = '';
    DMAPI.mp = function(r){var ib=this.ht[r.uniqueID];if(ib){for(var i=0;i<ib.length;i++){var bi=ib[i];bi.style.visibility="visible";delete this.ii[bi.uniqueID]}}delete this.ht[r.uniqueID]};
    DMAPI.mf = function(de){return this.kl(de.document)};
    DMAPI.kl=function(o){var b=o.body;var x=o.clientHeight?o:b;return ...
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  3. #3
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Someone probably wrote the javascript in a more human-readable format and then compressed it with a tool like this one which compresses the javascript into something that saves on the kilobytes but becomes barely human-readable.

  4. #4
    SitePoint Evangelist
    Join Date
    Dec 2005
    Posts
    527
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    so how can I unpack it ?

  5. #5
    SitePoint Wizard
    Join Date
    Nov 2004
    Location
    Nelson BC
    Posts
    2,310
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You don't...
    // DMAPI v.3.0.6210.1544 Copyright (c) DevMansion.Com 2002-2006. Any reverse-engineering, alteration and transformation are strictly prohibited.
    Looks like you can use it relatively free though...
    http://www.devmansion.com/products/J...u/Default.aspx


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •