Exetools  

Go Back   Exetools > General > Source Code

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 07-19-2015, 05:00
dila dila is offline
Friend
 
Join Date: Jan 2010
Posts: 60
Rept. Given: 12
Rept. Rcvd 32 Times in 14 Posts
Thanks Given: 35
Thanks Rcvd at 74 Times in 20 Posts
dila Reputation: 32
Post Keygenme (Easy?)

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
Reply With Quote
The Following User Gave Reputation+1 to dila For This Useful Post:
mr.exodia (07-19-2015)
The Following 2 Users Say Thank You to dila For This Useful Post:
arnix (07-21-2015), chessgod101 (07-19-2015)
 

Tags
keygenme

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ripping from v0!d keygenme 1 Zeocrack Source Code 4 10-10-2022 04:15
new KeyGenMe sezar21m General Discussion 18 10-16-2013 01:19


All times are GMT +8. The time now is 19:37.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX, chessgod101
( Since 1998 )