Advertisement
Anti-hide

C++ привязка(внутренняя) для маленьких проектов(паст)

Oct 28th, 2017
391
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.95 KB | None | 0 0
  1. #include <Windows.h>
  2. #include <stdio.h>
  3. #include <Shlobj.h>
  4. #include <stdio.h>
  5. #include <iostream>
  6. #include <string>
  7. #include <libloaderapi.h>
  8. using namespace std;
  9. int UserList[100500]// Тут тип кол-во юзеров, но я думаю этого числа будет вам достаточно :3
  10. {
  11.     1350956354,     // Тут ваши ключи пользователей через запятую
  12.     1234567890,
  13.     987654321
  14. };
  15. class GenLisenseClass
  16. {
  17. public:
  18.     void GetGSI()
  19.     {
  20.         GSI _GSI = 0;
  21.         _GSI = (GSI)GetProcAddress(GetModuleHandle("kernel32.dll"), "GetSystemInfo");
  22.         _GSI(&sysinfo);
  23.         NumberOfProcessors = sysinfo.dwNumberOfProcessors;
  24.         ProcessorType = sysinfo.dwProcessorType;
  25.         ProcessorRevision = sysinfo.wProcessorRevision;
  26.         dwGetGSI = ((((NumberOfProcessors*ProcessorType) * 1488) /*Ваше рандном число*/ + 1337) /*Ваше рандном число*/ + (ProcessorRevision));
  27.     }
  28.     void GetDFSA()
  29.     {
  30.         DFSA _DFSA = 0;
  31.         _DFSA = (DFSA)GetProcAddress(GetModuleHandle("kernel32.dll"), "GetDiskFreeSpaceA");
  32.         float KeyPlus = 1337; /*Ваше рандном число*/
  33.         _DFSA("C:\\", &valueSectorsOnClusters, &bytesOnSector, &freeClusters, &maxClusters);
  34.         dwGetDFSA = (valueSectorsOnClusters *= bytesOnSector *= maxClusters /= 1488 /*Ваше рандном число*/) += KeyPlus;
  35.     }
  36.     int GenKeyLisense()
  37.     {
  38.         GetDFSA();
  39.         GetGSI();
  40.         return dwGetDFSA + dwGetGSI;
  41.     }
  42.     bool CheckLicense(int key)
  43.     {
  44.         bool lic = false;
  45.         for (int i = 0; i < 100500; i++)
  46.         {
  47.             if (UserList[i] == key)
  48.             {
  49.                 lic = true;
  50.                 break;
  51.             }
  52.         }
  53.         return lic;
  54.     }
  55. private:
  56.     SYSTEM_INFO sysinfo;
  57.     typedef BOOL(WINAPI *DFSA)(LPCSTR lpRootPathName, LPDWORD lpSectorsPerCluster, LPDWORD lpBytesPerSector, LPDWORD lpNumberOfFreeClusters, LPDWORD lpTotalNumberOfClusters);
  58.     typedef VOID(WINAPI *GSI)(LPSYSTEM_INFO lpSystemInfo);
  59.  
  60.     //Varriable for gen
  61.     DWORD dwGetDFSA;
  62.     DWORD dwGetGSI;
  63.     //GetDFSA()
  64.     DWORD valueSectorsOnClusters;
  65.     DWORD bytesOnSector;
  66.     DWORD freeClusters;
  67.     DWORD maxClusters;
  68.     //GetGSI()
  69.     DWORD NumberOfProcessors;
  70.     DWORD ProcessorType;
  71.     WORD ProcessorRevision;
  72. };
  73. GenLisenseClass Generation;
  74.  
  75. int main()
  76. {
  77.     system("title Licenser by True_Scamer");
  78.     int you_key = Generation.GenKeyLisense();
  79.     cout << "Your key for license = " << "\"" << you_key << "\"" << endl;
  80.     if (Generation.CheckLicense(you_key))
  81.     {
  82.         cout << "License found" << endl;
  83.         //Тут ваш запуск чита
  84.     }
  85.     else
  86.     {
  87.         cout << "License not found"<<endl;
  88.         //Тут наверное можно сделать выход или вообще пропустить это
  89.     }
  90.     system("PAUSE");
  91.     return 0;
  92. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement