Guest User

Untitled

a guest
Oct 16th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.72 KB | None | 0 0
  1. Public Class Form1
  2. Inherits Form
  3. ' Methods
  4. <DebuggerNonUserCode> _
  5. Shared Sub New()
  6. Public Sub New()
  7. Private Sub AutoInject_Tick(ByVal sender As Object, ByVal e As EventArgs)
  8. Private Sub Button2_Click_1(ByVal sender As Object, ByVal e As EventArgs)
  9. <DllImport("kernel32.dll", SetLastError:=True)> _
  10. Private Shared Function CloseHandle(ByVal hHandle As IntPtr) As Boolean
  11. <DllImport("kernel32.dll")> _
  12. Private Shared Function CreateRemoteThread(ByVal hProcess As IntPtr, ByVal lpThreadAttributes As IntPtr, ByVal dwStackSize As UInt32, ByVal lpStartAddress As IntPtr, ByVal lpParameter As IntPtr, ByVal dwCreationFlags As UInt32, ByVal lpThreadId As IntPtr) As IntPtr
  13. <DebuggerNonUserCode> _
  14. Protected Overrides Sub Dispose(ByVal disposing As Boolean)
  15. Private Sub ElectricButton1_Click_1(ByVal sender As Object, ByVal e As EventArgs)
  16. Private Sub ElectricButton2_Click_1(ByVal sender As Object, ByVal e As EventArgs)
  17. Private Sub ElectricButton3_Click_1(ByVal sender As Object, ByVal e As EventArgs)
  18. Private Sub ElectricButton4_Click(ByVal sender As Object, ByVal e As EventArgs)
  19. Private Sub ElectricMenuButton4_Click_1(ByVal sender As Object, ByVal e As EventArgs)
  20. <DllImport("kernel32.dll", CharSet:=CharSet.Auto, SetLastError:=True)> _
  21. Private Shared Function GetModuleHandle(ByVal lpModuleName As String) As IntPtr
  22. <DllImport("kernel32.dll", CharSet:=CharSet.Ansi, SetLastError:=True, ExactSpelling:=True)> _
  23. Private Shared Function GetProcAddress(ByVal hModule As IntPtr, ByVal procName As String) As IntPtr
  24. <DebuggerStepThrough> _
  25. Private Sub InitializeComponent()
  26. Private Sub Inject(ByVal dllPath As String)
  27. Private Sub ListBox1_SelectedIndexChanged_1(ByVal sender As Object, ByVal e As EventArgs)
  28. Private Sub OpenFileDialog1_FileOk(ByVal sender As Object, ByVal e As CancelEventArgs)
  29. <DllImport("kernel32.dll")> _
  30. Private Shared Function OpenProcess(ByVal dwDesiredAccess As ProcessAccessFlags, <MarshalAs(UnmanagedType.Bool)> ByVal bInheritHandle As Boolean, ByVal dwProcessId As Integer) As IntPtr
  31. <DllImport("kernel32.dll", SetLastError:=True, ExactSpelling:=True)> _
  32. Private Shared Function VirtualAllocEx(ByVal hProcess As IntPtr, ByVal lpAddress As IntPtr, ByVal dwSize As UInt32, ByVal flAllocationType As UInt32, ByVal flProtect As UInt32) As IntPtr
  33. <DllImport("kernel32.dll", SetLastError:=True)> _
  34. Public Shared Function WriteProcessMemory(ByVal hProcess As IntPtr, ByVal lpBaseAddress As IntPtr, ByVal lpBuffer As String, ByVal nSize As UInt32, <Out> ByRef lpNumberOfBytesWritten As Integer) As Boolean
  35.  
  36. ' Properties
  37. Friend Overridable Property AutoInject As Timer
  38. Friend Overridable Property Button2 As Button
  39. Friend Overridable Property ElectricButton1 As ElectricButton
  40. Friend Overridable Property ElectricButton2 As ElectricButton
  41. Friend Overridable Property ElectricButton3 As ElectricButton
  42. Friend Overridable Property ElectricButton4 As ElectricButton
  43. Friend Overridable Property ElectricMenuButton1 As ElectricMenuButton
  44. Friend Overridable Property ElectricMenuButton2 As ElectricMenuButton
  45. Friend Overridable Property ElectricMenuButton3 As ElectricMenuButton
  46. Friend Overridable Property ElectricMenuButton4 As ElectricMenuButton
  47. Friend Overridable Property ElectricTheme1 As ElectricTheme
  48. Friend Overridable Property ListBox1 As ListBox
  49. Friend Overridable Property OpenFileDialog1 As OpenFileDialog
  50. Friend Overridable Property TextBox1 As TextBox
  51. Friend Overridable Property TextBox3 As TextBox
  52.  
  53. ' Fields
  54. Private Shared __ENCList As List(Of WeakReference)
  55. <AccessedThroughProperty("AutoInject")> _
  56. Private _AutoInject As Timer
  57. <AccessedThroughProperty("Button2")> _
  58. Private _Button2 As Button
  59. <AccessedThroughProperty("ElectricButton1")> _
  60. Private _ElectricButton1 As ElectricButton
  61. <AccessedThroughProperty("ElectricButton2")> _
  62. Private _ElectricButton2 As ElectricButton
  63. <AccessedThroughProperty("ElectricButton3")> _
  64. Private _ElectricButton3 As ElectricButton
  65. <AccessedThroughProperty("ElectricButton4")> _
  66. Private _ElectricButton4 As ElectricButton
  67. <AccessedThroughProperty("ElectricMenuButton1")> _
  68. Private _ElectricMenuButton1 As ElectricMenuButton
  69. <AccessedThroughProperty("ElectricMenuButton2")> _
  70. Private _ElectricMenuButton2 As ElectricMenuButton
  71. <AccessedThroughProperty("ElectricMenuButton3")> _
  72. Private _ElectricMenuButton3 As ElectricMenuButton
  73. <AccessedThroughProperty("ElectricMenuButton4")> _
  74. Private _ElectricMenuButton4 As ElectricMenuButton
  75. <AccessedThroughProperty("ElectricTheme1")> _
  76. Private _ElectricTheme1 As ElectricTheme
  77. <AccessedThroughProperty("ListBox1")> _
  78. Private _ListBox1 As ListBox
  79. <AccessedThroughProperty("OpenFileDialog1")> _
  80. Private _OpenFileDialog1 As OpenFileDialog
  81. <AccessedThroughProperty("TextBox1")> _
  82. Private _TextBox1 As TextBox
  83. <AccessedThroughProperty("TextBox3")> _
  84. Private _TextBox3 As TextBox
  85. Private components As IContainer
  86. Private ExeName As String
  87. Private Const MEM_COMMIT As Integer = &H1000
  88. Private Const PAGE_READWRITE As Integer = 4
  89. Private Const PROCESS_ALL_ACCESS As Integer = &H1F0FFF
  90. Private Const TH32CS_SNAPPROCESS As Integer = 2
  91.  
  92. ' Nested Types
  93. <Flags> _
  94. Public Enum ProcessAccessFlags
  95. ' Fields
  96. AllAccess = &H10067B
  97. CreateThread = 2
  98. DuplicateHandle = &H40
  99. QueryInformation = &H400
  100. SetInformation = &H200
  101. Synchronize = &H100000
  102. Terminate = 1
  103. VMOperation = 8
  104. VMRead = &H10
  105. VMWrite = &H20
  106. End Enum
  107. End Class
Add Comment
Please, Sign In to add comment