Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Habbo-images updated. (bypass anti ddos from habbo)

Status
Not open for further replies.
Newbie Spellweaver
Joined
Feb 26, 2011
Messages
40
Reaction score
5
heyy guys,

I found a new methode to still get the avatars from habbo becouse file_get_contens isn`t working anymore.


it caches the avatars in the avatars folder, u can always change that to a other folder.


PHP:
<?php
header('Content-Type: image/png');

$map = './avatars'; //the map where everything will be saved

if (!is_dir($map)) 
    {
        if (!mkdir($map, 0, true)) 
            {
                die('Cant make the folder chmod this folder');
            }
    }

    
$figure = $_GET['figure'];

if(isset($_GET['size'])){
$size = $_GET['size'];
} else { 
$size= 'b';
}

if(isset($_GET['direction'])){
$direction = $_GET['direction'];
} else { 
$direction = '2';
}

if(isset($_GET['head_direction'])){
$head = $_GET['head_direction'];
} else { 
$head = '2'; 
}

if(isset($_GET['gesture'])){
$gesture = $_GET['gesture'];
} else { 
$gesture = '';
}

$lookhash = md5("$figure$size$direction$head$gesture");


if (file_exists("$map/$lookhash.png")) {
    $finalavatar = require("$map/$lookhash.png");
    
} else {
    function downloadavatar($image_url, $image_file){
    $fp = fopen ($image_file, 'w+');

    $ch = curl_init($image_url);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); 
    curl_setopt($ch, CURLOPT_FILE, $fp);         
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
    curl_setopt($ch, CURLOPT_TIMEOUT, 1000);      
    curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0');
    curl_exec($ch);

    curl_close($ch);                              
    fclose($fp);                                  
}

downloadavatar("https://www.habbo.nl/habbo-imaging/avatarimage?figure=".$figure."&size=".$size."&direction=".$direction."&head_direction=".$head."&gesture=".$gesture."", "$map/$lookhash.png");
$finalavatar = require("$map/$lookhash.png");
}


echo $finalavatar; 
?>

it is maybe bad coded but u can always modified and share it with us :)

sorry for my bad english :p
 
Junior Spellweaver
Joined
May 21, 2011
Messages
154
Reaction score
47
Smart of you to use curl. I didn't like the code so I'd a quick modify.

PHP:
<?php

define('DS', DIRECTORY_SEPARATOR);

// default settings
$look = array (
	'figure' => 'hr-145-31.hd-180-1.ch-210-62.lg-285-64.sh-290-62',
	'size' => 'b',
	'direction' => '2',
	'head_direction' => '2',
	'gesture' => ''
);

// default map : ./avatars
if (!is_dir($map = './avatars')) {
	if (!mkdir($map, 0, true)) {
		exit('Can\'t make the folder chmod this folder');
	}
}

foreach ($look as $k => $v) {
	if (!empty($part = filter_input(INPUT_GET, $k))) {
		$look[$k] = $part;
	}
}

$image_path = $map . DS . md5(implode($look)) . '.png';

if (!file_exists($image_path)) {
	$fp = fopen($image_path, 'w+');

	$ch = curl_init('https://www.habbo.nl/habbo-imaging/avatarimage?' . http_build_query($look));
	curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); 
	curl_setopt($ch, CURLOPT_FILE, $fp);         
	curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
	curl_setopt($ch, CURLOPT_TIMEOUT, 1000);      
	curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0');
	curl_exec($ch);

	curl_close($ch);                              
	fclose($fp);  
}

$im = imagecreatefrompng($image_path);

imagesavealpha($im, true); 

header('Content-Type: image/png');
imagepng($im);
imagedestroy($im);
 
Last edited:
Junior Spellweaver
Joined
Apr 20, 2013
Messages
158
Reaction score
12
Can you remake this script to grab the look from the database pelase?
 
Newbie Spellweaver
Joined
Feb 26, 2011
Messages
40
Reaction score
5
Can you remake this script to grab the look from the database pelase?

I hope it works :p haven`t tested it, if not i will fix it for you :p

PHP:
<?php
header('Content-Type: image/png');

     function safe($value){ 
		$value = stripslashes($value);
		$value = strip_tags($value);
		$value = trim($value);
	if(get_magic_quotes_gpc())
		{
			$value = stripslashes($value);
		}
		return $value; } 


$mysqli = new mysqli("localhost", "username", "password", "datebase");

$username = safe($_GET["username"]);
$getlook = $mysqli->query("SELECT look FROM users WHERE username = '". $username ."'");
    while ($record = mysqli_fetch_assoc($getlook))
    {
        $look = $record["look"];
    }
    
