Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
feat: dump vtable3
Browse files Browse the repository at this point in the history
  • Loading branch information
killcerr authored Feb 7, 2024
1 parent 6357e67 commit 62fdf4c
Showing 1 changed file with 22 additions and 12 deletions.
34 changes: 22 additions & 12 deletions src/DataExtractor.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#pragma comment(lib, "Dbghelp.lib")
#include "DataExtractor.h"

using json = nlohmann::json;
Expand Down Expand Up @@ -99,6 +100,14 @@ LL_AUTO_TYPE_INSTANCE_HOOK(
mc = this;
origin();
hookLogger.info("INJECT MINECRAFT INSTANCE");
// _sleep(10000);
hookLogger.info("ON DUMP VTABLE");
auto list = dumpVtable(this);
nlohmann::ordered_json json;
for (auto pair : list) {
json[std::to_string((unsigned long long)pair.first)] = pair.second;
}
writeNlohmannJSON("blockVtables.json", json);
}

// MinecraftCommands
Expand All @@ -122,21 +131,22 @@ LL_AUTO_TYPE_INSTANCE_HOOK(
}

// MinecraftCommands
LL_AUTO_TYPE_INSTANCE_HOOK(BlockHooK, HookPriority::Normal, Block, "??0Block@@QEAA@GV?$not_null@PEAVBlockLegacy@@@gsl@@VCompoundTag@@AEBI@Z",
void*,
void* a1,
void* a2,
void* a3,
void* a4) {
auto list = dumpVtable(this);
LL_AUTO_TYPE_INSTANCE_HOOK(
BlockHook,
HookPriority::Normal,
Block,
"?addTag@Block@@QEAAAEAV1@AEBVHashedString@@@Z",
void*,
void* a1
) {
hookLogger.info("ON DUMP VTABLE");
auto list = dumpVtable(this);
nlohmann::ordered_json json;
for(auto pair :list) {
std::stringstream ss;
ss << pair.first;
json[ss.str()] = pair.second;
for (auto pair : list) {
json[std::to_string((unsigned long long)pair.first)] = pair.second;
}
writeNlohmannJSON("blockVtables.json", json);
return origin(a1,a2,a3,a4);
return origin(a1);
}

#pragma endregion HOOK
Expand Down

0 comments on commit 62fdf4c

Please sign in to comment.