Posted January 26, 200619 yr Form1: Private Sub Command1_Click() Select Case Combo1.Text Case "Battlefield 2" SaveString HKEY_LOCAL_MACHINE, "SOFTWARE\Electronic Arts\EA Games\Battlefield 2", "ergc", "x9392" & Text1.Text MsgBox "CD KEY SUCCESSFULLY CHANGED TO " & Text1.Text & "!", vbOKOnly, "SUCCESS!" Case "Battlefield 2: Special Forces" SaveString HKEY_LOCAL_MACHINE, "SOFTWARE\Electronic Arts\EA Games\Battlefield 2", "ergc", "x9392" & Text1.Text MsgBox "CD KEY SUCCESSFULLY CHANGED TO " & Text1.Text & "!", vbOKOnly, "SUCCESS!" 'lol just found out it dont fuckin matter oh well cases rwn End Select End Sub Private Sub Form_Load() Combo1.AddItem "Battlefield 2" Combo1.AddItem "Battlefield 2: Special Forces" End Sub Module: Public Enum RegistryKeys HKEY_CLASSES_ROOT = &H80000000 HKEY_CURRENT_USER = &H80000001 HKEY_LOCAL_MACHINE = &H80000002 HKEY_USERS = &H80000003 HKEY_CURRENT_CONFIG = &H80000005 HKEY_DYN_DATA = &H80000006 End Enum Public Const HKEY_PERFORMANCE_DATA = &H80000004 Public Const ERROR_SUCCESS = 0& Public Const REG_SZ = 1 Public Const REG_DWORD = 4 Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long Declare Function RegCreateKey Lib "advapi32.dll" Alias "RegCreateKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long Declare Function RegDeleteKey Lib "advapi32.dll" Alias "RegDeleteKeyA" (ByVal hKey As Long, ByVal lpSubKey As String) As Long Declare Function RegDeleteValue Lib "advapi32.dll" Alias "RegDeleteValueA" (ByVal hKey As Long, ByVal lpValueName As String) As Long Declare Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long Declare Function RegQueryValueEx Lib "advapi32.dll" Alias "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, lpType As Long, lpData As Any, lpcbData As Long) As Long Declare Function RegSetValueEx Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, lpData As Any, ByVal cbData As Long) As Long Public Sub SaveKey(ByVal hKey As RegistryKeys, ByVal strPath As String) On Error Resume Next Dim KeyHand As Long RegCreateKey hKey, strPath, KeyHand RegCloseKey KeyHand End Sub Public Function DeleteKey(ByVal hKey As RegistryKeys, ByVal strKey As String) On Error Resume Next RegDeleteKey hKey, strKey End Function Public Function DeleteValue(ByVal hKey As RegistryKeys, ByVal strPath As String, ByVal strValue As String) On Error Resume Next Dim KeyHand As Long RegOpenKey hKey, strPath, KeyHand RegDeleteValue KeyHand, strValue RegCloseKey KeyHand End Function Public Function GetString(ByVal hKey As RegistryKeys, ByVal strPath As String, ByVal strValue As String) As String On Error Resume Next Dim KeyHand As Long Dim datatype As Long Dim lResult As Long Dim strBuf As String Dim lDataBufSize As Long Dim intZeroPos As Integer Dim lValueType As Long RegOpenKey hKey, strPath, KeyHand lResult = RegQueryValueEx(KeyHand, strValue, 0&, lValueType, ByVal 0&, lDataBufSize) If lValueType = REG_SZ Then strBuf = String(lDataBufSize, " ") lResult = RegQueryValueEx(KeyHand, strValue, 0&, 0&, ByVal strBuf, lDataBufSize) If lResult = ERROR_SUCCESS Then intZeroPos = InStr(strBuf, Chr(0)) If intZeroPos > 0 Then GetString = Left(strBuf, intZeroPos - 1) Else GetString = strBuf End If End If End If End Function Public Sub SaveString(ByVal hKey As RegistryKeys, ByVal strPath As String, ByVal strValue As String, ByVal strData As String) On Error Resume Next Dim KeyHand As Long RegCreateKey hKey, strPath, KeyHand RegSetValueEx KeyHand, strValue, 0, REG_SZ, ByVal strData, Len(strData) RegCloseKey KeyHand End Sub Function GetDWORD(ByVal hKey As RegistryKeys, ByVal strPath As String, ByVal strValueName As String) As Long On Error Resume Next Dim lResult As Long Dim lValueType As Long Dim lBuf As Long Dim lDataBufSize As Long Dim KeyHand As Long RegOpenKey hKey, strPath, KeyHand lDataBufSize = 4 lResult = RegQueryValueEx(KeyHand, strValueName, 0&, lValueType, lBuf, lDataBufSize) If lResult = ERROR_SUCCESS Then If lValueType = REG_DWORD Then GetDWORD = lBuf End If End If RegCloseKey KeyHand End Function Function SaveDWORD(ByVal hKey As RegistryKeys, ByVal strPath As String, ByVal strValueName As String, ByVal lData As Long) On Error Resume Next Dim lResult As Long Dim KeyHand As Long RegCreateKey hKey, strPath, KeyHand lResult = RegSetValueEx(KeyHand, strValueName, 0&, REG_DWORD, lData, 4) RegCloseKey KeyHand End Function lol ^_____^ btw the module is just to mod the registry, if you have your own just use that.
January 26, 200619 yr im sure you could make an API to auto launch the keygens and have them copy the text from the generated fields, I could do that if you wanted... Should I, been a while since I messed w/ API's but I can give it a try edit also your program does SaveString HKEY_LOCAL_MACHINE, "SOFTWARE\Electronic Arts\EA Games\Battlefield 2", "ergc", "x9392" & Text1.Text there is also that same key in HKEY_LOCAL_MACHINE, "SOFTWARE\Electronic Arts\EA Games\Battlefield 2\ergc\ I don't know if you need to do both.. And do we not need to do special forceS?
January 26, 200619 yr Author And do we not need to do special forceS? yeah i discovered that while making it that it wasnt needed at all lmao.