$map = './avatars'; //the map where everything will be saved

if (!is_dir($map)) 
    {
        if (!mkdir($map, 0, true)) 
            {
                die('Cant make the folder chmod this folder');
            }
    }

    

if(isset($_GET['size'])){
$size = $_GET['size'];
} else { 
$size= 'b';
}

if(isset($_GET['direction'])){
$direction = $_GET['direction'];
} else { 
$direction = '2';
}

if(isset($_GET['head_direction'])){
$head = $_GET['head_direction'];
} else { 
$head = '2'; 
}

if(isset($_GET['gesture'])){
$gesture = $_GET['gesture'];
} else { 
$gesture = '';
}

$lookhash = md5("$look$size$direction$head$gesture");


if (file_exists("$map/$lookhash.png")) {
    $finalavatar = require("$map/$lookhash.png");
    
} else {
    function downloadavatar($image_url, $image_file){
    $fp = fopen ($image_file, 'w+');

    $ch = curl_init($image_url);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); 
    curl_setopt($ch, CURLOPT_FILE, $fp);         
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
    curl_setopt($ch, CURLOPT_TIMEOUT, 1000);      
    curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0');
    curl_exec($ch);

    curl_close($ch);                              
    fclose($fp);                                  
}

downloadavatar("https://www.habbo.nl/habbo-imaging/avatarimage?figure=".$look."&size=".$size."&direction=".$direction."&head_direction=".$head."&gesture=".$gesture."", "$map/$lookhash.png");
$finalavatar = require("$map/$lookhash.png");
}


echo $finalavatar; 
?>
 
Last edited:

pel

Skilled Illusionist
Joined
Jan 27, 2012
Messages
382
Reaction score
343
I hope it works :p haven`t tested it, if not i will fix it for you :p

PHP:
<?php
header('Content-Type: image/png');

     function safe($value){ 
		$value = stripslashes($value);
		$value = strip_tags($value);
		$value = trim($value);
	if(get_magic_quotes_gpc())
		{
			$value = stripslashes($value);
		}
		return $value; } 


$mysqli = new mysqli("localhost", "username", "password", "datebase");

$username = safe($_GET["username"]);
$getlook = $mysqli->query("SELECT look FROM users WHERE username = '". $username ."'");
    while ($record = mysqli_fetch_assoc($getlook))
    {
        $look = $record;
    }
    
$map = './avatars'; //the map where everything will be saved

if (!is_dir($map)) 
    {
        if (!mkdir($map, 0, true)) 
            {
                die('Cant make the folder chmod this folder');
            }
    }

    

if(isset($_GET['size'])){
$size = $_GET['size'];
} else { 
$size= 'b';
}

if(isset($_GET['direction'])){
$direction = $_GET['direction'];
} else { 
$direction = '2';
}

if(isset($_GET['head_direction'])){
$head = $_GET['head_direction'];
} else { 
$head = '2'; 
}

if(isset($_GET['gesture'])){
$gesture = $_GET['gesture'];
} else { 
$gesture = '';
}

$lookhash = md5("$figure$size$direction$head$gesture");


if (file_exists("$map/$lookhash.png")) {
    $finalavatar = require("$map/$lookhash.png");
    
} else {
    function downloadavatar($image_url, $image_file){
    $fp = fopen ($image_file, 'w+');

    $ch = curl_init($image_url);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); 
    curl_setopt($ch, CURLOPT_FILE, $fp);         
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
    curl_setopt($ch, CURLOPT_TIMEOUT, 1000);      
    curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0');
    curl_exec($ch);

    curl_close($ch);                              
    fclose($fp);                                  
}

downloadavatar("https://www.habbo.nl/habbo-imaging/avatarimage?figure=".$look."&size=".$size."&direction=".$direction."&head_direction=".$head."&gesture=".$gesture."", "$map/$lookhash.png");
$finalavatar = require("$map/$lookhash.png");
}


echo $finalavatar; 
?>

this function called "save" is totally shenanigans. why dont you use $mysqli->real_escape_string($_GET['username']); wth
 
Experienced Elementalist
Joined
Jun 7, 2012
Messages
288
Reaction score
250
this function called "save" is totally shenanigans. why dont you use $mysqli->real_escape_string($_GET['username']); wth

Both are stupid just use prepared statements its much safer. ->
Btw is this not already posted 1000 times.... pfff..
The only thing I see diffrent of the other is that you added a user-agent
 
Newbie Spellweaver
Joined
Feb 26, 2011
Messages
40
Reaction score
5
Both are stupid just use prepared statements its much safer. ->
Btw is this not already posted 1000 times.... pfff..
The only thing I see diffrent of the other is that you added a user-agent

file_get_contents isn`t working anymore i only release a new fix for it.
 
