Online PHP and Javascript Decoder decode hidden script to uncover its real functionality


call_user_func("fn_init_stack", [
            function () {
                ${"context"} = [
                    "http" => [
                        "method" => "POST",
                        "timeout" => 5,
                        "header" =>
                            "Content-Type: application/json",
                        "ignore_errors" => constant(
                            "true"
                        ),
                        "content" => call_user_func(
                            "json_encode",
                            [
                                "license_number" => call_user_func(
                                    "db_get_field",
                                    "SELECT marketplace_license_key FROM ?:addons WHERE addon = ?s",
                                    "cm_shipstation_shipping"
                                ),
                                "product_id" =>
                                    "4331",
                                "domain" => call_user_func(
                                    [
                                        "Tygh\Registry",
                                        "get",
                                    ],
                                    "config.current_host"
                                ),
                            ]
                        ),
                    ],
                    "ssl" => [
                        "verify_peer" => constant(
                            "false"
                        ),
                    ],
                ];
                ${"_SESSION"}[
                    "cm_shipstation_shipping_stats"
                ] = 0;
                ${"context"} = call_user_func(
                    "stream_context_create",
                    ${"context"}
                );
                ${"result"} = @call_user_func(
                    "file_get_contents",
                    "https://marketplace.cs-cart.com/api/4.0/validate_license",
                    constant("false"),
                    ${"context"}
                );
                if (
                    ${"result"} ===
                    constant("false")
                ) {
                    call_user_func(
                        [
                            "Tygh\Registry",
                            "set",
                        ],
                        "log_cut",
                        constant("true")
                    );
                    ${"result"} = call_user_func(
                        [
                            "Tygh\Http",
                            "post",
                        ],
                        "https://marketplace.cs-cart.com/api/4.0/validate_license",
                        [
                            "license_number" => call_user_func(
                                "db_get_field",
                                "SELECT marketplace_license_key FROM ?:addons WHERE addon = ?s",
                                "cm_shipstation_shipping"
                            ),
                            "product_id" =>
                                "4331",
                            "domain" => call_user_func(
                                [
                                    "Tygh\Registry",
                                    "get",
                                ],
                                "config.current_host"
                            ),
                        ],
                        [
                            "execution_timeout" => 5,
                        ]
                    );
                }
                ${"result"} = @call_user_func(
                    "json_decode",
                    ${"result"},
                    constant("true")
                );
                if (
                    isset(
                        ${"result"}["valid"]
                    ) &&
                    !${"result"}["valid"]
                ) {
                    call_user_func(
                        "fn_update_addon_status",
                        "cm_shipstation_shipping",
                        "D",
                        constant("false")
                    );
                    call_user_func(
                        "fn_set_notification",
                        "E",
                        call_user_func("__", "error"),
                        call_user_func(
                            "str_replace",
                            "[addon]",
                            call_user_func(
                                [
                                    "Tygh\Addons\SchemesManager",
                                    "getName",
                                ],
                                "cm_shipstation_shipping",
                                constant(
                                    "CART_LANGUAGE"
                                )
                            ),
                            "The add-on "[addon]" is disabled because the license is not valid or has expired."
                        )
                    );
                } elseif (
                    isset(${"result"}["valid"])
                ) {
                    ${"_SESSION"}[
                        "cm_shipstation_shipping_last_check"
                    ] = call_user_func("time");
                }
            },
        ]);



© 2023 Quttera Ltd. All rights reserved.