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!

Some random dynamic signature

Newbie Spellweaver
Joined
Dec 18, 2010
Messages
68
Reaction score
5
A random dynamic banner.

old:
PHP:
<?php
header("Content-type: image/png");
$poop = $_GET['name'];
if (isset($_GET['img'])) {
	$charimg = $_GET['img'];
} else {
	$charimg = 0;
}
if (isset($_GET['skin'])) {
	$skin = $_GET['skin'];
} else {
	$skin = 0;
}
$poop = preg_replace("/[^A-Za-z0-9 ]/", '', $poop);
//$dir = "stats/";
$dir = "";
if ($charimg != 0) {
	$char = imagecreatefrompng('generate your own character here i\'m not giving you mine');
	switch ($skin) {
		case 1: $what = "s1_n.png"; break;
		case 2: $what = "s2_n.png"; break;
		case 3: $what = "s3_n.png"; break;
		case 4: $what = "s4_n.png"; break;
		default: $what = 'whatever.png'; break;
	}
} else {
	switch ($skin) {
		case 1: $what = "s1.png"; break;
		case 2: $what = "s2.png"; break;
		case 3: $what = "s4.png"; break;
		case 4: $what = "s4.png"; break;
		default: $what = "whatever.png"; break;
	}
}
$im = imagecreatefrompng($dir.$what); 
$text = imagecolorallocate($im, 0, 0, 0);
$text2 = imagecolorallocate($im, 0, 0, 0);
$font = "font.ttf";
if ($charimg != 0) {
	imagecopy($im, $char, 415, 175, 0, 0, 100, 100);
} else {
	imagettftext($im, 15, 0, 475, 215, $text, $dir."font.ttf", getFame($poop));
}
$x = 0;
imagettftext($im, 15, 0, 160, 66, $text, $dir."font.ttf", $poop);
imagettftext($im, 15, 0, 150, 138, $text, $dir."font.ttf", getGuild($poop));
imagettftext($im, 15, 0, 150, 215, $text, $dir."font.ttf", getClass($poop));
imagettftext($im, 15, 0, 475, 66, $text, $dir."font.ttf", getLevel($poop));
imagettftext($im, 15, 0, 468, 138, $text, $dir."font.ttf", getRank($poop));




imagepng($im);
imagedestroy($im);




function getGuild($poop) {
	@mysql_connect("localhost", "root", "") or DIE('Connection Error: '.mysql_error());
	@mysql_select_db("sekai");
	$idQ = @mysql_query("SELECT `guildid` FROM `characters` WHERE `name` = '".$poop."'") or DIE('Query Error: '.MySQL_ERROR());
	$idR = mysql_fetch_row($idQ);
	$id = $idR[0];
	$gnameQ = @mysql_query("SELECT `name` FROM `guilds` WHERE `guildid` = ".$id) or DIE('Query Error: '.MySQL_ERROR());
	$gnameR = mysql_fetch_row($gnameQ);
	$gname = $gnameR[0];
	if ($gname == null) {
		$gname = "No Guild";
	}
	return $gname;
}