Junior Spellweaver
Joined
Aug 22, 2007
Messages
130
Reaction score
103
just use my links if you like, they're always updated to work

normal


xl


head + a bit of the body (you can adjust how much to show of the body with ?y=100 - y parameter any number)


head with body cutted out


group badges


furniture big


furniture zoom-out (small)


furniture icon


yey.
 
Last edited:
Joined
Feb 22, 2012
Messages
2,103
Reaction score
1,271
Well, instead of using server resources, why not just redirect to habbo page? If you can't, because most of your files are going through some local file, then in this local file instead of file_get_contents and redirects...

It's just an alternative for those whom doesn't want to use server resources... I don't know if it's the best approach though.

PHP:
<?php
function arrayToString($get)
{
    $fields = "";
    foreach($get as $key=>$value) { 
        $fields .= $key.'='.$value.'&'; 
    }		
    return rtrim($fields, '&') . "&";
}
header("Location: http://www.habbo.com.br/habbo-imaging/avatarimage?" . arrayToString($_GET));
?>

It works? Yes, it does. Now, feel free to flame me all you want for this 1337 h4x approach.
 
Custom Title Activated
Loyal Member
Joined
Oct 26, 2012
Messages
2,357
Reaction score
1,086
Yeah because it sounds really fun to extract all the clothes from habbo, for each direction, and then code a script to place everything where it needs to go for all of the different combinations

Yes because if I can recall I've seen people doing that. If I remember Tsuka did it for R35 and Bas did it for some R63 version. It's just laziness of the people nowadays.
 
G'nome sayin'
Joined
May 19, 2011
Messages
459
Reaction score
226
Smart of you to use curl. I didn't like the code so I'd a quick modify.

PHP:
<?php

define('DS', DIRECTORY_SEPARATOR);

// default settings
$look = array (
	'figure' => 'hr-145-31.hd-180-1.ch-210-62.lg-285-64.sh-290-62',
	'size' => 'b',
	'direction' => '2',
	'head_direction' => '2',
	'gesture' => ''
);

// default map : ./avatars
if (!is_dir($map = './avatars')) {
	if (!mkdir($map, 0, true)) {
		exit('Can\'t make the folder chmod this folder');
	}
}

foreach ($look as $k => $v) {
	if (!empty($part = filter_input(INPUT_GET, $k))) {
		$look[$k] = $part;
	}
}

$image_path = $map . DS . md5(implode($look)) . '.png';

if (!file_exists($image_path)) {
	$fp = fopen($image_path, 'w+');

	$ch = curl_init('https://www.habbo.nl/habbo-imaging/avatarimage?' . http_build_query($look));
	curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); 
	curl_setopt($ch, CURLOPT_FILE, $fp);         
	curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
	curl_setopt($ch, CURLOPT_TIMEOUT, 1000);      
	curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0');
	curl_exec($ch);

	curl_close($ch);                              
	fclose($fp);  
}

$im = imagecreatefrompng($image_path);

header('Content-Type: image/png');
imagepng($im);
imagedestroy($im);

Looks pretty but returns figures with white backgrounds.

0VWtkZD - Habbo-images updated. (bypass anti ddos from habbo) - RaGEZONE Forums
 

Attachments

You must be registered for see attachments list
Junior Spellweaver
Joined
May 21, 2011
Messages
154
Reaction score
47
Looks pretty but returns figures with white backgrounds.

0VWtkZD - Habbo-images updated. (bypass anti ddos from habbo) - RaGEZONE Forums

Oh lol add
PHP:
imagesavealpha($im, true);

below $im = ...


Well, instead of using server resources, why not just redirect to habbo page? If you can't, because most of your files are going through some local file, then in this local file instead of file_get_contents and redirects...

It's just an alternative for those whom doesn't want to use server resources... I don't know if it's the best approach though.

PHP:
<?php
function arrayToString($get)
{
    $fields = "";
    foreach($get as $key=>$value) { 
        $fields .= $key.'='.$value.'&'; 
    }		
    return rtrim($fields, '&') . "&";
}
header("Location: http://www.habbo.com.br/habbo-imaging/avatarimage?" . arrayToString($_GET));
?>

It works? Yes, it does. Now, feel free to flame me all you want for this 1337 h4x approach.

Why creating a function like that if there's already a function called:
 

Attachments

You must be registered for see attachments list
Last edited:
Status
Not open for further replies.
Back
Top