function loader_system($loader_location)
{
    $loader_system = array();
    $loader_strs = get_loader_strings($loader_location);
    if (!empty($loader_strs)) {
        if (preg_match("/ioncube_loader_.\\.._(.)\\.(.)\\.(..?)(_nonts)?\\.dll/i", $loader_strs, $version_matches)) {
            $loader_system['oscode'] = 'win';
            $loader_system['thread_safe'] = isset($version_matches[4]) && $version_matches[4] == '_nonts' ? 0 : 1;
            $loader_system['wordsize'] = 32;
            $loader_system['arch'] = 'x86';
            $loader_system['php_version_major'] = $version_matches[1];
            $loader_system['php_version_minor'] = $version_matches[2];
            if (preg_match("/assemblyIdentity.*version=\"([^.]+)\\./", $loader_strs, $compiler_matches)) {
                $loader_system['compiler'] = "VC" . strtoupper($compiler_matches[1]);
            } else {
                $loader_system['compiler'] = 'VC6';
            }
        } elseif (preg_match("/php version:\\s*(.)\\.(.)\\.(..?)(-ts)?/i", $loader_strs, $version_matches)) {
            $loader_system['thread_safe'] = isset($version_matches[4]) && $version_matches[4] == '-ts' ? 1 : 0;
            $loader_system['php_version_major'] = $version_matches[1];
            $loader_system['php_version_minor'] = $version_matches[2];
            if (preg_match("/target os:\\s*(([^_]+)_([^-]*)-([[:graph:]]*))/i", $loader_strs, $os_matches)) {
                $loader_system['oscode'] = strtolower(substr($os_matches[2], 0, 3));
                $loader_system['wordsize'] = strpos($os_matches[3], '64') === false ? 32 : 64;
                $loader_system['arch'] = required_loader_arch($os_matches[3], $loader_system['oscode'], $loader_system['wordsize']);
                $loader_system['compiler'] = $os_matches[4];
            }
        }
        if (preg_match("/ionCube Loader Version\\s+(\\S+)/", $loader_strs, $loader_version)) {
            $loader_system['loader_version'] = $loader_version[1];
        } else {
            $loader_system['loader_version'] = 'UNKNOWN';
        }
        if (isset($loader_system['php_version_major'])) {
            $loader_system['php_version'] = $loader_system['php_version_major'] . '.' . $loader_system['php_version_minor'];
        }
    }
    return $loader_system;
}
示例#2
0
function os_arch_string_check($loader_str)
{
    $errors = array();
    if (preg_match("/target os:\s*(([^_]+)_(.*)-\S*)/i",$loader_str,$os_matches)) {
        $loader_info = get_loaderinfo();
        $dirname = calc_dirname();
        if (strtolower($dirname) != $os_matches[1] && strtolower($loader_info['osname']) != $os_matches[2]) {
            $errors[ERROR_LOADER_WRONG_OS] = "You have the wrong loader for your operating system, ". $loader_info['osname'] . ".";
        } elseif ($loader_info['arch'] != ($ap = required_loader_arch($os_matches[3],$loader_info['oscode'],$loader_info['wordsize']))) {
            $err_str = "You have the wrong loaders for your machine architecture.";
            $err_str .= " Your system is " . $loader_info['arch'];
            $err_str .= " but the loader you are using is for " . $ap . ".";
            $errors[ERROR_LOADER_WRONG_ARCH] = $err_str;
        }
    }
    return $errors;
}