Jump to content

Recommended Posts

Posted

HL1 Key Algorithm a tutorial example on how to build the algorithm to your hl (half life keygen) in C++

 
/*
The following is the simple algorithm used by Half-Life to know if a CD-Key is
valid or not.

by Luigi Auriemma
e-mail: aluigi@autistici.org
web: aluigi.org

*/

unsigned char cdkey[], /* buffer that contains the Half-life CD-KEY */
/* the key must be 13 bytes long and all the */
/* '-' chars must be removed */
*ptr; // a pointer for faster operations
unsigned long eax,
edx,
edi,
i; // counter

eax = 3;
ptr = cdkey;
for(i = 0; i < 12; i++, ptr++) {
edi = eax << 1;
edx = *ptr - 0x30; // char '0'
edx ^= edi;
eax += edx;
}
eax %= 10;
eax -= *ptr;
if(eax == 0xFFFFFFD0) fputs("CD-Key is OK!\n", stdout);
else fputs("CD-Key is invalid\n", stdout);

So for those who didn't understood, basically this tutorial is on how to build a hl1 key algorithm to make your hl keygen in C++

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..