Search code examples
phpbreakioncube

Can I call functions between files encoded with ioncube?


I just have a quick question regarding ioncube with PHP. Lets say I have a file, it has a function which I need to call throughout the project:

function foo()
{
    echo "bar";
}

A different file

//we must foo our bars!!    
foo();

If I encode the whole project with ioncube, will these cross-file function calls still work? Or will the obfuscation break it?


Solution

  • Yes, it will still work provided that the same obfuscation key is used throughout the project. With the same obfuscation key, functions with the same name will get the same obfuscated string, e.g. foo() is always obfuscated into qretzhdgm().

    Furthermore, the ionCube encoder lets you specify an obfuscation exclusion list, where you can put in foo in order to preserve (and exclude) its name from obfuscation. This might be useful if you have unencoded files that will call foo().

    Disclaimer: I'm affiliated with ionCube.