🕹️Unreal Engine
📝 Prerequisites
🚀 Integration Steps
1
2
⚙️ Enabling the Plugin

using UnrealBuildTool;
public class freeRASP4 : ModuleRules
{
public freeRASP4 (ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
PublicDependencyModuleNames.AddRange(new string[] {
"Core",
"CoreUObject",
"Engine",
"InputCore",
"EnhancedInput",
"AIModule",
"StateTreeModule",
"GameplayStateTreeModule",
"UMG",
"FreeRASPPlugin" // <-- check if this line is added
});
}
}3
🧠 Handle Detected Threats
C++ Class Preparation (.h)
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/PlayerController.h"
#include "FreeRASPPluginLibrary.h" // <-- 1. Include the header file
#include "FreeRASPPlayerController.generated.h"
/**
* Basic PlayerController class for a game
*/
UCLASS(abstract)
class AFreeRASPPlayerController : public APlayerController
{
GENERATED_BODY()
protected:
/** Input Mapping Contexts */
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Input", meta = (AllowPrivateAccess = "true"))
TArray<UInputMappingContext*> DefaultMappingContexts;
/** Input mapping context setup */
virtual void SetupInputComponent() override;
virtual void BeginPlay() override; // initialize FreeRASP here
UFUNCTION()
void HandleSecurityThreat(ThreatType ThreatType); // define this method to receive threat callbacks
};Plugin Initialization (.cpp)
#include "AFreeRASPPlayerController.h" // Include your header file
#include "FreeRASPPluginLibrary.h" // Include the plugin header
void AFreeRASPPlayerController::BeginPlay()
{
Super::BeginPlay();
// Get the FreeRASP plugin library instance
if (UFreeRASPPluginLibrary* FreeRASPLib = GetGame->GetSubsystem<UFreeRASPPluginLibrary>())
{
// 1. Bind your function to the threat detection event
// The class name here MUST match the class you are in (e.g., AMyPlayerController)
FreeRASPLib->OnSecurityThreatDetected.AddDynamic(this, &AFreeRASPPlayerController::HandleSecurityThreat);
// 2. Prepare the configuration
// Important: These values are placeholders. Replace them with your actual data.
// iOS Configuration
TArray<FString> AppBundleIds;
AppBundleIds.Add(TEXT("com.game.bundle.id"));
FString AppTeamId = TEXT("1AB2C3");
// Android Configuration
FString PackageName = TEXT("com.talsec.free.rasp.game");
TArray<FString> SigningCertificates;
SigningCertificates.Add(TEXT("ilx/AtYu7TpAu5cma4JdDXio5bayFSi89axnyOCjfFo="));
TArray<FString> AlternativeStores;
AlternativeStores.Add(TEXT("com.samsung.android.apps.galaxyapp"));
// General Configuration
FString WatcherEmail = TEXT("[email protected]");
bool IsProduction = true; // Set to false for development builds
// 3. Initialize freeRASP
FreeRASPLib->InitializeTalsec(
AppBundleIds,
AppTeamId,
PackageName,
SigningCertificates,
AlternativeStores,
WatcherEmail,
IsProduction
);
}
}Handler Implementation (.cpp)
void AFreeRASPPlayerController::HandleSecurityThreat(ThreatType ThreatType)
{
UE_LOG(LogTemp, Warning, TEXT("Security threat detected: %d"), ThreatType);
switch (ThreatType) {
case ThreatType::OnPrivilegedAccess:
UE_LOG(LogTemp, Warning, TEXT("Privileged access threat detected"));
break;
case ThreatType::OnAppIntegrity:
UE_LOG(LogTemp, Warning, TEXT("App integrity threat detected"));
break;
case ThreatType::OnDebug:
UE_LOG(LogTemp, Warning, TEXT("Debug threat detected"));
break;
case ThreatType::OnSimulator:
UE_LOG(LogTemp, Warning, TEXT("Simulator threat detected"));
break;
case ThreatType::OnUnofficialStore:
UE_LOG(LogTemp, Warning, TEXT("Unofficial store threat detected"));
break;
case ThreatType::OnHookDetected:
UE_LOG(LogTemp, Warning, TEXT("Hook threat detected"));
break;
case ThreatType::OnDeviceBinding:
UE_LOG(LogTemp, Warning, TEXT("Device binding threat detected"));
break;
case ThreatType::OnDeviceID:
UE_LOG(LogTemp, Warning, TEXT("Device ID threat detected"));
break;
case ThreatType::OnObfuscationIssues:
UE_LOG(LogTemp, Warning, TEXT("Obfuscation issues threat detected"));
break;
case ThreatType::OnScreenshot:
UE_LOG(LogTemp, Warning, TEXT("Screenshot threat detected"));
break;
case ThreatType::OnScreenRecording:
UE_LOG(LogTemp, Warning, TEXT("Screen recording threat detected"));
break;
case ThreatType::OnPasscode:
UE_LOG(LogTemp, Warning, TEXT("Passcode threat detected"));
break;
case ThreatType::OnPasscodeChange:
UE_LOG(LogTemp, Warning, TEXT("Passcode change threat detected"));
break;
case ThreatType::OnSecureHardwareNotAvailable:
UE_LOG(LogTemp, Warning, TEXT("Secure hardware not available threat detected"));
break;
case ThreatType::OnDevMode:
UE_LOG(LogTemp, Warning, TEXT("Dev mode threat detected"));
break;
case ThreatType::OnADBEnabled:
UE_LOG(LogTemp, Warning, TEXT("ADB enabled threat detected"));
break;
case ThreatType::OnSystemVPN:
UE_log(LogTemp, Warning, TEXT("System VPN threat detected"));
break;
case ThreatType::Unknown:
UE_LOG(LogTemp, Warning, TEXT("Unknown threat detected"));
break
}
}🖥️ Check Talsec Portal
Last updated

