Hi, I made a keygenme for you all to try. I am very interested to see how you solve it. Perhaps it is very easy for you!
Code:
/*
::::::::::::::::::::::
:: Keygenme by dila ::
:: July 2015 ::
::::::::::::::::::::::
*/
#include <iostream>
#include <stdint.h>
uint64_t rol(const uint64_t value, const int places) {
return (value<<places)|(value>>(64-places));
}
uint64_t ror(const uint64_t value, const int places) {
return (value>>places)|(value<<(64-places));
}
bool stringToInteger(const std::string& input, uint64_t* r) {
static const std::string lut = "0123456789abcdef";
if (input.length() == 16) {
*r = 0;
for (size_t i = 0; i < input.length(); ++i) {
size_t digit = lut.find_first_of(input[i]);
if (digit == std::string::npos) {
return false;
}
*r |= digit << (60 - i * 4);
}
return true;
}
return false;
}
uint64_t h0(const std::string& name) {
uint64_t r = ~0x3141592653589793ULL;
for (size_t k = 1; k <= 16; ++k) {
for (size_t i = 0; i < name.length(); ++i) {
int c = (13 + i * k) % 64;
r ^= rol(uint64_t(name[i]), c);
}
}
return r;
}
uint64_t h1(const uint64_t x) {
return x ^ ror(x, 13);
}
bool check(const std::string& name, const std::string& serial) {
uint64_t s;
if (stringToInteger(serial, &s)) {
if (h0(name) == h1(s)) {
return true;
}
}
return false;
}
int main() {
std::string name;
std::cout << "Name: ";
std::getline(std::cin, name);
std::string serial;
std::cout << "Serial: ";
std::getline(std::cin, serial);
if (check(name, serial)) {
std::cout << "Success! Thank you for registering." << std::endl;
} else {
std::cout << "Error. Invalid name/serial combination." << std::endl;
}
return 0;
}
To make sure that it is solvable, I generated one working serial for you:
Code:
Name: exetools
Serial: f7fb22fb6d474cb3