Usuário com melhor resposta
Duvida como eu faria este programa ?

Pergunta
-
Exemplo pego algum programa "exemplo.exe" e pego a assinatura dele e com essa assinatura unica do programa exemplo.exe faria o seguinte :
Todos os programas que eu pegar esta assinatura não irá fechar após a execulção do anti hacker.exe
As assinaturas que eu não colocar irá fechar após a execulção do anti hacker.exe
Por favor galera me ajudem so falta isso para por o anti hacker online.
Respostas
-
Ai ai... o google ta ai pra pesquisas e é muito facil mas vamos lá entao...
Lista todos processos rodando e add pra uma combobox
' This code assume that you've used the following Imports ' Imports System.Diagnostics. ' Start with an empty ListBox. lstProcesses.Items.Clear() ' Display ProcessName property in the list area. lstProcesses.DisplayMember = "ProcessName" ' Load info on all running processes in the ListBox control. Dim p As Process For Each p In Process.GetProcesses lstProcesses.Items.Add(p) Next
Pega o caminho de cada processo...
Dim processes As System.Diagnostics.Process() processes = System.Diagnostics.Process.GetProcesses Dim process As System.Diagnostics.Process For Each process In processes listProcess.Items.Add(process.ProcessName.ToString + " " + process.Id.ToString + " " + process.MainModule.FileName.ToString) Next
Pega o MD5 Hash do arquivo, que no caso seria a assinatura do arquivo...
' specify the path to a file and this routine will calculate your hash Public Function MD5CalcFile(ByVal filepath As String) As String ' open file (as read-only) Using reader As New System.IO.FileStream(filepath, IO.FileMode.Open, IO.FileAccess.Read) Using md5 As New System.Security.Cryptography.MD5CryptoServiceProvider ' hash contents of this stream Dim hash() As Byte = md5.ComputeHash(reader) ' return formatted hash Return ByteArrayToString(hash) End Using End Using End Function ' utility function to convert a byte array into a hex string Private Function ByteArrayToString(ByVal arrInput() As Byte) As String Dim sb As New System.Text.StringBuilder(arrInput.Length * 2) For i As Integer = 0 To arrInput.Length - 1 sb.Append(arrInput(i).ToString("X2")) Next Return sb.ToString().ToLower End Function
Thiii =)
- Marcado como Resposta Harley AraujoModerator quinta-feira, 20 de setembro de 2012 14:27
Todas as Respostas
-
Etapa 1) Listar todos os processos
Etapa 2) Pegar o caminho de cada executavel
Etapa 3) Pegar a assinatura de cada um executavel e verificar se esta naa sua lista de exclusão, caso sim cancelar processo, e deletar arquivo, caso contrario ignorar...Mini antivirus
Thiii =)
-
-
-
Ai ai... o google ta ai pra pesquisas e é muito facil mas vamos lá entao...
Lista todos processos rodando e add pra uma combobox
' This code assume that you've used the following Imports ' Imports System.Diagnostics. ' Start with an empty ListBox. lstProcesses.Items.Clear() ' Display ProcessName property in the list area. lstProcesses.DisplayMember = "ProcessName" ' Load info on all running processes in the ListBox control. Dim p As Process For Each p In Process.GetProcesses lstProcesses.Items.Add(p) Next
Pega o caminho de cada processo...
Dim processes As System.Diagnostics.Process() processes = System.Diagnostics.Process.GetProcesses Dim process As System.Diagnostics.Process For Each process In processes listProcess.Items.Add(process.ProcessName.ToString + " " + process.Id.ToString + " " + process.MainModule.FileName.ToString) Next
Pega o MD5 Hash do arquivo, que no caso seria a assinatura do arquivo...
' specify the path to a file and this routine will calculate your hash Public Function MD5CalcFile(ByVal filepath As String) As String ' open file (as read-only) Using reader As New System.IO.FileStream(filepath, IO.FileMode.Open, IO.FileAccess.Read) Using md5 As New System.Security.Cryptography.MD5CryptoServiceProvider ' hash contents of this stream Dim hash() As Byte = md5.ComputeHash(reader) ' return formatted hash Return ByteArrayToString(hash) End Using End Using End Function ' utility function to convert a byte array into a hex string Private Function ByteArrayToString(ByVal arrInput() As Byte) As String Dim sb As New System.Text.StringBuilder(arrInput.Length * 2) For i As Integer = 0 To arrInput.Length - 1 sb.Append(arrInput(i).ToString("X2")) Next Return sb.ToString().ToLower End Function
Thiii =)
- Marcado como Resposta Harley AraujoModerator quinta-feira, 20 de setembro de 2012 14:27