Login Register






[help] Process protection Class filter_list
Author
Message
[help] Process protection Class #1
Hi Friends

Need your help i was trying to add a feature process protection it work perfect in framework 4 but when i try in framework 2.0 i am getting error on StopProcessProtection in event handler can u correct me what is wrong
error
Code:
Method 'Private Function StopProcessProtection() As Boolean' does not have the same signature as delegate 'Delegate Sub EventHandler(sender As Object, e As System.EventArgs)'.

Process protection
Code:
Imports System.Runtime.InteropServices Public Class clsProcessProtect <DllImport("ntdll")> _ Private Shared Function NtSetInformationProcess(ByVal hProcess As IntPtr, ByVal processInformationClass As Integer, ByRef processInformation As Integer, ByVal processInformationLength As Integer) As Integer End Function Dim psStop As New EventHandler(AddressOf StopProcessProtection) Const iStop = 0 Const iStart = 1 Const ProcessPriorityClass = 29 Public Sub New() End Sub Public Sub Start() StartProcessProtection(iStart) AddHandler AppDomain.CurrentDomain.ProcessExit, psStop AddHandler AppDomain.CurrentDomain.DomainUnload, psStop AddHandler Application.ApplicationExit, psStop End Sub Private Function StartProcessProtection(ByRef psInfo As Integer) As Boolean Try NtSetInformationProcess(Process.GetCurrentProcess().Handle, ProcessPriorityClass, psInfo, Marshal.SizeOf(psInfo)) Return True Catch ex As Exception MessageBox.Show(ex.Message & vbNewLine & ex.InnerException.ToString()) End Try End Function Private Function StopProcessProtection() As Boolean Try StartProcessProtection(iStop) Catch ex As Exception MessageBox.Show(ex.Message & vbNewLine & ex.InnerException.ToString()) End Try End Function End Class

Even Any one know How to bypass the process protection please share with me i will be thankful to you

Reply

RE: [help] Process protection Class #2
i assume option strict has been set to 'on'

change the declarations of your constants, option strict on requires variable declarations
Code:
Const iStop As Byte = 0 Const iStart As Byte = 1 Const ProcessPriorityClass As Byte = 29

and change your event routine to have the same signature as the evnthandler (as stated by the error):

Code:
Private Function StopProcessProtection(ByVal sender As Object, ByVal e As System.EventArgs) As Boolean Try StartProcessProtection(iStop) Catch ex As Exception MessageBox.Show(ex.Message & vbNewLine & ex.InnerException.ToString()) End Try End Function

Reply

RE: [help] Process protection Class #3
not working Sad i tried by changeling change of your constants,

Reply

RE: [help] Process protection Class #4
did you change the StopProcessProtection signature as well? (see above)

Reply

RE: [help] Process protection Class #5
yeah i tried Sad
give me example Sad i dont know i am just stuck with it from 3 day

Reply

RE: [help] Process protection Class #6
ok, where and when exactly do you get the error? while compiling?
Copied exact as stated, with framework 2.0 and option strict on, got no error at all

Reply

RE: [help] Process protection Class #7
I got error at as same as i have described above
and on option strick on got lots of error
can you team view me and fix i will very thankful and will credit you in project Smile
my skype id - rahulrahul192 and yahoo rahulrhl29@yahoo.com or better to chat on my own Forum isectech.net as 3agl3 3y3 thanx


Reply

RE: [help] Process protection Class #8
I got error at as same as i have described above
and on option strick on got lots of error
can you team view me and fix i will very thankful and will credit you in project Smile
my skype id - rahulrahul192 and yahoo rahulrhl29@yahoo.com or better to chat on my own Forum isectech.net as 3agl3 3y3 thanx


Reply

RE: [help] Process protection Class #9
Sorry for the late answer,
i'd suggest sending me over an example of your solution (by mail or pm) so i can have a look at your issue.
rgds

Reply

RE: [help] Process protection Class #10
Thanx for the reply but my problem solve
I agree my mistake it was not framework problem it was visual basic 2005 when i converted it to visual basic 2008 and target framework at 2.0 it work perfect
but one more big problem some api is detected by avira and t is big pain my ass i search all over net but cant find good solution can u please help me

Code:
<DllImport("kernel32.dll", SetLastError:=True)> _ Public Function FindResource(ByVal hModule As IntPtr, ByVal lpName As String, ByVal lpType As String) As IntPtr End Function
Can any one tell me how to encrypt this api avira detect.
Any help will be thankful.Blush

Reply