Skip to content

Commit 14abf9b

Browse files
committed
item identifier:namespace
1 parent c608436 commit 14abf9b

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

src/dllmain.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include <Windows.h>
1+
#include <Windows.h>
22
#include <stdint.h>
33
#include <iostream>
44
#include <fstream>
@@ -21,6 +21,13 @@ static void Item_appendFormattedHovertext(Item* self, const ItemStackBase& itemS
2121
uint64_t current = max - itemStack.mItem->getDamageValue(itemStack.mUserData);
2222
text.append(fmt::format("\nDurability: {} / {}", current, max));
2323
}
24+
25+
auto itemNamespace = reinterpret_cast<std::string*>(reinterpret_cast<uint64_t>(self) + 248);
26+
27+
std::string rawNameId;
28+
itemStack.getRawNameId(rawNameId);
29+
text.append(fmt::format("\n{}8{}:{}", "\xc2\xa7", *itemNamespace, rawNameId));
30+
2431
}
2532

2633
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) {
@@ -34,6 +41,8 @@ extern "C" __declspec(dllexport) void Initialize() {
3441
SigScan("40 55 53 56 57 41 54 41 55 41 56 41 57 48 8D 6C 24 ? 48 81 EC ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 45 ? 49 8B F1 4C 89 44 24 ? 4C 8B F2 48 8B D9"),
3542
&Item_appendFormattedHovertext, reinterpret_cast<void**>(&_Item_appendFormattedHovertext)
3643
);
44+
45+
Log::Info("Sizeof: {}\n", sizeof(std::string));
3746
}
3847

3948
extern "C" __declspec(dllexport) void Shutdown() {

0 commit comments

Comments
 (0)