MCPcopy Create free account
hub / github.com/Do0ks/GSpots / GetUnrealEngineVersion

Function GetUnrealEngineVersion

UEVersionScanner/UEVersionScanner.cpp:166–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

164}
165
166std::string GetUnrealEngineVersion(const std::string& filePath, const std::string& exeName) {
167 DWORD processID = 0;
168 std::string version;
169 // If the process is running, try to scan its memory first.
170 if (IsProcessRunning(exeName, processID)) {
171 std::cout << "Process " << exeName << " is running (PID: " << processID << "). Attaching...\n";
172 HANDLE hProcess = OpenProcess(PROCESS_VM_READ | PROCESS_QUERY_INFORMATION, FALSE, processID);
173 if (hProcess) {
174 version = GetVersionFromProcessMemory(hProcess);
175 CloseHandle(hProcess);
176 }
177 }
178 // Fall back to file-based methods.
179 if (version.empty() || version == "EngineVersion" || version == "FEngineVersion")
180 version = GetVersionFromResource(filePath);
181 if (version.empty())
182 version = GetVersionFromFiles(filePath);
183 if (version.empty())
184 version = GetVersionFromMemoryScan();
185 return version.empty() ? "Unknown" : version;
186}

Callers 1

mainFunction · 0.85

Calls 5

IsProcessRunningFunction · 0.85
GetVersionFromResourceFunction · 0.85
GetVersionFromFilesFunction · 0.85
GetVersionFromMemoryScanFunction · 0.85

Tested by

no test coverage detected