Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6786073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:12:08+00:00 2026-05-26T17:12:08+00:00

In short, I’m building a self hosted application, and to create a basic level

  • 0

In short, I’m building a self hosted application, and to create a basic level deterrent that’ll stop those who have a small knowledge of development (i.e. my target market) from removing call backs, I’ve decided to use eval() and base64_decode() in order to obfuscate and execute a couple of lines of code – specifically those that deal with validating the users license key.

The problem I’ve run into however is that it seems that I can’t run eval(base64_decode(..)); within a function.

For example, this works fine:

eval(base64_decode('c2Vzc2lvbl9uYW1lKCJfaW5zdCIpOyBzZXNzaW9uX3N0YXJ0KCk7ICRfU0VTU0lPTlsna2V5J10gPSB0cnVlOyBlY2hvICI8c2NyaXB0IHR5cGU9XCJ0ZXh0L2phdmFzY3JpcHRcIj53aW5kb3cubG9jYXRpb24gPSAnL2luc3QvYWRtaW4vc2V0dGluZ3MnPC9zY3JpcHQ+Ijs=');

executing the following,

session_name("_inst");
session_start();
$_SESSION['key'] = true;
echo "<script type=\"text/javascript\">window.location = '/inst/admin/settings'</script>";

But this on the other hand, fails:

function escapeOut() {
eval(base64_decode('c2Vzc2lvbl9uYW1lKCJfaW5zdCIpOyBzZXNzaW9uX3N0YXJ0KCk7ICRfU0VTU0lPTlsna2V5J10gPSB0cnVlOyAkZXNjYXBlID0gICI8c2NyaXB0IHR5cGU9XCJ0ZXh0L2phdmFzY3JpcHRcIj53aW5kb3cubG9jYXRpb24gPSAnL2luc3QvYWRtaW4vc2V0dGluZ3MnPC9zY3JpcHQ+IjsgcmV0dXJuICRlc2NhcGU7'));
}

echo escapeOut();

it should execute the following,

session_name("_inst");
session_start();
$_SESSION['key'] = true;
$escape = "<script type=\"text/javascript\">window.location = '/inst/admin/settings'</script>";
return $escape;

At first I wasn’t returning $escape, but after realizing and rectifying that issue, I’m stumped. It’s probably something pretty simple, but I’m pretty stumped.

Any answers as to why this doesn’t work/what I can do to make it work would be greatly appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T17:12:08+00:00Added an answer on May 26, 2026 at 5:12 pm

    having return in your eval() statement will return from eval, not from the outer function.

    i think you need something like this:

    function escapeOut(){
        return eval(base64_decode('c2Vzc2lvbl9uYW1lKCJfaW5zdCIpOyBzZXNzaW9uX3N0YXJ0KCk7ICRfU0VTU0lPTlsna2V5J10gPSB0cnVlOyAkZXNjYXBlID0gICI8c2NyaXB0IHR5cGU9XCJ0ZXh0L2phdmFzY3JpcHRcIj53aW5kb3cubG9jYXRpb24gPSAnL2luc3QvYWRtaW4vc2V0dGluZ3MnPC9zY3JpcHQ+IjsgcmV0dXJuICRlc2NhcGU7'));
    }
    
    echo escapeOut();
    

    also, keep in mind it’s trivial to echo base64_decode('c2Vzc2lvbl9uYW1lKCJfaW5zdCIp...

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Short Question I have a loop that runs 180,000 times. At the end of
Short question: If I have class that impelemnts FactoryBean interface, how can I get
Short: Is there a way to have a route-definition that will pass the CONTROLLER/ACTION
Short During debug process I see that, all goes right. For debugging purposes, before
Short version of the question: If you have a table with a large number
Short version: I want a way to run somefunction(username) and have it return the
Short: I am looking for a very simple (configuration/maintenance wise) solution, that would allow
Short Question Is there a library that is supposed to replace mswinsoc.osx used to
Short of parsing the output of ipconfig , does anyone have a 100% pure
Short story. This site was created by a friend of mine, who did not

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.