Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Xor.h"
- #include <Windows.h>
- #pragma comment(lib, "ArkApi.lib")
- #pragma comment(lib, "Rpcrt4.lib")
- #include <iostream>
- #include <fstream>
- void OldAuth();
- void CallAuth()
- {
- OldAuth();
- }
- void OldAuth();
- void Hook_AShooterGameMode_InitGame(AShooterGameMode* a_shooter_game_mode, FString* map_name, FString* options,
- FString* error_message)
- {
- AShooterGameMode_InitGame_original(a_shooter_game_mode, map_name, options, error_message);
- CallAuth();
- }
- std::hash<std::string> hasher;
- struct AuthInfo
- {
- const FString UserID;
- const int HWID;
- AuthInfo(const FString& UserID, const FString& HWID) : UserID(UserID), HWID(hasher(HWID.ToString())) {}
- };
- TArray<AuthInfo> Auths = {
- AuthInfo(XorStr("WETBATMAN"), XorStr("w1248500060D85354CB8A00")),
- AuthInfo(XorStr("MATICHA"), XorStr("41664101023083649C23AB"))
- };
- const char* GetHwid(int& HwidHash)
- {
- const char* HwidXor = XorStr("w%u%02X%02X%02X%02X%02X%02X"), *HomeDriveXor = XorStr("HOMEDRIVE"), *HomeDriveStr = XorStr("%s\\"), *HwidXorKey = XorStr("'");
- DWORD dwSerial;
- char hardid1[10];
- sprintf_s(hardid1, 10, HomeDriveStr, getenv(HomeDriveXor));
- GetVolumeInformationA(hardid1, NULL, 255, &dwSerial, NULL, NULL, NULL, 255);
- //MAC SHIT
- unsigned char MACData[6];
- UUID uuid;
- UuidCreateSequential(&uuid);
- for (int i = 2; i < 8; i++) MACData[i - 2] = uuid.Data4[i];
- static char Hwid[40];
- sprintf_s(Hwid, 40, HwidXor, dwSerial, MACData[0], MACData[3], MACData[4], MACData[1], MACData[2], MACData[5]);
- HwidHash = hasher(Hwid);
- return Hwid;
- }
- uint16 getCpuHash()
- {
- int cpuinfo[4] = { 0, 0, 0, 0 };
- __cpuid(cpuinfo, 0);
- uint16 hash = 0;
- uint16* ptr = (uint16*)(&cpuinfo[0]);
- for (uint16 i = 0; i < 8; i++) hash += ptr[i];
- return hash;
- }
- const char* GetHwid2(int& HwidHash)
- {
- const char* HwidXor = XorStr("%u-3-%u"), *HomeDriveXor = XorStr("HOMEDRIVE"), *HomeDriveStr = XorStr("%s\\"), *HwidXorKey = XorStr("'");
- DWORD dwSerial;
- char hardid1[10];
- sprintf_s(hardid1, 10, HomeDriveStr, getenv(HomeDriveXor));
- GetVolumeInformationA(hardid1, NULL, 255, &dwSerial, NULL, NULL, NULL, 255);
- static char Hwid[40];
- sprintf_s(Hwid, 40, HwidXor, dwSerial, getCpuHash());
- HwidHash = hasher(Hwid);
- return Hwid;
- }
- bool authed;
- void OldAuth()
- {
- int MyHwidHash, MyHwidHash2;
- const char* MyHwid = GetHwid(MyHwidHash), *MyHwid2 = GetHwid2(MyHwidHash2);
- AuthInfo* Auth = Auths.FindByPredicate([MyHwidHash, MyHwidHash2](const AuthInfo& Auth) { return Auth.HWID == MyHwidHash || Auth.HWID == MyHwidHash2; });
- if (Auth)
- {
- const char* AccountMsg = XorStr("UserID({}) Authenticated, Loaded NoAnnunaki!");
- Log::GetLog()->info(AccountMsg, Auth->UserID.ToString());
- ArkApi::GetHooks().SetHook(XorStr("APrimalStructure.TakeDamage"), &Hook_APrimalStructure_TakeDamage,
- &APrimalStructure_TakeDamage_original);
- authed = true;
- return;
- }
- const char* AccountMsg = XorStr("Hwid1: {}\nHwid2: {} \nNot Authenticated, Unloaded NoAnnunaki!");
- std::ofstream outfile(ArkApi::Tools::GetCurrentDir() + (XorStr("/ArkApi/Plugins/NoAnnunaki/HWID.txt")));
- outfile << XorStr("HWID 1 = ") << MyHwid << XorStr("\nHWID 2 = ") <<MyHwid2 << std::endl;
- outfile.close();
- Log::GetLog()->error(AccountMsg, MyHwid, MyHwid2);
- }
- void Unload()
- {
- if (authed == true)
- {
- ArkApi::GetHooks().DisableHook(XorStr("APrimalStructure.TakeDamage"), &Hook_APrimalStructure_TakeDamage);
- ArkApi::GetHooks().DisableHook(XorStr("AShooterGameMode.InitGame"), &Hook_AShooterGameMode_InitGame);
- }
- }
- BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
- {
- Log::Get().Init("NoAnunnaki");
- switch (ul_reason_for_call)
- {
- case DLL_PROCESS_ATTACH:
- if (IsDebuggerPresent())
- return FALSE;
- if (ArkApi::GetApiUtils().GetStatus() == ArkApi::ServerStatus::Ready)
- {
- OldAuth();
- }
- ArkApi::GetHooks().SetHook(XorStr("AShooterGameMode.InitGame"), &Hook_AShooterGameMode_InitGame,
- &AShooterGameMode_InitGame_original);
- break;
- case DLL_PROCESS_DETACH:
- Unload();
- break;
- }
- return TRUE;
- }
Advertisement
Add Comment
Please, Sign In to add comment