-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.cpp
More file actions
107 lines (83 loc) · 3.85 KB
/
Copy pathmain.cpp
File metadata and controls
107 lines (83 loc) · 3.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#include <iostream>
#include <filesystem>
#include <string>
#include <vector>
#include "Util/Logger.h"
#include "Util/Game.h"
#include "Util/_UUID.h"
#include "Util/Terminal.h"
namespace fs = std::filesystem;
auto main() -> int {
ShowWindow(GetConsoleWindow(), SW_HIDE);
DestroyWindow(GetConsoleWindow());
Terminal::setup();
Game::close();
std::string appData = std::getenv("APPDATA");
std::string tempPath = std::getenv("TEMP");
std::string bedrockPath = appData + "\\Minecraft Bedrock";
std::string tempPePath = tempPath + "\\minecraftpe";
Game::remove(tempPePath + "\\ContentCache");
Game::remove(tempPePath + "\\CatalogCache");
Game::remove(tempPePath + "\\CatalogScratch");
Game::remove(tempPePath + "\\blob_cache");
Game::remove(tempPePath + "\\packcache");
Game::remove(tempPePath + "\\ResPackDownloads");
Game::remove(tempPePath + "\\persona");
Game::remove(tempPePath + "\\images");
Game::remove(tempPePath + "\\font");
Game::remove(tempPePath + "\\MCProfileCache");
Game::remove(tempPePath + "\\MessagingService");
Game::remove(tempPePath + "\\XblProfileCache");
Game::remove(tempPePath + "\\AchievementIcons");
Game::remove(tempPePath + "\\lastSessionPlayed.json");
Game::remove(bedrockPath + "\\logs");
Game::remove(bedrockPath + "\\premium_cache");
Game::remove(bedrockPath + "\\treatments");
Game::remove(bedrockPath + "\\cdn");
Game::remove(bedrockPath + "\\PackManifestFactoryCache");
Game::removeSpecificFiles(bedrockPath, {".ent", ".cache"});
std::string usersPath = bedrockPath + "\\Users";
if (fs::exists(usersPath)) {
for (const auto& entry : fs::directory_iterator(usersPath)) {
if (entry.is_directory()) {
std::string xuidPath = entry.path().string();
std::string userGamePath = xuidPath + "\\games\\com.mojang\\minecraftpe";
Game::remove(userGamePath + "\\clientId.txt");
Game::remove(userGamePath + "\\telemetry_info.json");
Game::remove(userGamePath + "\\catalog_info.json");
Game::remove(userGamePath + "\\NonAssertErrorLog.txt");
Game::remove(userGamePath + "\\splitscreen_appearance.json");
}
}
}
system("start minecraft://");
MessageBoxA(nullptr, "Just click on 'Ok' when the game is launched and you're in the menu (please wait until you're connected to xbox live).", "Kodiak", MB_OK | MB_ICONWARNING);
while (Game::handle == nullptr || Game::module == nullptr)
{
Game::handle = Game::GetProcessByName("Minecraft.exe");
if (Game::handle == nullptr) {
Game::handle = Game::GetProcessByName("Minecraft.Windows.exe");
}
if (Game::handle != nullptr) {
Game::module = Game::GetModule(Game::handle);
}
}
Game::baseAddress = reinterpret_cast<uintptr_t>(Game::module);
uintptr_t pointerBase = Game::baseAddress + 0x0DCDF748;
std::vector<unsigned int> offsets = { 0x20, 0x0 };
uintptr_t deviceIdAddress = Game::FindDMAAddy(Game::handle, pointerBase, offsets);
if (deviceIdAddress == 0 || deviceIdAddress < 0x10000) {
MessageBoxA(nullptr, "Failed to find Device ID Address! Pointers might have changed.", "Error", MB_OK | MB_ICONERROR);
return 1;
}
std::string newDID = _UUID::v4();
newDID.erase(std::remove(newDID.begin(), newDID.end(), '-'), newDID.end());
if (newDID.length() > 32) newDID = newDID.substr(0, 32);
if (Game::patchBytes((void*)deviceIdAddress, (void*)newDID.c_str(), 32)) {
std::string msg = "Spoofed Successfully!\nDevice ID: " + newDID;
MessageBoxA(nullptr, msg.c_str(), "Kodiak", MB_OK | MB_ICONINFORMATION);
} else {
MessageBoxA(nullptr, "Failed to write memory. Run as Admin?", "Error", MB_OK | MB_ICONERROR);
}
return 0;
}