Sinisterly
[help] Process protection Class - Printable Version

+- Sinisterly (https://sinister.li)
+-- Forum: Coding (https://sinister.li/Forum-Coding)
+--- Forum: Visual Basic & .NET Framework (https://sinister.li/Forum-Visual-Basic-NET-Framework)
+--- Thread: [help] Process protection Class (/Thread-help-Process-protection-Class)



[help] Process protection Class - rahul19285 - 09-04-2011

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



RE: [help] Process protection Class - blowdoof - 09-04-2011

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



RE: [help] Process protection Class - rahul19285 - 09-05-2011

not working Sad i tried by changeling change of your constants,


RE: [help] Process protection Class - blowdoof - 09-05-2011

did you change the StopProcessProtection signature as well? (see above)


RE: [help] Process protection Class - rahul19285 - 09-05-2011

yeah i tried Sad
give me example Sad i dont know i am just stuck with it from 3 day


RE: [help] Process protection Class - blowdoof - 09-05-2011

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


RE: [help] Process protection Class - rahul19285 - 09-06-2011

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




RE: [help] Process protection Class - rahul19285 - 09-06-2011

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




RE: [help] Process protection Class - blowdoof - 09-11-2011

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


RE: [help] Process protection Class - rahul19285 - 09-13-2011

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