0

I have a file1.php with a variable. The variable name is unknown. file1.php is encrypted with ZendGuard 5. So i can not view code. In file1.php is include file2.php. I dont know place where file2.php is included, because file1.php is encrypted. Is there a way to show unknown name variable in php code?

Example:

file1.php (it will be encrypted with ZendGuard 5)

$my_secret_variable='Hi stackoverflow!';
$my_other_secret_variable_SOME_RANDOM_A4Nf8d3ET='Hi stack!';
include ('file2.php');

file2.php (not encrypted) Lets try to guess name and value of secret variable.

//first attempt
echo'$my_secret';
//second attempt
echo'$my_secret_var';
//etc

Is there a way to show unknown name and value variable in php code?

  • 1
    I'm not really sure of what you're trying to do, but I think the `$$` in php might help? [here](http://stackoverflow.com/questions/2715654/what-does-mean-in-php) – Khalid Dabjan Aug 10 '14 at 10:58
  • 1
    why you quote variable name in `echo()`? (Not to mention you are actually doing this wrong with single quote)... – Marcin Orlowski Aug 10 '14 at 10:59

1 Answers1

0

You could try using get_defined_vars:

$all = get_defined_vars();

print_r($all);
Bjørne Malmanger
  • 1,437
  • 10
  • 11