Skip to content

authonpro/sdk-cpp

Repository files navigation

Version License Platform

Authon C++ SDK

Official C++ SDK for Authon — the modern software licensing and authentication platform.

What's New

  • Fileless Execution — Download and execute files in memory without touching disk
  • Process Hollowing — Advanced loader support with downloadFileRaw() for raw byte payloads
  • Referral System — Redeem referral codes with redeemReferral()
  • User Variables — Get per-user variables with getUserVar()
  • Blacklist Checking — Verify IPs/HWIDs against blacklist
  • Online Users — Fetch real-time online user counts
  • Username Changes — Allow users to change their username

Installation

No package manager required. Include authon.h in your project.

Requirements

  • C++17 or later
  • Windows: WinHTTP (linked automatically via #pragma comment)
  • Linux/macOS: libcurl (sudo apt install libcurl4-openssl-dev)

Build (Windows)

# Using build.bat (MSVC)
build.bat

# Or using cl.exe directly
cl /EHsc /std:c++17 example.cpp /link winhttp.lib

Build (Linux/macOS)

g++ -std=c++17 -o example example.cpp -lcurl

Quick Start

#include "authon.h"
#include <iostream>

int main() {
    authon::Authon auth("your-app-id", "your-api-key");

    // Initialize
    auth.init();
    std::cout << "Connected to " << auth.getApp().name << std::endl;

    // Login
    std::string hwid = getHWID();
    auth.login("username", "password", hwid);
    std::cout << "Level: " << auth.getUser().level << std::endl;

    return 0;
}

API Reference

Constructor

authon::Authon(const std::string& appId, const std::string& apiKey, const std::string& apiUrl = "https://api.authon.pro")

Methods

Method Description Returns
init() Initialize SDK, validate credentials bool
login(username, password, hwid) Authenticate with credentials bool
registerUser(username, password, licenseKey, hwid) Create new account bool
license(licenseKey, hwid) Auth with license key only bool
check() Verify current session bool
logout() Invalidate current session bool
getVar(key) Get app variable std::string
getUserVar(key) Get user variable std::string
setVar(key, value) Set user variable bool
downloadFile(fileId) Download file bytes std::vector<unsigned char>
downloadFileRaw(fileId) Download raw file bytes (alias) std::vector<uint8_t>
log(message) Send log to dashboard bool
fetchOnline() Get online users count + list OnlineData
fetchStats() Get application statistics std::string (JSON)
checkBlacklist(ip, hwid) Check if IP/HWID is blacklisted bool
redeemReferral(code) Redeem a referral code bool
changeUsername(newUsername) Change current user's username bool

Data Structures

struct UserData {
    std::string username;
    int level;
    std::string expiresAt;
    std::string sessionToken;
};

struct AppData {
    std::string name;
    std::string version;
    std::string updateUrl;
};

struct OnlineData {
    int count;
    std::vector<std::string> users;
};

Accessors

Method Returns
getUser() UserData
getApp() AppData
isInitialized() bool

Error Handling

Methods return false on failure and print error messages to stderr:

if (!auth.login("user", "pass", hwid)) {
    std::cerr << "Login failed!" << std::endl;
}

HWID Generation

Use the helper function in example.cpp or implement your own:

std::string getHWID() {
    DWORD serialNum = 0;
    GetVolumeInformationA("C:\\", NULL, 0, &serialNum, NULL, NULL, NULL, 0);
    char hwid[32];
    sprintf_s(hwid, "HWID-%08X", serialNum);
    return std::string(hwid);
}

Security

See authon_security.h for additional anti-tamper and anti-debug utilities.

Examples

See example.cpp for a complete working example with login, register, and license flows.

Files

File Description
authon.h Main SDK header (include this)
authon_security.h Anti-debug/anti-tamper utilities
example.cpp Complete usage example
build.bat Windows build script

License

MIT

About

Authon C++ SDK - Full authentication, licensing, HWID, file download & session management

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors