Dolan Posted October 11, 2013 at 11:46 PM Report #528625 Posted October 11, 2013 at 11:46 PM Bom galera, eu fiz um anti-cheat que detecta um hack pelo MD5. Para pegar o MD5 eu usei esse código no VB: Imports System.Security.Cryptography Public Class Form1 Private Function getFileMd5(ByVal filePath As String) As String Dim File() As Byte = System.IO.File.ReadAllBytes(filePath) Dim Md5 As New MD5CryptoServiceProvider() Dim byteHash() As Byte = Md5.ComputeHash(File) Return Convert.ToBase64String(byteHash) End Function Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Clipboard.SetText(getFileMd5("LOCAL DO CHEAT")) End Sub End Class E quando eu executava o projeto ele deixava na clipboard o MD5 do arquivo. Com esse MD5 eu colocava no meu anti-cheat cujo o código é: Imports System.Diagnostics Imports System.Security.Cryptography Public Class Form1 ' aki ele declara a funçao md5 Private Function getFileMd5(ByVal filePath As String) As String Dim File() As Byte = System.IO.File.ReadAllBytes(filePath) Dim Md5 As New MD5CryptoServiceProvider() Dim byteHash() As Byte = Md5.ComputeHash(File) Return Convert.ToBase64String(byteHash) End Function ' aki ele fecha os hack Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick On Error Resume Next Dim processos As Process() = Process.GetProcesses For Each processo In processos 'cheat engine 6.3 If getFileMd5(processo.MainModule.FileName) = "0qqbsOMiA3jBAi6MlRtz7g==" Then processo.Kill() End If 'teste If getFileMd5(processo.MainModule.FileName) = "CO4Rpb7nk//c/MT3L8Wweg==" Then processo.Kill() End If 'winject v1.7b If getFileMd5(processo.MainModule.FileName) = "XHG/gLKRRSz/IlJGiNOClw==" Then processo.Kill() End If 'mendes v1.1 If getFileMd5(processo.MainModule.FileName) = "fw7RdNv1RWoXMjzOGnoWtw==" Then processo.Kill() End If 'Cheat engine undetected (fire final) If getFileMd5(processo.MainModule.FileName) = "mmZs1hdg56GElT19FF/4Sw==" Then processo.Kill() End If 'player crasher da unknow If getFileMd5(processo.MainModule.FileName) = "qTOQeavGrTcPEGbzozps9Q==" Then processo.Kill() End If 'Ferramenta para alto heal fuhreh basic 0.9 If getFileMd5(processo.MainModule.FileName) = "7zHL2aYrTmsObdEICzMQQQ==" Then processo.Kill() End If 'warz all emulators cooki 1 If getFileMd5(processo.MainModule.FileName) = "bSvJIT0hyKBXAABfBvAkzg==" Then processo.Kill() End If 'warz all emulators cooki 2 If getFileMd5(processo.MainModule.FileName) = "qE8mCRQjrHEpGjLz86DLoQ==" Then processo.Kill() End If 'warz all emulators cooki 3 If getFileMd5(processo.MainModule.FileName) = "IhuZYC0SFkPfby8unyWrhw==" Then processo.Kill() End If 'warz all emulators cooki 4 If getFileMd5(processo.MainModule.FileName) = "V+b492rXkt5OtKLbcn4ZTw==" Then processo.Kill() End If 'gerenciador de tarefas If getFileMd5(processo.MainModule.FileName) = "wahXp7wLv1e2EVynrE4vaw==" Then processo.Kill() End If 'cheat engine 6.2 If getFileMd5(processo.MainModule.FileName) = "iVabqgoTylPfNCz3oMxw/g==" Then processo.Kill() End If 'cheat engine 6.2 ² If getFileMd5(processo.MainModule.FileName) = "cc345d46dedbcb60994618c04c7d1a61" Then processo.Kill() End If Next End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load On Error Resume Next Dim processos As Process() = Process.GetProcesses For Each processo In processos 'If getFileMd5(processo.MainModule.FileName) = "wahXp7wLv1e2EVynrE4vaw==" Then ' 'processo.Kill() ' End If Next Timer1.Start() Timer3.Start() End Sub 'aki ele diz q se fecha o anti cheat fecha o jogo tambem Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing Dim bio() As Process = System.Diagnostics.Process.GetProcessesByName("notepad") For Each jogo As Process In bio jogo.Kill() Next End Sub 'nesse sub ele diz que se fehcar o jogo, o anti cheat fecha tambem Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick Dim TargetProcess As Process() = Process.GetProcessesByName("notepad") If TargetProcess.Length = 0 Then Timer1.Stop() End Else Timer1.Start() End If End Sub ' aki ele se coloca em segundo plano Private Sub Timer3_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer3.Tick Me.Hide() End Sub 'aki ele impede o programa de fechar tanto no x quanto no alt f4 'Protected Overloads Overrides ReadOnly Property CreateParams() As CreateParams ' Get 'Const CP_NOCLOSE_BUTTON As Integer = &H200 'Dim myCp As CreateParams = MyBase.CreateParams ' myCp.ClassStyle = myCp.ClassStyle Or CP_NOCLOSE_BUTTON ' Return myCp '' End Get 'End Property End Class Até ae tudo bem, aqui no meu PC ele executava todas as coisas que eu colocava direitinho, porém quando eu fui passar para meus amigos o anti-cheat fechou vários processos sem eu designar,inclusive o próprio explorer.exe . Eu gostaria de saber o que eu estou errando, e se vocês pudessem eu também gostaria de que alguém me falasse uma solução para esse problema. Desde já grato.
ajcj151 Posted November 20, 2013 at 03:33 AM Report #533885 Posted November 20, 2013 at 03:33 AM Tenta assim: If getFileMd5(processo.MainModule.FileName) = "0qqbsOMiA3jBAi6MlRtz7g==" = True Then processo.Kill() End If Estou desenvolvendo um anti-hack em VB.NET também, caso queira fazer uma parceria poderemos desenvolver juntos um único anti-hack eficiente, boa sorte! 😉
dantas Posted January 22, 2014 at 05:19 AM Report #542068 Posted January 22, 2014 at 05:19 AM (edited) Aconselho a limitar o tamanho de cada arquivo, pois a função getFileMd5 fais obter cada bytes do arquivo e cria o md5, e esse procedimento para arquivos maior que 1mb, consome muito CPU!!! -faça da seguinte maneira. Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick Dim processos As Process() = Process.GetProcesses Try For Each processo In processos 'cheat engine 6.3 If getFileMd5(processo.MainModule.FileName) = "0qqbsOMiA3jBAi6MlRtz7g==" Then processo.Kill() End If Next Catch ex As Exception End Try End Sub Edited January 22, 2014 at 05:22 AM by dantas
Guilherme Santos Posted January 22, 2014 at 03:50 PM Report #542154 Posted January 22, 2014 at 03:50 PM Meu caro amigo,achei bacana voce acompanhar meu canal antigo,mas tem um problema que voce precisa entender. Seu erro está em On Error Resume Next. Por que? Bem,essa declaracao e bem auto explicativa.Se uma parte do metodo gerar uma excecao,ele pula para a proxima etapa. Para obter o caminho de um processo (Filename),voce deve estar com acesso total ao mesmo,coisa que voce nao tem com esse codigo. O seu codigo esta fazendo isso: ---------------------------------- <processo: explorer.exe> { GetFileName, Compare(string), True/Error = Kill (causado pelo On Error Resume Next) } Erro em GetFileName (nao possui acesso total), continue o metodo (Kill) ---------------------------------- Voce tem que ter acesso total ao processo antes de realizar esta operacao.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now