Archive for May, 2010
How to decrypt reviewitonline.net themes
by z3n on May.03, 2010, under Coding, Tips & Hints, lol
Problem:
Somehow there are people so desperated to have their links on free themes they developed that they generated their own method of ecryption, although this one is pretty plain and simple, it really annoyed me to know that it was overloading the server due it’s stupidness.
The “Protection”:
eval(gzinflate(base64_decode(<code>)));
That’s 90 times inside each other, how lame is that?
Solution:
// (c) z3n - R1V1@100503 - www.overflow.biz - rodrigo.orph@gmail.com
if (!isset($argv[1]))
die("Usage: ".$_SERVER['PHP_SELF']." <input.ext>");
$x=file_get_contents($argv[1]);
for ($i=0;strpos($x,"eval(") !== false;$i++) {
file_put_contents("x".$i.".php",str_replace("eval(","file_put_contents('y".$i.".php',",$x));
exec("php x".$i.".php");
$x=file_get_contents("y".$i.".php");
}
Run this and grab the latest y##.php file, that’s your unecrypted file.
MySQL Check, Repair and Optimize All Tables in All Databases
by z3n on May.02, 2010, under Tips & Hints
Problem:
Server got stuck and had to be manually rebooted, some mysql content might be corrupted.
Solution:
I had an old script to check it file by file, however, i found out that MySQL 3.23.38+ got mysqlcheck addition which basically does all the work.
mysqlcheck -u root -p --auto-repair --check --optimize --all-databases
Notes
This might take a long time depending on how big is your data source, although you can run it `on-fly` (while database is actually being used) you may have a slow down on all processes depending on that database/table while it’s being worked on. It also may potentially destroy partially recoverable data, so use –auto-repair with care.
Javascript ParseInt Vs. ParseFloat
by z3n on May.01, 2010, under Coding, Tips & Hints
Problem:
While debbuging an javascript application i found out a wrong calculation result.
Solution:
Apparently javascript been developed my microsoft, due the extensive issues with many misbehaviors it’s quite sad to find out that there’s no way to escape from them.
var test="08"; alert(parseInt(test)+1); // will return 1 alert(parseFloat(test)+1); // will return 9, as supposed to