This commit is contained in:
2026-01-12 13:24:43 +05:00
parent 258d9cd13f
commit 43fbf31162
22 changed files with 275 additions and 20 deletions
+60
View File
@@ -0,0 +1,60 @@
# ---> UnrealEngine
# Visual Studio 2015 user specific files
.vs/
# Fortran module files
#*.mod
# These project files can be generated by the engine
*.xcodeproj
*.xcworkspace
*.sln
*.suo
*.opensdf
*.sdf
*.VC.db
*.VC.opendb
# Precompiled Assets
SourceArt/**/*.png
SourceArt/**/*.tga
# Builds
Build/**
!Plugins/**
# Don't ignore icon files in Build
!Build/**/
!Build/*/*.ico
# Built data for maps
*_BuiltData.uasset
# Configuration files generated by the Editor
Saved/*
# Compiled source files for the engine to use
**/Intermediate/*
# Cache files for the editor to use
DerivedDataCache/*
# Application folders
Offers/
Users/
**/Binaries/*/*
!**/Binaries/**/UnrealEditor*
!**/Binaries/**/*.target
Releases/
Config/UserEngine.ini
*.vsconfig
Plugins/DLSS
Plugins/DLSSMoviePipelineSupport
Plugins/NIS
@@ -0,0 +1,7 @@
{
"BuildId": "27405482",
"Modules":
{
"antiDublicate": "UnrealEditor-antiDublicate.dll"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

@@ -0,0 +1,88 @@
// Copyright Epic Games, Inc. All Rights Reserved.
#include "antiDublicate.h"
#include "kismet/KismetSystemLibrary.h"
#include <windows.h>
#include <psapi.h>
#define LOCTEXT_NAMESPACE "FantiDublicateModule"
void FantiDublicateModule::StartupModule()
{
FString pname = FPlatformProcess::ExecutableName(false);
if (pname == L"UnrealEditor.exe") return;
auto pname1 = []() {
TArray<FString> foundFiles;
IFileManager& fileManager = IFileManager::Get();
FString pattern = FPaths::RootDir();
pattern += TEXT("*.exe");
fileManager.FindFiles(foundFiles, *pattern, true, false);
if (foundFiles.Num() > 0) {
return foundFiles[0];
}
return FString();
}();
#ifdef GetCommandLine
#undef GetCommandLine
#endif // GetCommandLine
if (UKismetSystemLibrary::GetCommandLine().Contains("-PixelStreamingIP")) return;
// Get the list of process identifiers.
DWORD aProcesses[1024], cbNeeded, cProcesses;
unsigned int i;
TCHAR szProcessName[MAX_PATH] = TEXT("<unknown>");
TArray<FString> fprocesses;
if (!EnumProcesses(aProcesses, sizeof(aProcesses), &cbNeeded)) return;
cProcesses = cbNeeded / sizeof(DWORD);
int copies = 0;
for (i = 0; i < cProcesses; i++)
{
if (aProcesses[i] != 0)
{
HANDLE hProcess = OpenProcess(PROCESS_QUERY_INFORMATION |
PROCESS_VM_READ,
FALSE, aProcesses[i]);
// Get the process name.
if (NULL != hProcess)
{
HMODULE hMod;
if (EnumProcessModules(hProcess, &hMod, sizeof(hMod), &cbNeeded))
{
GetModuleBaseName(hProcess, hMod, szProcessName, sizeof(szProcessName) / sizeof(TCHAR));
if (FString(szProcessName) == pname || (FString(szProcessName)==pname1&& !pname1.IsEmpty())) copies++;
}
// Release the handle to the process.
CloseHandle(hProcess);
}
if (copies > 2) {
FGenericPlatformMisc::RequestExit(false, L"PIDOR DETECTED");
return;
}
}
}
}
void FantiDublicateModule::ShutdownModule()
{
// This function may be called during shutdown to clean up your module. For modules that support dynamic reloading,
// we call this function before unloading the module.
}
#undef LOCTEXT_NAMESPACE
IMPLEMENT_MODULE(FantiDublicateModule, antiDublicate)
@@ -0,0 +1,15 @@
// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "Modules/ModuleManager.h"
class FantiDublicateModule : public IModuleInterface
{
public:
/** IModuleInterface implementation */
virtual void StartupModule() override;
virtual void ShutdownModule() override;
};
@@ -0,0 +1,53 @@
// Copyright Epic Games, Inc. All Rights Reserved.
using UnrealBuildTool;
public class antiDublicate : ModuleRules
{
public antiDublicate(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
PublicIncludePaths.AddRange(
new string[] {
// ... add public include paths required here ...
}
);
PrivateIncludePaths.AddRange(
new string[] {
// ... add other private include paths required here ...
}
);
PublicDependencyModuleNames.AddRange(
new string[]
{
"Core",
// ... add other public dependencies that you statically link with here ...
}
);
PrivateDependencyModuleNames.AddRange(
new string[]
{
"CoreUObject",
"Engine",
"Slate",
"SlateCore",
// ... add private dependencies that you statically link with here ...
}
);
DynamicallyLoadedModuleNames.AddRange(
new string[]
{
// ... add any modules that your module loads dynamically here ...
}
);
}
}
@@ -0,0 +1,24 @@
{
"FileVersion": 3,
"Version": 1,
"VersionName": "1.0",
"FriendlyName": "antiDublicate",
"Description": "if enabled prevent app to be launched many times. Except pixel streaming config and editor",
"Category": "Other",
"CreatedBy": "Dron",
"CreatedByURL": "https://github.com/Andron666",
"DocsURL": "",
"MarketplaceURL": "",
"SupportURL": "",
"CanContainContent": false,
"IsBetaVersion": false,
"IsExperimentalVersion": false,
"Installed": false,
"Modules": [
{
"Name": "antiDublicate",
"Type": "CookedOnly",
"LoadingPhase": "EarliestPossible"
}
]
}