Jump to content

Recommended Posts

Posted

Original script of conversion shared by Humordwarf.

 

Some optimizations made by FidoW

 

<?

 

$id = antiinjection($_GET['id']);

if(!$id) die("Error: No ID");

 

// db config

$CONFIG['worlddbname'] = "lin2world";          // Database Name

$CONFIG['dbaddress'] = "localhost";        // MSSQL IP

$CONFIG['dbuser'] = "";                      // MSSQL User

$CONFIG['dbpass'] = "";    // MSSQL Password

 

// db connection!

$dbconnect = @mssql_connect ($CONFIG['dbaddress'], $CONFIG['dbuser'], $CONFIG['dbpass']);

@mssql_select_db ($CONFIG['worlddbname'], $dbconnect);

 

$query = "SELECT bitmap FROM Pledge_Crest WHERE crest_id = '$id'";

$result = mssql_query($query);

$clan_crest = mssql_fetch_array($result);

$rnd_file = tmpfile();

fwrite($rnd_file, $clan_crest['bitmap']);

fseek($rnd_file, 0);

 

$file = &$rnd_file; //fopen($filename,'rb');

$dds = fread($file,4);

 

if ($dds!=='DDS ') die("Error: no hay imagen DDS");

 

//DDS header

$hdrSize = readInt($file);

$hdrFlags = readInt($file);

$imgHeight = readInt($file)-4;

$imgWidth = readInt($file);

$imgPitch = readShort($file);

 

//DXT1 header

 

fseek($file, 84);

 

$dxt1 = fread($file,4);

 

if ($dxt1!=='DXT1') die("Error: no es formato DX1");

 

//here we go

fseek($file, 128);

 

header ("Content-type: image/png");

$img=imagecreatetruecolor($imgWidth,$imgHeight);

 

for ($y=-1; $y<$imgHeight/4; $y++)

{

  for ($x=0; $x<$imgWidth/4; $x++)

  {

    $color0_16 = readShort($file);

    $color1_16 = readShort($file);

    $r0 = ($color0_16 >> 11) << 3;

    $g0 = (($color0_16 >> 5) & 63) << 2;

    $b0 = ($color0_16 & 31) << 3;

    $r1 = ($color1_16 >> 11) << 3;

    $g1 = (($color1_16 >> 5) & 63) << 2;

    $b1 = ($color1_16 & 31) << 3;

    $color0_32 = imagecolorallocate($img,$r0,$g0,$b0);

    $color1_32 = imagecolorallocate($img,$r1,$g1,$b1);

    $color01_32 = imagecolorallocate($img,$r0/2+$r1/2,$g0/2+$g1/2,$b0/2+$b1/2);

    $black = imagecolorallocate($img,0,0,0);

    $data = readInt($file);

    for ($yy=0;$yy<4;$yy++)

    {

      for ($xx=0;$xx<4;$xx++)

      {

        $bb = $data & 3;

        $data = $data >> 2;

        switch ($bb)

        {

          case 0: $c = $color0_32; break;

          case 1: $c = $color1_32; break;

          case 2: $c = $color01_32; break;

          default: $c = $black; break;

        }

        imagesetpixel($img,$x*4+$xx,$y*4+$yy,$c);

      }

    }

  }

}

 

imagepng($img);

 

 

 

 

## Functions needed

 

function readInt($file)

{

  $b4 = ord(fgetc($file));

  $b3 = ord(fgetc($file));

  $b2 = ord(fgetc($file));

  $b1 = ord(fgetc($file));

  return ($b1<<24)|($b2<<16)|($b3<<8)|$b4;

}

 

function readShort($file)

{

  $b2 = ord(fgetc($file));

  $b1 = ord(fgetc($file));

  return ($b1<<8)|$b2;

}

 

?>

 

Credits - FidoW

 

this script can and MUST be used with this Share => http://www.maxcheaters.com/forum/index.php?topic=64006.0

  • 2 weeks later...
  • 2 months later...
  • 1 month later...
Posted

Hi:) if i use this it write me msg

Fatal error: Call to undefined function antiinjection() in C:\Inetpub\wwwroot\phpscript\crest.php on line 4

 

where is the problem? 8) :)

