<DllImport("kernel32", CharSet:=CharSet.Auto, SetLastError:=True)>
Private Shared Function GetProcAddress(
ByVal ModuleHandle As IntPtr,
ByVal ProcName As String) As IntPtr
End Function
<DllImport("kernel32", CharSet:=CharSet.Auto, SetLastError:=True)>
Private Shared Function GetModuleHandle(
[SIZE=3][font=Monaco, Consolas, Courier, monospace]ByVal lpModuleName[/font][/SIZE][SIZE=3][font=Monaco, Consolas, Courier, monospace] As String[/font][/SIZE]) As IntPtr
End Function
<DllImport("kernel32", CharSet:=CharSet.Auto, SetLastError:=True)>
Private Shared Function WriteProcessMemory(
ByVal hProcess As IntPtr,
ByVal lpBaseAddress As IntPtr,
ByVal lpBuffer As Byte(),
ByVal nSize As UInteger,
ByRef lpNumberOfBytesWritten As UInt32) As Boolean
End Function
Public Sub AntiDll()
Dim LoadLibraryA As IntPtr = CType(GetProcAddress(CInt(GetModuleHandle("kernel32")), "LoadLibraryA"), IntPtr)
Dim LoadLibraryW As IntPtr = CType(GetProcAddress(CInt(GetModuleHandle("kernel32")), "LoadLibraryW"), IntPtr)
If LoadLibraryA <> IntPtr.Zero Then WriteProcessMemory(Process.GetCurrentProcess.Handle, LoadLibraryA, New Byte() {&HC2, &H4, &H0, &H90}, 4, 0)
If LoadLibraryW <> IntPtr.Zero Then WriteProcessMemory(Process.GetCurrentProcess.Handle, LoadLibraryW, New Byte() {&HC2, &H4, &H0, &H90}, 4, 0)
End Sub