Skip to content

HL1 Key Algorithm

Featured Replies

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.