Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

--TEST-- Bug #77973 (Uninitialized read in gdImageCreateFromXbm) --EXTENSIONS-- gd --SKIPI..

Decoded Output download

--TEST--
Bug #77973 (Uninitialized read in gdImageCreateFromXbm)
--EXTENSIONS--
gd
--SKIPIF--
<?php
if (!function_exists('imagecreatefromxbm')) die("skip imagecreatefromxbm not available");
?>
--FILE--
<?php
$contents = hex2bin("23646566696e6520776964746820320a23646566696e652068656967687420320a737461746963206368617220626974735b5d203d7b0a7a7a787a7a");
$filepath = __DIR__ . '/bug77973.xbm';
file_put_contents($filepath, $contents);
$im = imagecreatefromxbm($filepath);
var_dump($im);
?>
--EXPECTF--
Warning: imagecreatefromxbm(): %cnvalid XBM in %s on line %d

Warning: imagecreatefromxbm(): "%s" is not a valid XBM file in %s on line %d
bool(false)
--CLEAN--
<?php
unlink(__DIR__ . '/bug77973.xbm');
?>

Did this file decode correctly?

Original Code

--TEST--
Bug #77973 (Uninitialized read in gdImageCreateFromXbm)
--EXTENSIONS--
gd
--SKIPIF--
<?php
if (!function_exists('imagecreatefromxbm')) die("skip imagecreatefromxbm not available");
?>
--FILE--
<?php
$contents = hex2bin("23646566696e6520776964746820320a23646566696e652068656967687420320a737461746963206368617220626974735b5d203d7b0a7a7a787a7a");
$filepath = __DIR__ . '/bug77973.xbm';
file_put_contents($filepath, $contents);
$im = imagecreatefromxbm($filepath);
var_dump($im);
?>
--EXPECTF--
Warning: imagecreatefromxbm(): %cnvalid XBM in %s on line %d

Warning: imagecreatefromxbm(): "%s" is not a valid XBM file in %s on line %d
bool(false)
--CLEAN--
<?php
unlink(__DIR__ . '/bug77973.xbm');
?>

Function Calls

hex2bin 1
function_exists 1

Variables

None

Stats

MD5 eaf1a2a711aff7dcd1e2db1e0e1f1e97
Eval Count 0
Decode Time 114 ms