Guest User

InjectorResult

a guest
May 24th, 2017
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.30 KB | None | 0 0
  1. using System;
  2. using System.Runtime.InteropServices;
  3.  
  4. namespace Injector
  5. {
  6.     public class InjectorResult
  7.     {
  8.  
  9.         public enum InjectorStatusCode
  10.         {
  11.            
  12.             Success,
  13.             TargetDllNotFound,
  14.             ProcessNotFound,
  15.             OpenThreadFailed,
  16.             RetrieveLoadLibraryFailed,
  17.             AllocationFailed,
  18.             WritePayloadFailed,
  19.             ImpersonationFailed,
  20.             CreateLoadLibraryThreadFailed,
  21.             RevertAfterImpersonationFailed,
  22.             LoadLibraryTimeoutExceeded,
  23.             LoadedRemoteModuleNotFound,
  24.             CreateRemoteRunThreadFailed,
  25.             CouldNotLoadTargetDll,
  26.             ExportedRunMethodNotFound
  27.         }
  28.  
  29.         public InjectorStatusCode Status { get; }
  30.         public IntPtr RemoteLibraryAddress { get; }
  31.         public int LastError { get; }
  32.  
  33.         private InjectorResult()
  34.         {
  35.             LastError = Marshal.GetLastWin32Error();
  36.         }
  37.  
  38.         public InjectorResult(InjectorStatusCode status)
  39.             : this()
  40.         {
  41.             Status = status;
  42.         }
  43.         public InjectorResult(IntPtr remoteLibraryAddress)
  44.             : this(InjectorStatusCode.Success)
  45.         {
  46.             RemoteLibraryAddress = remoteLibraryAddress;
  47.         }
  48.  
  49.     }
  50. }
Add Comment
Please, Sign In to add comment