• Welcome to ForumKorner!
    Join today and become a part of the community.

[Tutorial]How to make a basic login with offline Hwid[Tutorial]

djfshady

Member
Reputation
0
If you are going to post this anywhere else remember to give credits to me
Hello, In this tutorial i will show you how to make a basic login with off line hwid.

What you will need:
4 Labels
2 Edit Boxes
1 Button

Setting up the application layout:

First we will need to add our labels which can be found here:
148zymu.jpg

Next we will need to add our edit boxes which is located here:
sdzg5e.jpg

Finally we will need to add our button which is found here:
6r7nrk.jpg

Now your application should look similar to this:
2wcmow9.jpg


Renaming:

To Rename as label1 click it once and go to the side panel and edit the text to 'User name:'
2yx583m.jpg

Now do the same for label2 but instead change the text to 'Password:'
1474b9.jpg

Now do the same for label3 but change the name to 'Your Hwid:'
16bncm1.jpg

Next remove the text from label4 and place it next to label 3 like so:
wslb2p.jpg

Finally click Button1 and go to the side panel and change the text to 'Login'
2c0qe0.jpg



Your application should now look like this:
2dkh2e.jpg



Adding the code to the application:

Now we will need to double click our Button and type in the following code:
Code:
If (edit1.text = 'user') and (edit2.Text = 'password') then
begin
If GetHwid() = 'Your Hwid Here' then
form2.Show
else
application.terminate;
end;
end;
157vwp.jpg

Next we will need to add the function to do this add the following code under here:

Code:
function getHWID(): String;
var
SerialNum,A,B: DWord;
C: array [0..255] of Char;
Buffer: array [0..255] of Char;
begin
if GetVolumeInformation(pChar('C:\'), Buffer, 256, @SerialNum, A, B, C, 256) then
  Result := inttostr(SerialNum * Cardinal(-1))
else Result := '';
end;
2mf0imv.jpg

Finally double click your form and add the following code into it:
Code:
Label4.Caption := getHWID();[code]
[IMG]http://shadyshosting.com/Delphi/Login With Offline HWID Tut/348r7us.jpg[/IMG]

Now add another form you can do so by going here:
[IMG]http://shadyshosting.com/Delphi/Login With Offline HWID Tut/lz874.jpg[/IMG]

Finally lets test the program what should happen is all will be fine until they click login and then it will check to see if there Hwid is valid to the one stored in the program if it is then form2 will show but if it isn't then the application will terminate.

Hope you enjoyed my tutorial.
 
Top