Install the SafeGuard SDK for your preferred programming language.
1// C++ Installation Instructions
2
3// 1. Download the SafeGuard SDK
4// You can download the latest C++ SDK from our GitHub repository:
5// https://github.com/SafeGuard/safeguard-sdk-cpp
6
7// 2. Include the SDK in your project
8// - Extract the downloaded SDK package.
9// - Include the 'safeguard_sdk' directory in your project's include path.
10
11// 3. Link against the SafeGuard library
12// - Add the path to the SDK's 'lib' directory to your linker settings.
13// - Link against 'safeguard.lib'.
14
15// Example using CMake:
16
17// CMakeLists.txt
18# cmake_minimum_required(VERSION 3.10)
19# project(MyProject)
20//
21// set(CMAKE_CXX_STANDARD 17)
22//
23// include_directories(/path/to/safeguard_sdk)
24// link_directories(/path/to/safeguard_sdk/lib)
25//
26// add_executable(MyProject main.cpp)
27// target_link_libraries(MyProject safeguard)
28//
Initialize the SafeGuard SDK in your application.
1#include "SafeGuard.h"
2
3int main() {
4 SafeGuard::Loader loader("safeguard.dll");
5 loader.initialize("YOUR_API_KEY");
6 // Your code here
7 return 0;
8}
All admin portal API requests to SafeGuard must include an X-API-Key
header containing your admin token. This ensures secure and authorized access to the API endpoints.
URL: https://safeguard.lol/api/
Header Requirement:
X-API-Key: "YOUR_ADMIN_TOKEN"
Replace YOUR_ADMIN_TOKEN
with your actual admin token.
The SafeGuard API allows you to perform various administrative tasks such as managing users, licenses, resellers, and more. Below are the available commands and their usage.
Learn how to integrate and use the SafeGuard SDK in your C++ and C# projects.
The SafeGuard SDK provides a set of functions to integrate SafeGuard's features into your applications. Below are the available functionalities with examples in both C++ and C#.
Initialize the SafeGuard SDK with your API key.
1#include "SafeGuard.h"
2
3int main() {
4 SafeGuard::Loader loader("safeguard.dll");
5 loader.initialize("YOUR_API_KEY");
6 // Your code here
7 return 0;
8}
Authenticate a user by their username.
1#include "SafeGuard.h"
2
3int main() {
4 SafeGuard::Loader loader("safeguard.dll");
5 loader.initialize("YOUR_API_KEY");
6
7 bool isAuthenticated = loader.authenticateUser("username");
8 if (isAuthenticated) {
9 // User is authenticated
10 } else {
11 // Authentication failed
12 }
13 return 0;
14}
Register a new user with a license key.
1#include "SafeGuard.h"
2
3int main() {
4 SafeGuard::Loader loader("safeguard.dll");
5 loader.initialize("YOUR_API_KEY");
6
7 bool isRegistered = loader.registerUser("new_user", "LICENSE_KEY");
8 if (isRegistered) {
9 // User registered successfully
10 } else {
11 // Registration failed
12 }
13 return 0;
14}
Download a file using the SDK.
1#include "SafeGuard.h"
2
3int main() {
4 SafeGuard::Loader loader("safeguard.dll");
5 loader.initialize("YOUR_API_KEY");
6
7 bool isDownloaded = loader.downloadFile("file_name");
8 if (isDownloaded) {
9 // File downloaded successfully
10 } else {
11 // Download failed
12 }
13 return 0;
14}
Inject a file into a running program.
1#include "SafeGuard.h"
2
3int main() {
4 SafeGuard::Loader loader("safeguard.dll");
5 loader.initialize("YOUR_API_KEY");
6
7 bool isInjected = loader.injectFile("file_path", "target_program");
8 if (isInjected) {
9 // File injected successfully
10 } else {
11 // Injection failed
12 }
13 return 0;
14}
Retrieve a variable's value by name.
1#include "SafeGuard.h"
2#include <iostream>
3
4int main() {
5 SafeGuard::Loader loader("safeguard.dll");
6 loader.initialize("YOUR_API_KEY");
7
8 const char* value = loader.retrieveVariable("variable_name");
9 if (value != nullptr) {
10 std::cout << "Value: " << value << std::endl;
11 } else {
12 std::cerr << "Variable not found." << std::endl;
13 }
14 return 0;
15}
Retrieve the key level.
1#include "SafeGuard.h"
2#include <iostream>
3
4int main() {
5 SafeGuard::Loader loader("safeguard.dll");
6 loader.initialize("YOUR_API_KEY");
7
8 int keyLevel = loader.getKeyLevel();
9 std::cout << "Key Level: " << keyLevel << std::endl;
10 return 0;
11}
Get the key expiry date as a readable string.
1#include "SafeGuard.h"
2#include <iostream>
3
4int main() {
5 SafeGuard::Loader loader("safeguard.dll");
6 loader.initialize("YOUR_API_KEY");
7
8 const char* expiry = loader.getKeyExpiry();
9 std::cout << "Key Expiry: " << expiry << std::endl;
10 return 0;
11}
Retrieve the content of a file.
1#include "SafeGuard.h"
2#include <iostream>
3
4int main() {
5 SafeGuard::Loader loader("safeguard.dll");
6 loader.initialize("YOUR_API_KEY");
7
8 int length;
9 uint8_t* content = loader.getFileContent(&length);
10 if (content != nullptr && length > 0) {
11 // Process the file content
12 // Remember to free the unmanaged memory if required
13 } else {
14 std::cerr << "Failed to retrieve file content." << std::endl;
15 }
16 return 0;
17}
Retrieve the last error message.
1#include "SafeGuard.h"
2#include <iostream>
3
4int main() {
5 SafeGuard::Loader loader("safeguard.dll");
6 loader.initialize("YOUR_API_KEY");
7
8 const char* error = loader.getLastError();
9 if (error != nullptr) {
10 std::cerr << "Error: " << error << std::endl;
11 }
12 return 0;
13}