function getClass($poop) {
	@mysql_connect("localhost", "root", "") or DIE('Connection Error: '.mysql_error());
	@mysql_select_db("konbanwa");
	$classidQ = @mysql_query("SELECT `job` FROM `characters` WHERE `name` = '".$poop."'") or DIE('Query Error: '.MySQL_ERROR());
	$classidR = mysql_fetch_row($classidQ);
	$classid = $classidR[0];
	$class = "";
	switch ($classid) {
		case 0: $class = "Beginner"; break;
		case 100: $class = "Swordsman"; break;
		case 110: $class = "Fighter"; break;
		case 111: $class = "Crusader"; break;
		case 112: $class = "Hero"; break;
		case 120: $class = "Page"; break;
		case 121: $class = "White Knight"; break;
		case 122: $class = "Paladin"; break;
		case 130: $class = "Spearman"; break;
		case 131: $class = "Dragon Knight"; break;
		case 132: $class = "Dark Knight"; break;
		case 200: $class = "Magician"; break;
		case 210: $class = "Wizard F/P"; break;
		case 211: $class = "Mage F/P"; break;
		case 212: $class = "Archmage F/P"; break;
		case 220: $class = "Wizard I/L"; break;
		case 221: $class = "Mage I/L"; break;
		case 222: $class = "Archmage I/L"; break;
		case 230: $class = "Cleric"; break;
		case 231: $class = "Priest"; break;
		case 232: $class = "Bishop"; break;
		case 300: $class = "Archer"; break;
		case 310: $class = "Hunter"; break;
		case 311: $class = "Ranger"; break;
		case 312: $class = "Bowmaster"; break;
		case 320: $class = "Crossbowman"; break;
		case 321: $class = "Sniper"; break;
		case 322: $class = "Marksman"; break;
		case 400: $class = "Rogue"; break;
		case 410: $class = "Assassin"; break;
		case 411: $class = "Hermit"; break;
		case 412: $class = "Night Lord"; break;
		case 420: $class = "Bandit"; break;
		case 421: $class = "Chief Bandit"; break;
		case 422: $class = "Shadower"; break;
		case 430: $class = "Blade Recruit"; break;
		case 431: $class = "Blade Acolyte"; break;
		case 432: $class = "Blade Specialist"; break;
		case 433: $class = "Blade Lord"; break;
		case 434: $class = "Blade Master"; break;
		case 500: case 501: $class = "Pirate"; break;
		case 508: case 570: case 571: case 572: $class = "Jett"; break;
		case 510: $class = "Brawler"; break;
		case 511: $class = "Marauder"; break;
		case 512: $class = "Buccaneer"; break;
		case 520: $class = "Gunslinger"; break;
		case 521: $class = "Outlaw"; break;
		case 522: $class = "Corsair"; break;
		case 530: $class = "Cannoneer"; break;
		case 531: $class = "Cannon Trooper"; break;
		case 532: $class = "Cannon Master"; break;
		case 800: $class = "Manager"; break;
		case 900: $class = "GM"; break;
		case 910: $class = "Super GM"; break;
		case 1000: $class = "Noblesse"; break;
		case 1100: case 1110: case 1111: case 1112: $class = "Dawn Warrior"; break;
		case 1200: case 1210: case 1211: case 1212: $class = "Blaze Wizard"; break;
		case 1300: case 1310: case 1311: case 1312: $class = "Wind Archer"; break;
		case 1400: case 1410: case 1411: case 1412: $class = "Night Walker"; break;
		case 1500: case 1510: case 1511: case 1512: $class = "Thunder Breaker"; break;
		case 2000: $class = "Legend"; break;
		case 2001: case 2200: case 2210: case 2211: case 2212: case 2213: case 2214: case 2215: case 2216: case 2217: case 2218: $class = "Evan"; break;
		case 2002: case 2300: case 2312: case 2322: $class = "Mercedes"; break;
		case 2003: case 2400: case 2410: case 2411: case 2412: $class = "Phantom"; break;
		case 2100: case 2110: case 2111: case 2112: $class = "Aran"; break;
		case 3000: $class = "Citizen";
	}
	if ($class == null) {
		return "Unhandled ID ".$classid;
	}
	return $class;
}
	
function getLevel($poop) {
	@mysql_connect("localhost", "root", "") or DIE('Connection Error: '.mysql_error());
	@mysql_select_db("sekai");
	$lvlQ = @mysql_query("SELECT `level` FROM `characters` WHERE `name` = '".$poop."'") or DIE('Query Error: '.MySQL_ERROR());
	$lvlR = mysql_fetch_row($lvlQ);
	$lvl = $lvlR[0];
	return $lvl;
}




function getFame($poop) {
	@mysql_connect("localhost", "root", "") or DIE('Connection Error: '.mysql_error());
	@mysql_select_db("world");
	$lvlQ = @mysql_query("SELECT `fame` FROM `characters` WHERE `name` = '".$poop."'") or DIE('Query Error: '.MySQL_ERROR());
	$lvlR = mysql_fetch_row($lvlQ);
	$lvl = $lvlR[0];
	return $lvl;
}




function getRank($poop) {
	@mysql_connect("localhost", "root", "") or DIE('Connection Error: '.mysql_error());
	@mysql_select_db("hello");
	$rankQ = @mysql_query("SELECT `name` FROM `characters` WHERE gm < 4 ORDER BY `level` desc, `fame` desc") or DIE('Query Error: '.MySQL_ERROR());
	$rank = 0;
	while($chars = mysql_fetch_row($rankQ)) {
		$rank = $rank + 1;
		if ($chars[0] == $poop) {
			return $rank;
		} 		
	}
	return "whatever";
}
?>

-removed the live link as I accidentally deleted it while trying to edit it-

Just make a php file with it, and edit the stuff you need.
like db info blah

and also add a font.ttf in that directory. figure out the rest of it

this guy inspired me to release this blarghy stuff : View Profile: Squall - RaGEZONE - MMORPG development forums

watch his level go up or not

here's the whatever.png if you want it
whatever - Some random dynamic signature - RaGEZONE Forums

note: this has more random functions, but they have been disabled. you can figure them out yourself and add them in

note2: i know that a bunch of it was coded badly :p

note3: fix the rankings yourself if you want. this was made for a low rate

note4: access it through yoursite.com/thisfile.php?name=yourcharactername

edit:

Try recoding the SQL part to be one section with .

should remove possibilities of sqli
Updated :C
PHP:
<?php
header("Content-type: image/png");

require_once 'meekrodb.2.1.class.php';
DB::$user = 'your beautiful mysql username';
DB::$password = 'your beautiful mysql password';
DB::$dbName = 'your beautiful database name';

$poop = $_GET['name'];
$what = 'whatever.png';
$im = imagecreatefrompng($what); 
$text = imagecolorallocate($im, 0, 0, 0);

$results = DB::queryFirstRow("SELECT guildid, job, level, fame FROM characters WHERE name = %s", $poop);
$guildid = $results['guildid'];
$classid = $results['job'];
$level = $results['level'];
$fame = $results['fame'];

if ($guildid == 0) {
	$guild = "No Guild";
} else {
	$guildQ = DB::queryFirstRow("SELECT name FROM guilds WHERE guildid = %i", $guildid);
	$guild = $guildQ['name'];
}
switch ($classid) {
		case 0: $class = "Beginner"; break;
		case 100: $class = "Swordsman"; break;
		case 110: $class = "Fighter"; break;
		case 111: $class = "Crusader"; break;
		case 112: $class = "Hero"; break;
		case 120: $class = "Page"; break;
		case 121: $class = "White Knight"; break;
		case 122: $class = "Paladin"; break;
		case 130: $class = "Spearman"; break;
		case 131: $class = "Dragon Knight"; break;
		case 132: $class = "Dark Knight"; break;
		case 200: $class = "Magician"; break;
		case 210: $class = "Wizard F/P"; break;
		case 211: $class = "Mage F/P"; break;
		case 212: $class = "Archmage F/P"; break;
		case 220: $class = "Wizard I/L"; break;
		case 221: $class = "Mage I/L"; break;
		case 222: $class = "Archmage I/L"; break;
		case 230: $class = "Cleric"; break;
		case 231: $class = "Priest"; break;
		case 232: $class = "Bishop"; break;
		case 300: $class = "Archer"; break;
		case 310: $class = "Hunter"; break;
		case 311: $class = "Ranger"; break;
		case 312: $class = "Bowmaster"; break;
		case 320: $class = "Crossbowman"; break;
		case 321: $class = "Sniper"; break;
		case 322: $class = "Marksman"; break;
		case 400: $class = "Rogue"; break;
		case 410: $class = "Assassin"; break;
		case 411: $class = "Hermit"; break;
		case 412: $class = "Night Lord"; break;
		case 420: $class = "Bandit"; break;
		case 421: $class = "Chief Bandit"; break;
		case 422: $class = "Shadower"; break;
		case 430: $class = "Blade Recruit"; break;
		case 431: $class = "Blade Acolyte"; break;
		case 432: $class = "Blade Specialist"; break;
		case 433: $class = "Blade Lord"; break;
		case 434: $class = "Blade Master"; break;
		case 500: case 501: $class = "Pirate"; break;
		case 508: case 570: case 571: case 572: $class = "Jett"; break;
		case 510: $class = "Brawler"; break;
		case 511: $class = "Marauder"; break;
		case 512: $class = "Buccaneer"; break;
		case 520: $class = "Gunslinger"; break;
		case 521: $class = "Outlaw"; break;
		case 522: $class = "Corsair"; break;
		case 530: $class = "Cannoneer"; break;
		case 531: $class = "Cannon Trooper"; break;
		case 532: $class = "Cannon Master"; break;
		case 800: $class = "Manager"; break;
		case 900: $class = "GM"; break;
		case 910: $class = "Super GM"; break;
		case 1000: $class = "Noblesse"; break;
		case 1100: case 1110: case 1111: case 1112: $class = "Dawn Warrior"; break;
		case 1200: case 1210: case 1211: case 1212: $class = "Blaze Wizard"; break;
		case 1300: case 1310: case 1311: case 1312: $class = "Wind Archer"; break;
		case 1400: case 1410: case 1411: case 1412: $class = "Night Walker"; break;
		case 1500: case 1510: case 1511: case 1512: $class = "Thunder Breaker"; break;
		case 2000: $class = "Legend"; break;
		case 2001: case 2200: case 2210: case 2211: case 2212: case 2213: case 2214: case 2215: case 2216: case 2217: case 2218: $class = "Evan"; break;
		case 2002: case 2300: case 2312: case 2322: $class = "Mercedes"; break;
		case 2003: case 2400: case 2410: case 2411: case 2412: $class = "Phantom"; break;
		case 2100: case 2110: case 2111: case 2112: $class = "Aran"; break;
		case 3000: $class = "Citizen";
}

imagettftext($im, 15, 0, 475, 215, $text, "font.ttf", $fame);
imagettftext($im, 15, 0, 160, 66, $text, "font.ttf", $poop);
imagettftext($im, 15, 0, 150, 138, $text, "font.ttf", $guild);
imagettftext($im, 15, 0, 150, 215, $text, "font.ttf", $class);
imagettftext($im, 15, 0, 475, 66, $text, "font.ttf", $level);
imagettftext($im, 15, 0, 468, 138, $text, "font.ttf", "Removed");


imagepng($im);
imagedestroy($im);
?>
You need to download for that.
SQLi should be patched up, and so should the 5 queries
 

Attachments

You must be registered for see attachments list
Last edited:
Infraction Baɴɴed
Loyal Member
Joined
Apr 9, 2008
Messages
1,416
Reaction score
169
holy crap how many more connections do you need to get the info you want???? open 1 get all the info you need then close.

if you wanted variable names instead of $bluh[index] then use list(cool, names, go, here) = $array
 
Newbie Spellweaver
Joined
Dec 18, 2010
Messages
68
Reaction score
5
holy crap how many more connections do you need to get the info you want???? open 1 get all the info you need then close.

if you wanted variable names instead of $bluh[index] then use list(cool, names, go, here) = $array

doesnt really matter. as much as i'd love to edit it, i dont really care enough about 5 fewer connections

The one i have has a cacher.
 
Infraction Baɴɴed
Loyal Member
Joined
Apr 9, 2008
Messages
1,416
Reaction score
169
doesnt really matter. as much as i'd love to edit it, i dont really care enough about 5 fewer connections

The one i have has a cacher.
then your expecting a low traffic server. say if a server has 100 people accessing it at any given time thats 500 connections.
 
Newbie Spellweaver
Joined
Dec 18, 2010
Messages
68
Reaction score
5
then your expecting a low traffic server. say if a server has 100 people accessing it at any given time thats 500 connections.

They have a 24 hour long cache (didnt add the cache system here) so it would only be 5 connections per unique person that gets looked up per day.

but yeah, it was made for a lowish traffic server.

Any server owner with more traffic should know how to edit it :p
 
Infraction Baɴɴed
Loyal Member
Joined
Apr 9, 2008
Messages
1,416
Reaction score
169
They have a 24 hour long cache (didnt add the cache system here) so it would only be 5 connections per unique person that gets looked up per day.

but yeah, it was made for a lowish traffic server.

Any server owner with more traffic should know how to edit it :p
know your audience, you have to think everyone here is a brain dead child or you get hundreds of help threads.

the problem is you cant assume people understand
 
Newbie Spellweaver
Joined
Dec 18, 2010
Messages
68
Reaction score
5
know your audience, you have to think everyone here is a brain dead child or you get hundreds of help threads.

the problem is you cant assume people understand

So you're saying that I should make this completely spoonfed? :p
 
Joined
Jun 28, 2006
Messages
285
Reaction score
165
OP is a troll, basically making server owners DDoS themselves with this script lol.

I'm sure it's intention is for users to add to their signatures on forum posts to advertise their character and the server, etc, and each time a user loads said image, it's going to connect to YOUR server 5 times PER IMAGE. Multiple posts? Multiple users using said image in their posts? Very popular forum it's being shown on? gg also your OWN link takes like 3 seconds to load:

Coincidentally I was just working on some GD myself, shown in my rankings:

(The character's avatar)

Also if you use holthelper's character ranking images, you could actually do and show the user's in-game character on this script, too.

Basically, this script needs some serious cleaning-up, but it's at least a good start.

Also I'm surprised no one even noticed his code is easily injectable:
 
Joined
Jul 12, 2011
Messages
1,229
Reaction score
475
OP is a troll, basically making server owners DDoS themselves with this script lol.

I'm sure it's intention is for users to add to their signatures on forum posts to advertise their character and the server, etc, and each time a user loads said image, it's going to connect to YOUR server 5 times PER IMAGE. Multiple posts? Multiple users using said image in their posts? Very popular forum it's being shown on? gg also your OWN link takes like 3 seconds to load:

Coincidentally I was just working on some GD myself, shown in my rankings:

(The character's avatar)

Also if you use holthelper's character ranking images, you could actually do and show the user's in-game character on this script, too.

Basically, this script needs some serious cleaning-up, but it's at least a good start.

Also I'm surprised no one even noticed his code is easily injectable:
He addressed that issue :p
Thanks for mentioning that imagecreatefrompng thing, that'll be useful when I make a better signature generator
 
Joined
Jun 28, 2006
Messages
285
Reaction score
165
He addressed that issue :p
Thanks for mentioning that imagecreatefrompng thing, that'll be useful when I make a better signature generator
If you're gonna take that tip, you're gonna need to play around with imagealphablending(), imagecopyresampled(), and imagesavealpha() or else it's not gonna alpha properly and you'll be stuck with a white/colored/other background instead of transparent (if this is what you're aiming for). Also, some random code for you to play around with, too, regarding BMPs:

 
Infraction Baɴɴed
Loyal Member
Joined
Apr 9, 2008
Messages
1,416
Reaction score
169
@leo
once i saw the 5 connections i knew it failed hard already didnt even bother looking at the sql

@OP
gg
 
Newbie Spellweaver
Joined
Dec 18, 2010
Messages
68
Reaction score
5
If you're gonna take that tip, you're gonna need to play around with imagealphablending(), imagecopyresampled(), and imagesavealpha() or else it's not gonna alpha properly and you'll be stuck with a white/colored/other background instead of transparent (if this is what you're aiming for). Also, some random code for you to play around with, too, regarding BMPs:


I originally made it with pictures as backgrounds.

I just stripped it all when I released it. (notice the switch for $skin)

Also, this was pretty much a 10 minute thing, so I didn't bother removing possible exploits

And about the thing about 5 times per post, there's a cache. I just didn't include it.

EDIT:

Add that.
PHP:
$poop = preg_replace("/[^A-Za-z0-9 ]/", '', $poop);
It should deal with most of your SQLi problems
 
Last edited:
Newbie Spellweaver
Joined
Dec 18, 2010
Messages
68
Reaction score
5
Better: $poop = addcslashes(mysql_real_escape_string($poop), "%_");

Or whoever uses this could just recode the SQL part with .

Edit:

I recoded that sql part with that, and removed some random things that you don't get.
 
Last edited:
Back
Top