void logResponseVerbose(const char *const ePID, const BYTE *const hwid, const RESPONSE *const response, const PRINTFUNC p) { char guidBuffer[GUID_STRING_LENGTH + 1]; //SYSTEMTIME st; p("Protocol version : %u.%u\n", (uint32_t)LE16(response->MajorVer), (uint32_t)LE16(response->MinorVer)); p("KMS host extended PID : %s\n", ePID); if (LE16(response->MajorVer) > 5) # ifndef _WIN32 p("KMS host Hardware ID : %016llX\n", (unsigned long long)BE64(*(uint64_t*)hwid)); # else // _WIN32 p("KMS host Hardware ID : %016I64X\n", (unsigned long long)BE64(*(uint64_t*)hwid)); # endif // WIN32 uuid2StringLE(&response->CMID, guidBuffer); p("Client machine ID : %s\n", guidBuffer); char mbstr[64]; time_t st; st = fileTimeToUnixTime(&response->ClientTime); strftime(mbstr, sizeof(mbstr), "%Y-%m-%d %X", gmtime(&st)); p("Client request timestamp (UTC) : %s\n", mbstr); p("KMS host current active clients : %u\n", (uint32_t)LE32(response->Count)); p("Renewal interval policy : %u\n", (uint32_t)LE32(response->VLRenewalInterval)); p("Activation interval policy : %u\n", (uint32_t)LE32(response->VLActivationInterval)); }
time_t FileSystemManager::getFileCreationTime(QString filePath) { HANDLE hFile = CreateFile((LPCTSTR) filePath.utf16(), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (hFile) { // Get the file modification time FILETIME fileCreationTime; GetFileTime(hFile, &fileCreationTime, NULL, NULL); CloseHandle(hFile); return fileTimeToUnixTime(fileCreationTime); } return 0; }
void logRequestVerbose(const REQUEST *const Request, const PRINTFUNC p) { char guidBuffer[GUID_STRING_LENGTH + 1]; char WorkstationBuffer[3 * WORKSTATION_NAME_BUFFER]; const char *productName; ProdListIndex_t index; p("Protocol version : %u.%u\n", LE16(Request->MajorVer), LE16(Request->MinorVer)); p("Client is a virtual machine : %s\n", LE32(Request->VMInfo) ? "Yes" : "No"); p("Licensing status : %u (%s)\n", (uint32_t)LE32(Request->LicenseStatus), LE32(Request->LicenseStatus) < _countof(LicenseStatusText) ? LicenseStatusText[LE32(Request->LicenseStatus)] : "Unknown"); p("Remaining time (0 = forever) : %i minutes\n", (uint32_t)LE32(Request->BindingExpiration)); uuid2StringLE(&Request->AppID, guidBuffer); productName = getProductNameLE(&Request->AppID, AppList, getAppListSize(), &index); p("Application ID : %s (%s)\n", guidBuffer, productName); uuid2StringLE(&Request->ActID, guidBuffer); # ifndef NO_EXTENDED_PRODUCT_LIST productName = getProductNameLE(&Request->ActID, ExtendedProductList, getExtendedProductListSize(), &index); # else productName = "Unknown"; # endif p("SKU ID (aka Activation ID) : %s (%s)\n", guidBuffer, productName); uuid2StringLE(&Request->KMSID, guidBuffer); productName = getProductNameLE(&Request->KMSID, ProductList, getProductListSize(), &index); p("KMS ID (aka KMS counted ID) : %s (%s)\n", guidBuffer, productName); uuid2StringLE(&Request->CMID, guidBuffer); p("Client machine ID : %s\n", guidBuffer); uuid2StringLE(&Request->CMID_prev, guidBuffer); p("Previous client machine ID : %s\n", guidBuffer); char mbstr[64]; time_t st; st = fileTimeToUnixTime(&Request->ClientTime); strftime(mbstr, sizeof(mbstr), "%Y-%m-%d %X", gmtime(&st)); p("Client request timestamp (UTC) : %s\n", mbstr); ucs2_to_utf8(Request->WorkstationName, WorkstationBuffer, WORKSTATION_NAME_BUFFER, sizeof(WorkstationBuffer)); p("Workstation name : %s\n", WorkstationBuffer); p("N count policy (minimum clients): %u\n", (uint32_t)LE32(Request->N_Policy)); }