Heroes.php scrip workin fine.. but cest no:(

Posted

okej.. there was missing function... but when i add

 

function antiinjection($str) {
$allowedchars = "abcdefghijklmnopqrstuvwxyz1234567890?!.@_ ";
$str=strtolower($str);
if (strspn($str, $allowedchars) != strlen($str))
{
$str = NULL;
}
return $str;
}

 

it still write to me "Error: No ID"

  • 2 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Posts

    • In case you can't find someone to exploit by paying him 10usd an hour and asking him to do thousands of dollars worth of work, please contact me.
    • 🎮 Stop staying offline — level up your Discord today!  🎁 Discord Nitro from just $2.9 — for yourself or as a gift!  🔑 Ready-to-use Discord accounts aged from 1 to 24 months starting at $0.44  💥 Everything you need to get started:  ✔️ Real Android devices, email + SMS verification (depends on the product)  ✔️ Nitro Classic & Full — 1 to 12 months (with or without account login)  ✔️ Unlimited accounts — perfect for bots, arbitrage, communities, marketing, and more   🚀 Promo code: DISCORD7 (7% discount)   Payment methods: bank cards · cryptocurrency · other popular options   How to buy:  ➡ Online Store: Click ✅  ➡ Telegram Bot: Click ✅   Other services:  ➡ SMM Panel: Click ✅   Assortment: 🤖 Discord accounts - mail:password:token with email included (email is working) Activated by SMS | ✨ 1 order = 3 accounts ✨ | Price from: $0.44  🤖 ⚡️DISCORD⚡️ Real Android devices ⚡️ Verified on RAMBLER.RU or FIRSTMAIL | Working email included | SMS (phone) verified ☑️ | Age from 3 months | Suitable for any purposes | Accounts without limitations or SMS | Price from: $0.5  🤖 ✨DISCORD✨ accounts | 1 order = 3 accounts | Verified email only (@rambler.ru / @firstmail), email included (working) | Gender: MIX | Price from: $0.5  🤖 ⚡️DISCORD⚡️ Real Android | ☑️ 1 order = 3 accounts | Verified via RAMBLER.RU or FIRSTMAIL | Working email included | SMS verified | Age from 1 month | Suitable for any purposes | Accounts without limitations or SMS | Price from: $0.75  🤖 ⚡️DISCORD⚡️ Real Android devices | Verified via RAMBLER.RU or FIRSTMAIL | Email included (may not work) | SMS verified | Age from 1 year | Suitable for any purposes | Accounts without limitations or SMS | Price from: $0.8  🤖 ⚡️DISCORD⚡️ Real Android devices | Verified via RAMBLER.RU or FIRSTMAIL | Email included (may not work) | SMS verified | Age from 2 years | Suitable for any purposes | Accounts without limitations or SMS | Price from: $1.5  🤖 ⚡️DISCORD⚡️ Real Android devices | Verified via RAMBLER.RU or FIRSTMAIL | Working email included | SMS verified | Age from 1 year | Suitable for any purposes | Accounts without limitations or SMS | Price from: $2  🤖 🎁 Discord Nitro Classic (Basic) | 1 MONTH | Requires login & password | Full subscription warranty | Price from: $2.9  🤖 🎁 Discord Nitro FULL | 1 MONTH | Requires login & password | Full subscription warranty | Price from: $4.9  🤖 🎁 Discord Nitro Classic (Basic) GIFT | 1 MONTH | No login required | Full subscription warranty | Price from: $3.5  🤖 🎁 Discord Nitro FULL | 12 MONTHS | Requires login & password | Full subscription warranty | Price from: $35  🤖 🎁 Discord Nitro Classic (Basic) GIFT | 12 MONTHS | No login required | Full subscription warranty | Price from: $17  🤖 🎁 Discord Nitro Classic (Basic) | 12 MONTHS | Requires login & password | Full subscription warranty | Price from: $15   Regular customers get extra discounts and promo codes!   Support:  ➡ Telegram: https://t.me/solomon_bog ✅  ➡ Discord: https://discord.gg/y9AStFFsrh ✅  ➡ WhatsApp: https://wa.me/79051904467 ✅  ➡ ✉ Email: solomonbog@socnet.store ✅   ➡ Telegram Channel: https://t.me/accsforyou_shop ✅   You can also use these contacts to:  — Discuss wholesale purchases  — Propose a partnership (current partners: https://socnet.bgng.io/partners )   — Become a supplier SocNet — Digital Goods & Premium Subscriptions Store ✅
    • maybe give some more info about your WTB topic like the language and what you want to develop, it doesnt have to be a full detail, it might help you thogh. about the topic author Joined: 07/14/2025
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock