NOTE: I AM USING VISUAL STUDIO 2012, I AM COMPILING A FORM APPLICATION IN VISUAL BASIC
Hey guys.
Today I'm going to show all of you lovely people how to make Dayz Warez and Program's, You might be wondering, What is this? What will I be learning to make, before I start let me state what I'm going to show you how to do here. I'm going to show you:
- How to make a Simple Dayz Key Changer.
Making a Dayz Keychanger:
What your Finished product will look like
What your going to need.
- Visual Studio 2012
- Dayz (Of Course)
- Administrator Rights
First. Open up a fresh VB.net project, The language we are going to work in is going to be Visual Basic. When launched up you should see this.
Your going to need a Textbox, A Label and a button.
Change the name of the button to "Change CD Key". Then position it where you want, then put the textbox where the user enters there key just above that button, then put the label just above the Textbox, this will display your current CD Key.
Where going to start with the easy thing first, which is showing your current CD Key, this is easy as it does not require much code.
Dayz CD Keys are in a Hexadecimal arrangement, You have to tell Visual Studio 2012 to recognize this. This can be done like this:
Code:
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim regkey As Byte()
regkey = Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Bohemia Interactive Studio\ArmA 2 OA", "Key", Nothing)
Dim byteArray As String = BitConverter.ToString(DirectCast(regkey, Byte()))
Label4.Text = byteArray
End Sub
This is the complete GetKey Code, this can be used for other purposes.
Code:
Dim regkey As Byte()
We have to class Regkey as a byte for the conversion to work.
Code:
regkey = Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Bohemia Interactive Studio\ArmA 2 OA", "Key", Nothing)
Second Version:
Code:
regkey = Microsoft.Win32.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Bohemia Interactive Studio\ArmA 2 OA", "Key", Nothing)
Defining what RegKey is = too. For this we make RegKey the Registry key we want to get, which in this case is a Dayz key.
Code:
Dim byteArray As String = BitConverter.ToString(DirectCast(regkey, Byte()))
We make Visual Studio Convert the bits into a string.
Code:
Label4.Text = byteArray
Then make our Label display our CD Key!
If everything was followed correctly you should be seeing this!
Now, We have to code the Change Key Method! Which is quite tricky! So Pay Attention!
This is what the working code looks like.
Code:
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim data As String = TextBox1.Text
Dim regk As Microsoft.Win32.RegistryKey
regk = Microsoft.Win32.Registry.CurrentUser.CreateSubKey("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Bohemia Interactive Studio\ArmA 2 OA")
regk.SetValue("key", Byte.Parse(data), RegistryValueKind.Binary)
End Sub
Now, I'll explain each part.
Code:
Dim data As String = TextBox1.Text
Tell VS that the date entered from textbox1.text is a String.
Code:
Dim regk As Microsoft.Win32.RegistryKey
Telling VS that RegK is a Microsoft.win32.registrykey is a Registry Key, this is used for conversion.
Code:
regk = Microsoft.Win32.Registry.CurrentUser.CreateSubKey("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Bohemia Interactive Studio\ArmA 2 OA")
Telling VS to get the registry location.
Code:
regk.SetValue("key", Byte.Parse(data), RegistryValueKind.Binary)
Setting the Data from the textbox1.text and making it into a Binary kind.
Converting to Binary Kind is very important, Arma2OA Reads its hexadecimal key in Binary Form, if you don't convert it will fail to read it!
Now your key has been changed into the correct format!
You are done! You have created your first KeyChanger for Dayz! I hope your Happy with your self, now go outside and find something else to do.
I'll do a tutorial for c# users later.