Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I am in the process of converting the Easyhook c# code into vb.net. At the moment I am getting the error code 5 message and the hooked application is being closed by windows eg to help protect your computer etc. If anyone could help with this then I would be grateful. What I have so far is...</p> <pre><code>Imports EasyHook Imports System Imports System.Diagnostics Imports System.Runtime.Remoting Imports System.Windows.Forms Imports System.Security Imports System.Security.Principal Namespace FileMon Friend Class Program ' Methods Public Shared Sub Main(ByVal args As String()) Dim result As Integer = 0 If ((args.Length &lt;&gt; 1) OrElse Not Integer.TryParse(args(0), result)) Then Console.WriteLine() Console.WriteLine("Usage: FileMon %PID%") Console.WriteLine() Else Try Try Console.WriteLine("Registering Application") Console.WriteLine() Config.Register("A FileMon like demo application.", "FileMon.exe", "FileMonInject.dll") Catch exception1 As ApplicationException Console.WriteLine("This is an administrative task! " &amp; exception1.ToString) Console.WriteLine() Process.GetCurrentProcess.Kill() End Try Console.WriteLine("Creating IPC Server") Console.WriteLine() RemoteHooking.IpcCreateServer(Of FileMonInterface)(Program.ChannelName, WellKnownObjectMode.SingleCall) RemoteHooking.Inject(result, "FileMonInject.dll", "FileMonInject.dll", New Object() {Program.ChannelName}) Console.WriteLine("Injected") Console.WriteLine() Console.ReadLine() Catch exception As Exception Console.WriteLine("There was an error while connecting to target:" &amp; exception.ToString) End Try End If End Sub ' Fields Private Shared ChannelName As String End Class End Namespace </code></pre> <p>and</p> <pre><code>Imports System Namespace FileMon Public Class FileMonInterface Inherits MarshalByRefObject ' Methods Public Sub IsInstalled(ByVal InClientPID As Integer) Console.WriteLine("FileMon has been installed in target " &amp; InClientPID) End Sub Public Sub OnCreateFile(ByVal InClientPID As Integer, ByVal InFileNames As String()) Dim i As Integer For i = 0 To InFileNames.Length - 1 Console.WriteLine(InFileNames(i)) Next i End Sub Public Sub Ping() End Sub Public Sub ReportException(ByVal InInfo As Exception) Console.WriteLine(("The target process has reported an error:" &amp; InInfo.ToString)) End Sub End Class End Namespace </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload