Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › Programming › Other Programming › Web Languages › [TUT] Data on Images

[TUT] Data on Images

Posts 1–10 of 10 · Page 1 of 1
Ugleh
Ugleh
[TUT] Data on Images
Hey everyone, I thought I would stray from the VB for awhile, and teach something new and cool. Its called Script Scrapping, then adding them to GD Imaging. Very simple, and Ill explain.

We are making this, an image that will show how many Thanks I have. If you thank me, you will see the images number changes:


Since this is PHP we need to start off with our brackets.

Code:
<?php

?>
Now, adding the code inside it. I will give you the full code then explain each part.

Code:
<?php
$url = "http://www.mpgh.net/forum/33-visual-basics/83177-real-vb-injecter-source-code.html";

$data = file_get_contents($url);
$newlines = array("\t","\n","\r","\x20\x20","\0","\x0B","/","(", ")",">","<" );
$content = str_replace($newlines, "", html_entity_decode($data));

$html = '/Thanked (.+?) Times/';
preg_match($html,$content,$thanks);

var_dump($thanks);
echo $thanks[1];

//echo "<br>";
//echo $content;

?>

$url = "http://www.mpgh.net/forum/33-visual-basics/83177-real-vb-injecter-source-code.html";
Here we are making the URL that we are getting the source code from, is a thread I made. I chose a thread because the php is visiting the page as a guest, so I cant make it go to my profile.

$data = file_get_contents($url);
Here I am saying "Hey URL, give me your contents, and then name those contents $data".

$newlines = array("\t","\n","\r","\x20\x20","\0","\x0B","/","(", ")",">","<" );
I decided to remove afew stuff I didnt need, and to make it easier for me, so I decided to remove all New Lines, as well as /,(,),<,>.

$content = str_replace($newlines, "", html_entity_decode($data));
Here I am telling the $data to replace everything we put earlier in $newlines, with "", meaning it just removes them. Now $data has turned to $content.


$html = '/Thanked (.+?) Times/';
Here I am making $html = to a string that will be found later. It is required you have the /content/ dashes in there. (.+?) stands for what we want. So it would normally be "Thanked 10 Times", I replace the number with (.+?), because the number is what I want to pull.

preg_match($html,$content,$thanks);
Here we are telling it to match (find) $html, with $content, then name it $thanks.

var_dump($thanks);
Var dump isnt much needed, so what you can do after this test, is change it to
Code:
//var_dump($thanks);
But this is good to see if your data is even there, With this code It will output
array(2) { [0]=> string(16) "Thanked 43 Times" [1]=> string(2) "43" }
And as you can see, you have 2 options. You can use
$thanks[0] for Thanked 43 Times
or
$thanks[1] for 43

SO we want $thanks[1].

Thats where the ending comes in

echo $thanks[1];
This will make the number show, as text.

//echo "<br>";
//echo $content;

This you can leave alone, but if you ever want to see the content then remove the "//" infront of both.



Next Step
Now that we have the variable we are looking for, we need to change up the code abit. We now change it to this.

Code:
<?php
header("Content-type: image/png");
$url = "http://www.mpgh.net/forum/33-visual-basics/83177-real-vb-injecter-source-code.html";
$data = file_get_contents($url);
$newlines = array("\t","\n","\r","\x20\x20","\0","\x0B","/","(", ")",">","<" );
$content = str_replace($newlines, "", html_entity_decode($data));
$html = '/Thanked (.+?) Times/';
preg_match($html,$content,$thanks);
?>
And after you change it to this, now we need to add the imaging that needs to be done.
SO now your full code should look like this.

Code:
<?php
header ("Content-type: image/png");
$url = "http://www.mpgh.net/forum/33-visual-basics/83177-real-vb-injecter-source-code.html";

$data = file_get_contents($url);
$newlines = array("\t","\n","\r","\x20\x20","\0","\x0B","/","(", ")",">","<" );
$content = str_replace($newlines, "", html_entity_decode($data));
$html = '/Thanked (.+?) Times/';
preg_match($html,$content,$thanks);

$handle = ImageCreate (130, 50) or die ("Cannot Create image");
$bg_color = ImageColorAllocate ($handle, 255, 0, 0);
$txt_color = ImageColorAllocate ($handle, 0, 0, 0);
ImageString ($handle, 5, 5, 18, "Thanks: $thanks[1]", $txt_color);
ImagePng ($handle);
?>
And this code will produce


