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++

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...