[Release] DMN Webshop v1.6 Decoded and De-obfuscated

dota-sdso

Well-Known Member
Joined
Apr 30, 2014
Messages
590
Reaction score
822
Това е последната версия на уебшопа, която изтеглих от техният уебсайт, версията е безплатна но кода е енкоднат по принцип. Не съм го виждал никъде декоднат, но е възможно и да съм пропуснал нещо, така че реших да го споделя.

Ще е първият релийс от може би серия декоднати уебсайтове, които вероятно ще добавя в близко бъдеще. Не съм го тествал дали работи, но изглежда наред поне на пръв поглед.

Ако има някакви проблеми, пишете за да ги фикснем.

демонащегорелийсне пакврейджзона икъделиоще незатовапаролка браД даимегадно. Паролатаекактопреди налатиница ввв.ДарксТийм.нет

PHP:
<?php
######################################
#     DmN MuWebshop Free 1.6           #
#    ***********************           #
# @ Decoded on  : 01.07.2019           #
# @ Released at : http://DarksTeam.net #
# @ Dec/Deobf   : PyIoDec v0.1         #
# @ Author      : r00tme               #
######################################

if (!defined("DmNMuSite")) {
    exit("Go away!");
}
class item extends database
{
    public $items = null;
    public $info = "";
    public $id = null;
    public $option = null;
    public $dur = null;
    public $serial = null;
    public $exe = null;
    public $ex = null;
    public $ancient = null;
    public $cat = null;
    public $ref = null;
    public $type = null;
    public $harmony = array();
    public $socket = array();
    public $sinfo = null;
    public $level = 0;
    public $skill = "";
    public $skill_exists = null;
    public $luck = "";
    public $exeopt = "";
    public $addopt = "";
    public $refopt = "<div style=color:#FF1493;font-weight:bold;font-family: tahoma;font-size: 12px;>#REFOPT#</div>";
    public $haropt = "<div style=color:#FADE09;font-weight:bold;font-family: tahoma;font-size: 12px;>#HARMOPT#</div>";
    public $sockopt = "<div style=color:#B266FF;font-family: tahoma;font-size: 12px;>";
    public $name = "";
    public function __construct($item = "")
    {
        if ($item != "") {
            if (preg_match("/[a-fA-F0-9]{32,64}/", $item)) {
                $this->items = $item;
                $this->hex_id = substr($this->items, 0, 2);
                $this->option = hexdec(substr($this->items, 2, 2));
                $this->dur = hexdec(substr($this->items, 4, 2));
                $this->serial = substr($this->items, 6, 8);
                $this->ancient = hexdec(substr($this->items, 16, 2));
                $this->ref = hexdec(substr($this->items, 19, 1));
                $this->type = floor(hexdec(substr($this->items, 18, 2)) / 16);
                $this->type_id = 128 <= hexdec(substr($this->items, 14, 2)) ? ("0x" . dechex($this->type + 1) . $this->hex_id + 0) % 512 : 0;
                $this->id = 255 < $this->type_id ? $this->type_id : hexdec(substr($this->items, 0, 2));
                $this->exe = 255 < $this->type_id ? hexdec(substr($this->items, 14, 2)) - 128 : hexdec(substr($this->items, 14, 2));
                $this->ex = 255 < $this->type_id ? hexdec(substr($this->items, 14, 2)) - 128 : hexdec(substr($this->items, 14, 2));
                $this->harmony[0] = hexdec(substr($item, 20, 1));
                $this->harmony[1] = hexdec(substr($item, 21, 1));
                $this->socket[1] = hexdec(substr($item, 22, 2));
                $this->socket[2] = hexdec(substr($item, 24, 2));
                $this->socket[3] = hexdec(substr($item, 26, 2));
                $this->socket[4] = hexdec(substr($item, 28, 2));
                $this->socket[5] = hexdec(substr($item, 30, 2));
                $query = parent::query("SELECT * FROM DmN_Shopp WHERE item_id = " . $this->id . " AND original_item_cat = " . $this->type . "", MUONLINE);
                if (parent::numrows($query)) {
                    $this->sinfo = parent::fetch($query);
                } else {
                    $this->name = "<div style=color:#FFFFFF;font-family: tahoma;font-size: 15px;>Unknown Item</div>";
                }
            } else {
                throw new exception("Invalid item hex value. Value: " . $item);
            }
        } else {
            throw new exception("Missing item hex value.");
        }
    }
    public function GetShopInfo()
    {
        $query = parent::query("SELECT * FROM DmN_Shopp WHERE item_id = " . $this->id . " AND original_item_cat = " . $this->type . "", MUONLINE);
        if (parent::numrows($query)) {
            $this->sinfo = parent::fetch($query);
        } else {
            $this->name = "<div style=color:#FFFFFF;font-family: tahoma;font-size: 15px;>Unknown Item</div>";
        }
    }
    public function GetItemSkill()
    {
        $load_skill_file = file(BASEDIR . "data" . DS . "shop" . DS . "shop_skill_type.dmn");
        foreach ($load_skill_file as $loaded_skill_file) {
            $skill_info = explode("|", $loaded_skill_file);
            if ($this->sinfo["skilltype"] == $skill_info[0]) {
                $this->skill = "<div style=color:#80B2FF;font-family: tahoma;font-size: 12px;>" . $skill_info[1] . " " . $this->option . "</div>";
            }
            if ($this->sinfo["original_item_cat"] == 13 && $this->sinfo["item_id"] == 37) {
                $this->skill = "<div style=color:#80B2FF;font-family: tahoma;font-size: 12px;>Plasma storm skill (Mana:50)</div>";
            }
        }
    }
    public function GetLevel()
    {
        $level = 0;
        $option = $this->option;
        if (128 <= $option) {
            $option -= 128;
        }
        while (0 <= $option - 8) {
            $level++;
            $option -= 8;
        }
        if (0 <= $option - 4) {
            $option -= $option;
        }
        $option += $option * 4;
        return "+" . $level;
    }
    public function GetOption()
    {
        if (128 <= $this->option) {
            $this->option -= 128;
        }
        $this->option = $this->option - floor($this->option / 8) * 8;
        if (4 <= $this->option) {
            $this->option -= 4;
        }
        if (64 <= $this->exe) {
            $this->option += 4;
        }
        return $this->option;
    }
    public function GetOptions()
    {
        if (128 <= $this->option) {
            $this->skill_exists = true;
            $this->option -= 128;
        } else {
            $this->skill_exists = false;
        }
        $this->level = 0 < floor($this->option / 8) ? "+" . floor($this->option / 8) : "";
        $this->option = $this->option - floor($this->option / 8) * 8;
        if (4 <= $this->option) {
            $this->luck = "<div style=color:#FADE09;font-family: tahoma;font-size: 12px;>Luck(success rate of Jewel of Soul +25%)<br />Luck(critical damage rate +5%)</div>";
            $this->option -= 4;
        }
        if (64 <= $this->exe) {
            $this->option += 4;
        }
        if (0 < $this->option) {
            if ($this->sinfo["original_item_cat"] == 6) {
                $this->addopt = "Additional Defense Rate +" . $this->option * 5;
            } else {
                if ($this->sinfo["itemslot"] == 9 || $this->sinfo["itemslot"] == 10 || $this->sinfo["itemslot"] == 11) {
                    $this->addopt = "Automatic Hp Recovery " . $this->option . "%";
                } else {
                    if ($this->sinfo["exetype"] == 1 || $this->sinfo["exetype"] == 3 || $this->sinfo["exetype"] == 6) {
                        $this->addopt .= "Additional Damage +" . $this->option * 4;
                    } else {
                        if ($this->sinfo["exetype"] == 2 || $this->sinfo["exetype"] == 5) {
                            $this->addopt .= "Additional Defense +" . $this->option * 4;
                        }
                    }
                }
            }
            $this->addopt = "<div style=color:#80B2FF;font-family: tahoma;font-size: 12px;>" . $this->addopt . "</div>";
        }
    }
    public function GetExe()
    {
        $load_exe_type_list = file(BASEDIR . "data" . DS . "shop" . DS . "shop_ex_type.dmn");
        foreach ($load_exe_type_list as $loaded_exe_type_list) {
            $exe_type_list = explode("|", $loaded_exe_type_list);
            if ($this->sinfo["exetype"] == $exe_type_list[0]) {
                if (64 <= $this->exe) {
                    $this->option += 4;
                    $this->exe -= 64;
                }
                if (32 <= $this->exe) {
                    if ($this->sinfo["exetype"] == 1 || $this->sinfo["exetype"] == 2 || $this->sinfo["exetype"] == 5) {
                        $this->exeopt .= $exe_type_list[17] . "<br />";
                    }
                    $this->exe -= 32;
                }
                if (16 <= $this->exe) {
                    $this->exeopt .= $exe_type_list[14] . "<br />";
                    $this->exe -= 16;
                }
                if (8 <= $this->exe) {
                    $this->exeopt .= $exe_type_list[11] . "<br />";
                    $this->exe -= 8;
                }
                if (4 <= $this->exe) {
                    $this->exeopt .= $exe_type_list[8] . "<br />";
                    $this->exe -= 4;
                }
                if (2 <= $this->exe) {
                    $this->exeopt .= $exe_type_list[5] . "<br />";
                    $this->exe -= 2;
                }
                if ($this->exe == 1) {
                    $this->exeopt .= $exe_type_list[2] . "<br />";
                    $this->exe -= 1;
                }
                $this->exeopt = "<div style=color:#80B2FF;font-family: tahoma;font-size: 12px;>" . $this->exeopt . "</div>";
            }
        }
    }
    public function GetRefinery()
    {
        if ($this->sinfo["use_refinary"] == 1) {
            if (0 < $this->ref) {
                $load_ref_file = file(BASEDIR . "data" . DS . "shop" . DS . "shop_ref_type.dmn");
                foreach ($load_ref_file as $loaded_ref_file) {
                    $ref_opt = explode("|", $loaded_ref_file);
                    if ($this->type == $ref_opt[0]) {
                        $this->refopt = str_replace("#REFOPT#", $ref_opt[1], $this->refopt);
                    }
                }
                return NULL;
            } else {
                $this->refopt = "";
            }
        } else {
            $this->refopt = "";
        }
    }
    public function GetHarmony()
    {
        if ($this->sinfo["use_harmony"] == 1) {
            if (0 < $this->harmony[0]) {
                $load_harmony = parent::query("SELECT itemtype, hoption, hvalue, hname FROM DmN_Shop_Harmony WHERE hoption = " . $this->harmony[0] . "", MUONLINE);
                while ($row = parent::fetch($load_harmony)) {
                    if ($this->type < 5) {
                        if ($row["itemtype"] == 1 && $row["hoption"] == $this->harmony[0] && $row["hvalue"] == $this->harmony[1]) {
                            $this->haropt = str_replace("#HARMOPT#", $row["hname"], $this->haropt);
                        }
                    } else {
                        if ($this->type == 5) {
                            if ($row["itemtype"] == 2 && $row["hoption"] == $this->harmony[0] && $row["hvalue"] == $this->harmony[1]) {
                                $this->haropt = str_replace("#HARMOPT#", $row["hname"], $this->haropt);
                            }
                        } else {
                            if (5 < $this->type) {
                                if ($row["itemtype"] == 3 && $row["hoption"] == $this->harmony[0] && $row["hvalue"] == $this->harmony[1]) {
                                    $this->haropt = str_replace("#HARMOPT#", $row["hname"], $this->haropt);
                                }
                            } else {
                                $this->haropt = "";
                            }
                        }
                    }
                }
            } else {
                $this->haropt = "";
                return NULL;
            }
        } else {
            $this->haropt = "";
        }
    }
    public function GetSockets()
    {
        if ($this->sinfo["use_sockets"] == 1) {
            for ($i = 1; $i <= 5; $i++) {
                if (parent::loadxmlconfig("shop|socket_lib") == 1) {
                    $load_socket = parent::query("SELECT socket_name FROM DmN_Shop_Sockets WHERE socket_id = " . $this->socket[$i] . "", MUONLINE);
                    if (parent::numrows($load_socket)) {
                        $socket = parent::fetch($load_socket);
                        $this->sockopt .= "Socket " . $i . ": " . $socket["socket_name"] . "<br>";
                    }
                } else {
                    if ($this->socket[$i] == 255) {
                        $this->socket[$i] = 254;
                    } else {
                        if ($this->socket[$i] == 0) {
                            $this->socket[$i] = 255;
                        } else {
                            $this->socket[$i] -= 1;
                        }
                    }
                    $load_socket = parent::query("SELECT socket_name FROM DmN_Shop_Sockets WHERE socket_id = " . $this->socket[$i] . "", MUONLINE);
                    if (parent::numrows($load_socket)) {
                        $socket = parent::fetch($load_socket);
                        $this->sockopt .= "Socket " . $i . ": " . $socket["socket_name"] . "<br>";
                    }
                }
            }
            $this->sockopt .= "</div>";
        } else {
            $this->sockopt = "";
        }
    }
    public function GetAncient()
    {
        if (0 < $this->ancient) {
        }
    }
    public function GetX()
    {
        return $this->sinfo["x"];
    }
    public function GetY()
    {
        return $this->sinfo["y"];
    }
    public function GetNameStyle()
    {
        $this->GetOptions();
        $anc = false;
        $sock = false;
        if (64 <= $this->ex) {
            $this->ex -= 64;
        }
        if ($this->ancient == 5 || $this->ancient == 6 || $this->ancient == 9 || $this->ancient == 10) {
            $anc = true;
            $load_ancient_sets = file(BASEDIR . "data" . DS . "shop" . DS . "shop_anc_opt.dmn");
            foreach ($load_ancient_sets as $ancient_names) {
                $names = explode("|", $ancient_names);
                if ($names[0] == $this->type && $names[1] == $this->id) {
                    $sets = explode("-", $names[2]);
                    $set = $this->ancient == 5 || $this->ancient == 9 ? str_replace("Set ", "", $sets[0]) : str_replace("Set ", "", $sets[1]);
                    if (0 < $this->ex) {
                        $this->name = "<div style=background-color:#0000FF;color:#01DF01;font-family: tahoma;font-size: 15px;>Excellent " . $set . " ";
                    } else {
                        $this->name = "<div style=background-color:#0000FF;font-family: tahoma;font-size: 15px;>" . $set . " ";
                    }
                }
            }
        } else {
            if ($this->sinfo["use_sockets"] == 1) {
                $sock = true;
                if (0 < $this->ex) {
                    $this->name = "<div style=color:#7401DF;font-family: tahoma;font-size: 15px;>Excellent ";
                } else {
                    $this->name = "<div style=color:#B266FF;font-family: tahoma;font-size: 15px;>";
                }
            } else {
                if (0 < $this->ex && $anc != true && $sock != true) {
                    $this->name = "<div style=color:#01DF01;font-family: tahoma;font-size: 15px;>Excellent ";
                } else {
                    if (6 < $this->level) {
                        $this->name = "<div style=color:#FFCC19;font-family: tahoma;font-size: 15px;>";
                    } else {
                        $this->name = "<div style=color:#FFFFFF;font-family: tahoma;font-size: 15px;>";
                    }
                }
            }
        }
        $this->name .= $this->sinfo["name"] . " " . $this->level . "</div>";
    }
    public static function ItemImage($item_id, $cat, $tags = 1, $search_cat = false, $extensions = array("jpg", "jpeg", "png", "gif"))
    {
        if ($search_cat == true) {
            $get_real_cat = parent::query("SELECT item_cat FROM DmN_Shopp WHERE item_id = " . $item_id . " AND original_item_cat = " . $cat . "", MUONLINE);
            $real_cat = parent::fetch($get_real_cat);
        } else {
            $real_cat = array("item_cat" => $cat);
        }
        $exists = false;
        foreach ($extensions as $ext) {
            $img = BASEDIR . "templates" . DS . "def_images" . DS . "item_images" . DS . $real_cat["item_cat"] . DS . $item_id . "." . $ext;
            if ($tags == 1) {
                if (file_exists($img)) {
                    $exists = true;
                    list($width) = getimagesize($img);
                    $img = parent::loadconfig("base_url") . "templates/def_images/item_images/" . $real_cat["item_cat"] . "/" . $item_id . "." . $ext;
                    $w = 128 <= $width ? "width=\"120px\"" : "";
                    return "<center><img src=\"" . $img . "\" border=\"0\" " . $w . " alt=\"\" /></center>";
                }
            } else {
                if (file_exists($img)) {
                    $exists = true;
                    return parent::loadconfig("base_url") . "templates/def_images/item_images/" . $real_cat["item_cat"] . "/" . $item_id . "." . $ext;
                }
            }
        }
        if ($exists == false) {
            if ($tags == 1) {
                return "<center><img src=\"" . parent::loadconfig("base_url") . "templates/def_images/item_images/noimage.gif\" border=\"0\" alt=\"\" /></center>";
            }
            return parent::loadconfig("base_url") . "templates/def_images/item_images/noimage.gif";
        }
    }
    public static function GetCategoryName($cat)
    {
        $load_cat_list = file(BASEDIR . "data" . DS . "shop" . DS . "shop_cat_list.dmn");
        foreach ($load_cat_list as $cat_list) {
            $cats = explode("|", $cat_list);
            if ($cats[0] == $cat) {
                return $cats[1];
            }
        }
        return "Unknown Category";
    }
    public function GetName()
    {
        $this->GetShopInfo();
        return $this->sinfo["name"];
    }
    public function AllInfo()
    {
        $this->GetNameStyle();
        $this->GetItemSkill();
        $this->GetRefinery();
        $this->GetHarmony();
        $this->GetExe();
        $this->GetSockets();
        $this->info = $this->name . "<br>";
        $this->info .= $this->skill_exists == true && !empty($this->skill) ? $this->skill . "<br>" : "";
        $this->info .= !empty($this->luck) ? $this->luck . "<br>" : "";
        $this->info .= !empty($this->addopt) ? $this->addopt . "<br>" : "";
        $this->info .= !empty($this->refopt) ? $this->refopt . "<br>" : "";
        $this->info .= !empty($this->haropt) ? $this->haropt . "<br>" : "";
        $this->info .= !empty($this->exeopt) ? $this->exeopt . "<br>" : "";
        $this->info .= !empty($this->sockopt) ? $this->sockopt . "<br>" : "";
        return $this->info;
    }
    public function CheckSerial($account, $serial)
    {
        $check_serial = parent::query("exec DmN_SEARCH_SERIAL '" . $account . "', 0x" . $serial . "", MUONLINE);
        $check_serial = parent::fetch($check_serial);
        if ($check_serial["QueryResult"] == "exists") {
            return false;
        }
        return true;
    }
    public function RemoveItemBySerial($account, $serial, $searchtype, $return = 0, $idx = false)
    {
        $old_item = null;
        switch ($searchtype) {
            case 1:
                shop::getvaultcontent($account);
                $items_array = str_split(shop::$items, ITEM_SIZE);
                foreach ($items_array as $key => $value) {
                    if (strtoupper($serial) === substr($items_array[$key], 6, 8)) {
                        $old_item = $items_array[$key];
                        $items_array[$key] = str_repeat("F", ITEM_SIZE);
                    }
                }
                $new_ware = implode("", $items_array);
                $update_ware = parent::query("UPDATE warehouse SET Items = 0x" . $new_ware . " WHERE AccountId = '" . $account . "'", MUONLINE);
                break;
            case 2:
                shop::getinventorycontent($account);
                $items_array = str_split(shop::$items, ITEM_SIZE);
                foreach ($items_array as $key => $value) {
                    if (strtoupper($serial) === substr($items_array[$key], 6, 8)) {
                        $old_item = $items_array[$key];
                        $items_array[$key] = str_repeat("F", ITEM_SIZE);
                    }
                }
                $new_inv = implode("", $items_array);
                $update_inv = parent::query("UPDATE Character SET Inventory = 0x" . $new_inv . " WHERE Name = '" . $account . "'", MUONLINE);
                break;
            case 3:
                shop::getextendedvaultcontent($account, $idx);
                $items_array = str_split(shop::$items, ITEM_SIZE);
                foreach ($items_array as $key => $value) {
                    if (strtoupper($serial) === substr($items_array[$key], 6, 8)) {
                        $old_item = $items_array[$key];
                        $items_array[$key] = str_repeat("F", ITEM_SIZE);
                    }
                }
                $new_ware = implode("", $items_array);
                switch (EXTENDED_TYPE) {
                    case 1:
                        $update_ware = parent::query("UPDATE CireExWare SET items = 0x" . $new_ware . " WHERE AccountId = '" . $account . "' and idx = " . $idx . "", MUONLINE);
                        break;
                    case 2:
                        $update_ware = parent::query("UPDATE ExtendedWarehouse SET items = 0x" . $new_ware . " WHERE AccountId = '" . $account . "' and SCFExtWare = " . $idx . "", MUONLINE);
                }
        }
        if ($return == 1) {
            return $old_item;
        }
        return true;
    }
    public function make_socket_list($selected = "", $exetype)
    {
        if (parent::loadxmlconfig("shop|check_socket_part_type") == 1) {
            if ($exetype == 1) {
                $sockets = parent::query("SELECT socket_id, socket_name FROM DmN_Shop_Sockets WHERE status != 0  AND socket_part_type IN (-1, 1) ORDER BY orders ASC", MUONLINE);
            } else {
                $sockets = parent::query("SELECT socket_id, socket_name FROM DmN_Shop_Sockets WHERE status != 0  AND socket_part_type IN (-1, 0) ORDER BY orders ASC", MUONLINE);
            }
        } else {
            $sockets = parent::query("SELECT socket_id, socket_name FROM DmN_Shop_Sockets WHERE status != 0 ORDER BY orders ASC", MUONLINE);
        }
        $sock = "";
        while ($row = parent::fetch($sockets)) {
            if (parent::loadxmlconfig("shop|socket_lib") == 0) {
                $row["socket_id"] += 1;
            }
            if ($selected !== "") {
                $sock .= $selected == $row["socket_id"] ? "<option value=\"" . $row["socket_id"] . "\" selected=\"selected\">" . $row["socket_name"] . "</option>" : "<option value=\"" . $row["socket_id"] . "\">" . $row["socket_name"] . "</option>";
            } else {
                $sock .= "<option value=\"" . $row["socket_id"] . "\">" . $row["socket_name"] . "</option>";
            }
        }
        return $sock;
    }
    public function make_harmony_list($cat, $hopt, $hvalue, $include_select = true)
    {
        if (!$include_select) {
            $harmonyecho = "<select name=\"harmonyvalue\" id=\"harmonyvalue\" onchange=\"checkall();\"><option value=\"\" selected=\"selected\">--select--</option>";
        } else {
            $harmonyecho = "<option value=\"\" selected=\"selected\">--select--</option>";
        }
        $load_harmony = parent::query("SELECT itemtype, hoption, hvalue, hname FROM DmN_Shop_Harmony WHERE hoption = " . $hopt . " AND status = 1", MUONLINE);
        if (parent::numrows($load_harmony)) {
            while ($row = parent::fetch($load_harmony)) {
                $selected = $row["hvalue"] == $hvalue ? "selected=\"selected\"" : "";
                if ($cat < 5 && $row["itemtype"] == 1 && $row["hoption"] == $hopt) {
                    $harmonyecho .= "<option value=\"" . $row["hvalue"] . "\" " . $selected . ">" . $row["hname"] . "</option>";
                }
                if ($cat == 5 && $row["itemtype"] == 2 && $row["hoption"] == $hopt) {
                    $harmonyecho .= "<option value=\"" . $row["hvalue"] . "\" " . $selected . ">" . $row["hname"] . "</option>";
                }
                if (5 < $cat && $row["itemtype"] == 3 && $row["hoption"] == $hopt) {
                    $harmonyecho .= "<option value=\"" . $row["hvalue"] . "\" " . $selected . ">" . $row["hname"] . "</option>";
                }
            }
            if (!$include_select) {
                $harmonyecho .= "</select>";
            }
        }
        return $harmonyecho;
    }
}

?>


DmN MuWebshop Free 1.6 Decoded - Download
 
Support Version ??

This code speaks for itself ->
PHP:
preg_match("/[a-fA-F0-9]{32,64}/", $item)

Season 2+ I guess, but since you have it decoded can be reworked to support lower versions as well.
 
Ако си преведе и това, ще го призная :D