For it to work on you, find a thread that was started by yourself, and change the $url to your threads URL.
#1 · 16y ago
No5cope
No5cope
nice work on this
#2 · 16y ago
Ugleh
Ugleh
np, once you learn this, sooner or later ud be making this:

#3 · 16y ago
why06jz
why06jz
Hey wow this is pretty cool stuff. I'll have to stick around here a little more often.

Oh and thanks Ugleh.
Code:
<?php
header ("Content-type: image/png");
$url = "http://www.mpgh.net/forum/198-php-html/84620-tut-data-images.html";

$data = file_get_contents($url);
$newlines = array("\t","\n","\r","\x20\x20","\0","\x0B","/","(", ")",">","<" );
$content = str_replace($newlines, "", html_entity_decode($data));
$html = '/Thanked (.+?) Times/';
preg_match($html,$content,$thanks);

$handle = ImageCreate (130, 50) or die ("Cannot Create image");
$bg_color = ImageColorAllocate ($handle, 0, 255, 0);
$txt_color = ImageColorAllocate ($handle, 0, 0, 0);
ImageString ($handle, 5, 5, 18, "Thanks: $thanks[1]", $txt_color);
ImagePng ($handle);
?>
Damit html is off D:

Ok one question:

How does this make $thanks into an array?
Code:
array(2) { [0]=> string(16) "Thanked 43 Times" [1]=> string(2) "43" }
shouldn't it be something like this:
Code:
$thanks(2) { [0]=> string(16) "Thanked 43 Times" [1]=> string(2) "43" }
I'm just a little confused at the way you assigned it a value. It looks nothing like that in C++. But I am willing to learn please explain

Could you explain more what all these symbols remove.
Code:
$newlines = array("\t","\n","\r","\x20\x20","\0","\x0B","/","(", ")",">","<" );
If I need to learn some other stuff first point me in the right direction and I will go there.
#4 · edited 16y ago · 16y ago
Ugleh
Ugleh
the Var_dump already calls for $thanks, so it just outputs an array. and it tells you there is 2. the $thanks[0] and $thanks[1].

$newlines = array("\t","\n","\r","\x20\x20","\0","\x0B","/","(", ")",">","<" );
This will remove

\t
\n
\r
\x20\x20

In some coding (in php too) you use \n or \r to represent a new line.
I also added
<>
()
/
Because with those removed I will not get any errors when grabbing values.
#5 · 16y ago
why06jz
why06jz
Ok. Thanks for the quick reply.

Now what about all the other words. Because it seems to me you would get a really huge array of words and numbers. How do you narrow it down to the two that you want?

Oh wait I get it! This finds the right string your looking for:
$html = '/Thanked (.+?) Times/';
preg_match($html,$content,$thanks);


Sweet thanks a lot. Ugleh
#6 · 16y ago
Ugleh
Ugleh
no problem, remember what has been removed though, if you ever need to look at the content remove the // infront of echo $content

then do Ctrl + F to find the current data, and copy stuff around it, and replace the number or word with (.+?)

Make sure you have the "/"s like > /Content(.+?) secondcont/
#7 · 16y ago
MKL
MKL
I knew it but thanks !
#8 · 16y ago
Pixie
Pixie
So what do we make this in?? And what do we save it as??
#9 · 16y ago
Ugleh
Ugleh
lol, this is the php forum, so it would be a .php file, using notepad. Then you upload it to a web server.
#10 · 16y ago
Posts 1–10 of 10 · Page 1 of 1

Post a Reply

Similar Threads

  • [tut] Putting An Image Of Ure ClanBy ktalin91 in WarRock Korea Hacks
    9Last post 19y ago
  • [Tut]Data ConversionsBy NextGen1 in Visual Basic Programming
    2Last post 16y ago
  • [TUT] Convert Image to Text then Place on Forums.By Roxter in Tutorials
    6Last post 15y ago
  • Warhead glitch *new* not patched IMAGE TutBy ximsonoobx in Combat Arms Hacks & Cheats
    26Last post 17y ago
  • [Tut] (Requires PayPal) Free Maplestory NX Cash [The legal way] {with images}By cybershadowX in MapleStory Hacks, Cheats & Trainers
    18Last post 19y ago

Tags for this Thread

#data#images#tut