Пользователь
- Статус
- Оффлайн
- Регистрация
- 20 Янв 2022
- Сообщения
- 234
- Реакции
- 55
step 1:
(dump shit)
step 2:
equip sticker
equip keychain
add keychain entity(while equip skin on weapon)
PoC(sticker and keychain):
add medal (like music kit and set def_idx from dumped item)
equip medal:
equip medal in game:
PoC(medal):
(dump shit)
C++:
auto& GetSortedItemDefinitionMap() { return *reinterpret_cast<CUtlMap<int, CEconItemDefinition*>*>((uintptr_t)(this) + 0x128); }
auto& GetKeychains() { return *reinterpret_cast<CUtlMap<int, CKeyChain*>*>((uintptr_t)(this) + 0x4B0); }
auto& GetStickers() { return *reinterpret_cast<CUtlMap<int, CSkiterKit*>*>((uintptr_t)(this) + 0x318); }
const auto& vecStickers = ItemSchema->GetStickers();
const auto& vecKeychain = ItemSchema->GetKeychains();
const auto& vecItems = ItemSchema->GetSortedItemDefinitionMap();
for (const auto& it : vecKeychain) {
CKeyChain* pKeychain = it.m_value;
if (!pKeychain) continue;
if (strstr(pKeychain->m_strInventoryImag2e, "kc_bud2025")) continue;
if (strstr(pKeychain->m_strInventoryImag2e, "kc_sticker_display_case")) continue;
Skin charm;
charm.id = pKeychain->m_nID;
charm.name = CLocalize::Get()->FindSafe(pKeychain->m_strLocDescription);
charm.rarity = std::clamp<int>(static_cast<int>(pKeychain->m_nRarity - 1), 0, (pKeychain->m_nRarity == 7) ? 7 : 6) - 1;
std::string path = "file://{images}/";
path += pKeychain->m_strInventoryImag2e;
path += "_png.vtex";
charm.path = path;
charm.spinner_id = GenerateSpinnerID(pKeychain->m_strNameLocToken, "");
charm_type.skins.push_back(charm);
}
for (const auto& it : vecStickers) {
CSkiterKit* pSticker = it.m_value;
if (!pSticker) continue;
if (strstr(pSticker->name, "default")) continue;
Skin sticker;
sticker.id = pSticker->id;
sticker.name = CLocalize::Get()->FindSafe(pSticker->item_name);
sticker.rarity = std::clamp<int>(static_cast<int>(pSticker->rarity - 1), 0, (pSticker->rarity == 7) ? 7 : 6);
std::string path = "file://{images}/";
path += pSticker->inventory_image;
path += "_png.vtex";
sticker.path = path;
sticker.spinner_id = GenerateSpinnerID(pSticker->name, "");
sticker_pool.push_back(sticker);
}
for (const auto& it : vecItems) {
CEconItemDefinition* pItem = it.m_value;
if (!pItem) continue;
const bool IsMedal = pItem->is_medal();
if (!IsMedal) continue;
const char* itemBaseName = pItem->m_pszItemBaseName;
if (!itemBaseName || itemBaseName[0] == '\0') continue;
if (strstr(pItem->get_simple(), "ollectible")) continue;
const char* simple = pItem->get_simple2();
const uint16_t defIdx = pItem->m_nDefIndex;
DumpedItem_t dumpedItem;
dumpedItem.m_name = CLocalize::Get()->FindSafe(pItem->m_pszItemBaseName);
dumpedItem.m_tocken_name = pItem->m_pszItemBaseName;
dumpedItem.m_defIdx = defIdx;
dumpedItem.m_rarity = pItem->GetRarity();
if (simple && simple[0] != '\0') dumpedItem.m_simpleName = simple; // e.g. weapon_ak47
dumpedItem.m_unusualItem = true;
std::string imagePath = "file://{images}/";
imagePath += dumpedItem.m_simpleName;
imagePath += "_png.vtex";
def.path = imagePath;
def.name = dumpedItem.m_name;
def.rarity = dumpedItem.m_rarity - 1;
def.id = defIdx;
def.unusual = true;
def.spinner_id = GenerateSpinnerID(dumpedItem.m_simpleName, "");
if (IsMedal) medal_def.skins.push_back(def);
}
equip sticker
C++:
void SetStickerSlot1(int id) { SetDynamicAttributeValue(113, &id); }
void SetStickerSlot2(int id) { SetDynamicAttributeValue(117, &id); }
void SetStickerSlot3(int id) { SetDynamicAttributeValue(121, &id); }
void SetStickerSlot4(int id) { SetDynamicAttributeValue(125, &id); }
if (weapon->selected_stickers[0] != 0) pItem->SetStickerSlot1(sticker_pool[weapon->selected_stickers[0]].id);
if (weapon->selected_stickers[1] != 0) pItem->SetStickerSlot2(sticker_pool[weapon->selected_stickers[1]].id);
if (weapon->selected_stickers[2] != 0) pItem->SetStickerSlot3(sticker_pool[weapon->selected_stickers[2]].id);
if (weapon->selected_stickers[3] != 0) pItem->SetStickerSlot4(sticker_pool[weapon->selected_stickers[3]].id);
equip keychain
C++:
void SetKeychains(int id) { SetDynamicAttributeValue(299, &id); }
C++:
@client.dll $ 44 88 44 24 ? 48 89 54 24 ? 55 53 56 57 41 54 41 55 41 56 41 57 48 8D AC 24
void C_CSWeaponBase::AddKeychain() {
auto mItem = m_AttributeManager()->m_Item();
signatures::AddKeychain.GetPtr().Call<char(__fastcall*)(void*, void*)>(this, mItem);
}
in code ->
pWeapon->AddKeychain();
add medal (like music kit and set def_idx from dumped item)
equip medal:
C++:
CCSInventoryManager::GetInstance()->EquipItemInLoadout(0, equipment->GetSelectedType()->slot, pItem->m_ulID);//equipment->GetSelectedType()->slot == LOADOUT_SLOT_FLAIR0 == 55
C++:
int& m_nActiveCoinRank() { return *(int*)(std::uintptr_t(this) + 0x70); }
void CInventory::ApplyMedal() {
if (!Globals->local_controller || !Globals->local_controller->Get() || !Globals->local_controller->Get()->m_pInventoryServices())
return;
CCSPlayerController_InventoryServices* pInventoryService = Globals->local_controller->Get()->m_pInventoryServices();
CCSPlayerInventory* inventory = CCSPlayerInventory::GetInstance();
if (!inventory) return;
C_EconItemView* pTargetCoinItemView = inventory->GetItemInLoadout(0, LOADOUT_SLOT_FLAIR0);
CEconItemDefinition* pItem = pTargetCoinItemView->GetStaticData();
if (pItem) {
if (medals_data.GetSelectedType()->selected_skin != 0)
pInventoryService->m_nActiveCoinRank() = medals_data.GetSelectedType()->GetSelectedSkin()->id;
else
pInventoryService->m_nActiveCoinRank() = pItem->m_nDefIndex;
}
}