Quote:
Originally Posted by phize
My solution to Keygenme #2 (haven't tried #1, just assumed #2 was harder)
Code:
#include <windows.h>
#include <iostream>
#include <sstream>
#include <string>
#include <iomanip>
std::string GetHardDiskSerial(const std::string& driveLetter)
{
DWORD serialNumber;
GetVolumeInformation(driveLetter.c_str(), NULL, 522, &serialNumber, NULL, NULL, NULL, 0);
std::stringstream ss;
ss << std::hex << std::uppercase << serialNumber;
return ss.str();
}
std::string GenerateSerialNumber(const std::string& hardDiskSerial, const std::string& userName)
{
std::string hddSerial(1, 0);
hddSerial.append(hardDiskSerial);
const int nameLength = userName.length();
const int serialLength = hardDiskSerial.length();
std::ostringstream oss;
for (int i = 0; i < userName.length(); ++i)
{
int index = (i + 1) % serialLength;
int ch = userName[i] ^ hddSerial[index];
oss << std::uppercase << std::hex << std::setfill('0') << std::setw(2) << ch;
ch ^= nameLength;
oss << ch << (i == nameLength - 1 ? "" : "-");
}
return oss.str();
}
int main(int argc, char* argv[])
{
std::cout << GenerateSerialNumber(GetHardDiskSerial("C:\\"), "phize"); // 4441-5E5B-595C-3E3B-5752
return 0;
}
|
Not that I'm doubting you, Can you post a screenshot that it works? :D
On a side note, Try this one.
Rules: All the rules that Ultimation has for his Crackme's + NO Reflector, It's NOT protected, But using reflector makes it too easy try it without. :)
If you use reflector for it, you suck