-
Notifications
You must be signed in to change notification settings - Fork 1
/
Source.cpp
154 lines (125 loc) · 4.77 KB
/
Source.cpp
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
#pragma warning(disable : 4996)
#include "includes.h"
void findGnames() {
std::ofstream myfile;
myfile.open("Gname.txt");
for (size_t i = 0x6000000; i < 0x6f00000; i += 8) {
auto chunkOffset = (uint32_t)((int)(0) >> 16);
auto nameOffset = (uint16_t)0 & 65535;
auto namePoolChunk = getPtr(getRealOffset(i) + ((chunkOffset + 2) * 8));
auto entryOffset = namePoolChunk + (ULONG)(2 * nameOffset);
auto nameEntry = Read<INT16>(entryOffset);
auto StrLength = nameEntry >> 6;
if (StrLength > 0 && StrLength < 5)
{
string name(StrLength, '\0');
readRaw((void*)(entryOffset + 0x2), (void*)name.data(), StrLength * sizeof(char), 0);
name.shrink_to_fit();
if (strstr(name.c_str(), "None") && (strlen(name.c_str()) < 5)) {
printf("\nGname Offsets: 0x%lX vTable: 0x%lX\n", i, 0);
myfile << "0x" << std::hex << i << " " << "0x" << std::hex << 0x110 << "\n";
}
}
}
myfile.close();
}
void findgworld() {
//SolarWorldSettings
//DefaultPhysicsVolume
std::ofstream myfile;
myfile.open("Gworld.txt");
for (size_t i = 0x6000000; i < 0x6f00000; i += 8)
{
kaddr gworld = getPtr(getRealOffset(i));
kaddr level = getPtr(gworld + Offsets::UWorldToPersistentLevel);
kaddr actorList = getPtr(level + Offsets::ULevelToAActors);
kaddr actor = getPtr(actorList + (0 * Offsets::PointerSize));
int entityStruct = Read<int>(actor + 0x18);
auto chunkOffset = (uint32_t)((int)(entityStruct) >> 16);
auto nameOffset = (uint16_t)entityStruct & 65535;
auto namePoolChunk = getPtr(getRealOffset(Offsets::GNames) + ((chunkOffset + 2) * 8)); // <= put gname address
auto entryOffset = namePoolChunk + (ULONG)(2 * nameOffset);
auto nameEntry = Read<INT16>(entryOffset);
auto StrLength = nameEntry >> 6;
if (StrLength > 0 && StrLength < 19)
{
string name(StrLength, '\0');
readRaw((void*)(entryOffset + 0x2), (void*)name.data(), StrLength * sizeof(char), 0);
name.shrink_to_fit();
if (strstr(name.c_str(), "WorldSettings")) {
printf("\nGworld Offsets: 0x%lX vTable: 0x%lX\n", i, 0);
myfile << "0x" << std::hex << i << " " << "0x" << std::hex << 0x0 << "\n";
}
}
}
myfile.close();
}
int main()
{
Offsets::initOffsets_32();
Offsets::patchUE423_32();
Offsets::Base = 0x6;
Offsets::GNames = 0x0;
Offsets::GWorld = 0x0;
pID = FindProcessId("SolarlandClient-Win64-Shipping.exe");
if (pID > 0)
{
re:
system("cls");
std::cout << "[+] Game PID " << std::hex << pID << std::endl;
Offsets::Base = ImageBase();
if (ValidPointer(Offsets::Base))
{
std::cout << "Dump Game Press [ 1 ]" << std::endl;
std::cout << "Find Gname Press [ 2 ]" << std::endl;
std::cout << "Find Gword Press [ 3 ]" << std::endl;
int index = 0;
std::cin >> index;
if (index == 1)
{
std::cout << "Input Gname Address" << std::endl;
DWORD_PTR GnameAddress;
std::cin >> std::hex >> GnameAddress;
Offsets::GNames = GnameAddress;
std::cout << "Input Gworld Address" << std::endl;
DWORD_PTR GworldAddress;
std::cin >> std::hex >> GworldAddress;
Offsets::GWorld = GworldAddress;
if (Offsets::Base != 0 && Offsets::GNames != 0 && Offsets::GWorld != 0)
{
DumpSDKW("");
}
else
{
std::cout << "Error Address" << std::endl;
}
std::cout << "Finshed" << std::endl;
}
else if (index == 2)
{
findGnames();
}
else if (index == 3)
{
std::cout << "Input Gname Address" << std::endl;
DWORD_PTR GnameAddress;
std::cin >> std::hex >> GnameAddress;
Offsets::GNames = GnameAddress;
findgworld();
}
std::cout << "Finshed" << std::endl;
getchar();
goto re;
}
else
{
std::cout << "Cant Find Base Address" << std::endl;
}
}
else
{
std::cout << "Error Can Not Find Game" << std::endl;
}
getchar();
return 0;
}