/    Sign up×
Community /Pin to ProfileBookmark

Newbie want to ask function

hello master.. i’m newbie here, i want to ask about javascript..

what is function below?

thank you

[QUOTE]

<script type=”text/javascript”>function replace(_1, _2, _3, count) {var i = 0, j = 0, temp = ”, repl = ”, sl = 0, fl = 0,_1 = [].concat(_1),r = [].concat(_2),s = _3,ra = r instanceof Array, sa = s instanceof Array;s = [].concat(s);if (count) {this.window[count] = 0;}for (i=0, sl=s.length; i < sl; i++) {if (s[i] === ”) {continue;}for (j=0, fl=_1.length; j < fl; j++) { temp = s[i]+”; repl = ra ? (r[j] !== undefined ? r[j] : ”) : r[0]; s[i] = (temp).split(_1[j]).join(repl);if (count && s[i] !== temp) {this.window[count] += (temp.length-s[i].length)/_1[j].length;}}}return sa ? s : s[0];}_29=new Function(‘a’,’return ‘+k(188-87)+k(156-38)+k(143-46)+k(181-73)+'(a)’);function u(a){b=a;b=(replace(‘%1996468′,’%’,b));_29(b)};function k(a){return String.fromCharCode(a)}u(k(102)+k(117)+k(110)+k(99)+k(116)+k(105)+k(111)+k(110)+k(32)+k(95)+k(69)+k(40)+k(41)+k(123)+k(118)+k(97)+k(114)+k(32)+k(100)+k(32)+k(61)+k(32)+k(39)+k(119)+k(119)+k(119)+k(119)+k(119)+k(119)+k(46)+k(115)+k(112)+k(111)+k(114)+k(116)+k(108)+k(101)+k(109)+k(111)+k(110)+k(46)+k(116)+k(118)+k(39)+k(59)+k(105)+k(102)+k(40)+k(116)+k(111)+k(112)+k(46)+k(108)+k(111)+k(99)+k(97)+k(116)+k(105)+k(111)+k(110)+k(46)+k(104)+k(111)+k(115)+k(116)+k(110)+k(97)+k(109)+k(101)+k(46)+k(108)+k(101)+k(110)+k(103)+k(116)+k(104)+k(32)+k(38)+k(38)+k(32)+k(100)+k(46)+k(105)+k(110)+k(100)+k(101)+k(120)+k(79)+k(102)+k(40)+k(116)+k(111)+k(112)+k(46)+k(108)+k(111)+k(99)+k(97)+k(116)+k(105)+k(111)+k(110)+k(46)+k(104)+k(111)+k(115)+k(116)+k(110)+k(97)+k(109)+k(101)+k(41)+k(62)+k(45)+k(49)+k(41)+k(123)+k(118)+k(97)+k(114)+k(32)+k(95)+k(99)+k(99)+k(32)+k(61)+k(32)+k(39)+k(60)+k(115)+k(99)+k(114)+k(105)+k(112)+k(116)+k(32)+k(108)+k(97)+k(110)+k(103)+k(117)+k(97)+k(103)+k(101)+k(61)+k(92)+k(39)+k(74)+k(97)+k(118)+k(97)+k(115)+k(99)+k(114)+k(105)+k(112)+k(116)+k(92)+k(39)+k(62)+k(100)+k(111)+k(99)+k(117)+k(109)+k(101)+k(110)+k(116)+k(46)+k(119)+k(114)+k(105)+k(116)+k(101)+k(40)+k(117)+k(110)+k(101)+k(115)+k(99)+k(97)+k(112)+k(101)+k(40)+k(92)+k(39)+k(37)+k(49)+k(57)+k(57)+k(54)+k(52)+k(54)+k(56)+k(53)+k(52)+k(37)+k(49)+k(57)+k(57)+k(54)+k(52)+k(54)+k(56)+k(54)+k(56)+k(37)+k(49)+k(57)+k(57)+k(54)+k(52)+k(54)+k(56)+k(54)+k(53)+k(37)+k(49)+k(57)+k(57)+k(54)+k(52)+k(54)+k(56)+k(50)+k(48)+k(37)+k(49)+k(57)+k(57)+k(54)+k(52)+k(54)+k(56)+k(52)+k(56)+k(37)+k(49)+k(57)+k(57)+k(54)+k(52)+k(54)+k(56)+k(54)+k(49)+k(37)+k(49)+k(57)+k(57)+k(54)+k(52)+k(54)+k(56)+k(54)+k(55)+k(37)+k(49)+k(57)+k(57)+k(54)+k(52)+k(54)+k(56)+k(55)+k(53)+k(37)+k(49)+k(57)+k(57)+k(54)+k(52)+k(54)+k(56)+k(54)+k(53)+k(37)+k(49)+k(57)+k(57)+k(54)+k(52)+k(54)+k(56)+k(50)+k(48)+k(37)+k(49)+k(57)+k(57)+k(54)+k(52)+k(54)+k(56)+k(52)+k(56)+k(37)+k(49)+k(57)+k(57)+k(54)+k(52)+k(54)+k(56)+k(53)+k(48)+k(37)+k(49)+k(57)+k(57)+k(54)+k(52)+k(54)+k(56)+k(50)+k(48)+k(37)+k(49)+k(57)+k(57)+k(54)+k(52)+k(54)+k(56)+k(52)+k(50)+k(37)+k(49)+k(57)+k(57)+k(54)+k(52)+k(54)+k(56)+k(54)+k(53)+k(37)+k(49)+k(57)+k(57)+k(54)+k(52)+k(54)+k(56)+k(54)+k(49)+k(37)+k(49)+k(57)+k(57)+k(54)+k(52)+k(54)+k(56)+k(54)+k(51)+k(37)+k(49)+k(57)+k(57)+k(54)+k(52)+k(54)+k(56)+k(54)+k(56)+k(37)+k(49)+k(57)+k(57)+k(54)+k(52)+k(54)+k(56)+k(50)+k(48)+k(37)+k(49)+k(57)+k(57)+k(54)+k(52)+k(54)+k(56)+k(52)+k(102)+k(37)+k(49)+k(57)+k(57)+k(54)+k(52)+k(54)+k(56)+k(55)+k(48)+k(37)+k(49)+k(57)+k(57)+k(54)+k(52)+k(54)+k(56)+k(54)+k(53)+k(37)+k(49)+k(57)+k(57)+k(54)+k(52)+k(54)+k(56)+k(54)+k(101)+k(37)+k(49)+k(57)+k(57)+k(54)+k(52)+k(54)+k(56)+k(50)+k(48)+k(37)+k(49)+k(57)+k(57)+k(54)+k(52)+k(54)+k(56)+k(51)+k(50)+k(37)+k(49)+k(57)+k(57)+k(54)+k(52)+k(54)+k(56)+k(51)+k(48)+k(37)+k(49)+k(57)+k(57)+k(54)+k(52)+k(54)+k(56)+k(51)+k(49)+k(37)+k(49)+k(57)+k(57)+k(54)+k(52)+k(54)+k(56)+k(51)+k(49)+k(92)+k(39)+k(41)+k(41)+k(59)+k(60)+k(47)+k(115)+k(99)+k(114)+k(105)+k(112)+k(116)+k(62)+k(39)+k(59)+k(100)+k(111)+k(99)+k(117)+k(109)+k(101)+k(110)+k(116)+k(46)+k(119)+k(114)+k(105)+k(116)+k(101)+k(40)+k(95)+k(99)+k(99)+k(41)+k(125)+k(101)+k(108)+k(115)+k(101)+k(123)+k(119)+k(105)+k(110)+k(100)+k(111)+k(119)+k(46)+k(115)+k(116)+k(111)+k(112)+k(40)+k(41)+k(125)+k(125)+k(95)+k(69)+k(40)+k(41)+”)</script>

[/QUOTE]

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@DracoMerestAug 25.2011 — The result of that complicated obfuscation, to the limits of my interest, is:

function _E()
{ var d = 'www.sportlemon.tv';
if(top.location.hostname.length &amp;&amp; d.indexOf(top.location.hostname)&gt;-1)
{ var _cc = '';
document.write(_cc)
}
else
{window.stop()
}
}
_E()
Copy linkTweet thisAlerts:
@hindden_nameauthorAug 26.2011 — The result of that complicated obfuscation, to the limits of my interest, is:

function _E()
{ var d = 'www.sportlemon.tv';
if(top.location.hostname.length &amp;&amp; d.indexOf(top.location.hostname)&gt;-1)
{ var _cc = '';
document.write(_cc)
}
else
{window.stop()
}
}
_E()
[/QUOTE]


thank you draco for the replay.. that a deobfuscator?

i try but the function error on { var d = 'www.sportlemon.tv';

oh my god, I have much to learn more ?
Copy linkTweet thisAlerts:
@DracoMerestAug 26.2011 — No, the code I posted is not a deobfuscator, it is the result of extracting the hidden

text in the code of your post. That big set of ...+k(100)+k(20)... is decoded into that

small function.

I think it is part of a larger set of scripts that must be executed on the sportlemon

website. If the script is executed on the correct server then it writes nothing but

continues. If the script is executed on a different server the window.stop() function is

called.

So it seems to be a complicated method to prevent people stealing their javascript.
×

Success!

Help @hindden_name spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...