Auto Inject Help

Posts 1–15 of 28 · Page 1 of 2
Auto Inject Help
Hey Guys, i've been working on a .dll injector/loader and i added the inject code and i keep getting this error..

Code:
Error	1	'IsNot' requires operands that have reference types, but this operand has the value type 'System.IntPtr'.	C:\Users\SimplyUnknown\documents\visual studio 2010\Projects\HC Loader\HC Loader\Class1.vb	64	16	HC Loader
here is the original code >

Code:
Imports System.Collections.Generic
Imports System.Linq
Imports System.Text
Imports System.Diagnostics
Imports System.Runtime.InteropServices
Imports System.Threading


Namespace Injector
	Public Class Inject
		<DllImport("kernel32")> _
		Public Shared Function CreateRemoteThread(hProcess As IntPtr, lpThreadAttributes As IntPtr, dwStackSize As UInteger, lpStartAddress As UIntPtr, lpParameter As IntPtr, dwCreationFlags As UInteger, _
			lpThreadId As IntPtr) As IntPtr
		End Function

		<DllImport("kernel32.dll")> _
		Public Shared Function OpenProcess(dwDesiredAccess As UInt32, bInheritHandle As Int32, dwProcessId As Int32) As IntPtr
		End Function

		<DllImport("kernel32.dll")> _
		Public Shared Function CloseHandle(hObject As IntPtr) As Int32
		End Function

		Private Declare Auto Function VirtualFreeEx Lib "kernel32.dll" (hProcess As IntPtr, lpAddress As IntPtr, dwSize As UIntPtr, dwFreeType As UInteger) As Boolean

		<DllImport("kernel32.dll", CharSet := CharSet.Ansi, ExactSpelling := True)> _
		Public Shared Function GetProcAddress(hModule As IntPtr, procName As String) As UIntPtr
		End Function

		Private Declare Auto Function VirtualAllocEx Lib "kernel32.dll" (hProcess As IntPtr, lpAddress As IntPtr, dwSize As UInteger, flAllocationType As UInteger, flProtect As UInteger) As IntPtr

		<DllImport("kernel32.dll")> _
		Private Shared Function WriteProcessMemory(hProcess As IntPtr, lpBaseAddress As IntPtr, lpBuffer As String, nSize As UIntPtr, lpNumberOfBytesWritten As IntPtr) As Boolean
		End Function

		<DllImport("kernel32.dll", CharSet := CharSet.Auto)> _
		Public Shared Function GetModuleHandle(lpModuleName As String) As IntPtr
		End Function

		Friend Declare Auto Function WaitForSingleObject Lib "kernel32" (handle As IntPtr, milliseconds As Int32) As Int32

		Public Shared Function GetProcessId(proc As [String]) As Int32
			Dim ProcList As Process()
			ProcList = Process.GetProcessesByName(proc)
			Return ProcList(0).Id
		End Function

		Private Shared Function CalcBytes(sToConvert As String) As Byte()
			Dim bRet As Byte() = System.Text.Encoding.ASCII.GetBytes(sToConvert)
			Return bRet
		End Function

		Public Shared Sub InjectDLL(hProcess As IntPtr, strDLLName As [String])
			Dim bytesout As IntPtr
			Dim LenWrite As Int32 = strDLLName.Length + 1
			Dim AllocMem As IntPtr = CType(VirtualAllocEx(hProcess, CType(Nothing, IntPtr), CUInt(LenWrite), &H1000, &H40), IntPtr)
			WriteProcessMemory(hProcess, AllocMem, strDLLName, CType(LenWrite, UIntPtr), bytesout)
			Dim Injector As UIntPtr = CType(GetProcAddress(GetModuleHandle("kernel32.dll"), "LoadLibraryA"), UIntPtr)
			Dim hThread As IntPtr = CType(CreateRemoteThread(hProcess, CType(Nothing, IntPtr), 0, Injector, AllocMem, 0, _
				bytesout), IntPtr)
			Dim Result As Integer = WaitForSingleObject(hThread, 1000)
			Thread.Sleep(1000)
			VirtualFreeEx(hProcess, AllocMem, CType(0, UIntPtr), &H8000)
			If hThread IsNot Nothing Then
				CloseHandle(hThread)
			End If
			Return
		End Sub

	End Class

End Namespace
The whole code has been converted from C# to vb.net via an online tool.. and i get that error, if someone can kindly help me that would be great!!
[php]If hThread <> Nothing Then
CloseHandle(hThread)
End If[/php]

Working on an injector <> Plain copy & paste.
i knew i should have just gone to hack forums at least i got the help there.. its not copy & paste. read the last part

The whole code has been converted from C# to vb.net via an online tool.. and i get that error, if someone can kindly help me that would be great!! by that i mean, i have the project in C# and converting it over to vb.net
1. I helped you above.
2. You just prove that you did copy & paste-

[php]If not x = nothing then
end if[/php]

[php]if x <> nothing then
end if[/php]
i copied it from the convertion tool yea. but not from someone else's work :-/

also could you help me with the last few errors i got from adding the last bits of code ?

1
Code:
Error	1	'Public Event DownloadFileCompleted(sender As Object, e As System.ComponentModel.AsyncCompletedEventArgs)' is an event, and cannot be called directly. Use a 'RaiseEvent' statement to raise an event.	C:\Users\SimplyUnknown\documents\visual studio 2010\Projects\HC Loader\HC Loader\Form2.vb	78	17	HC Loader
2
Code:
Error	2	Delegate 'System.ComponentModel.AsyncCompletedEventHandler' requires an 'AddressOf' expression or lambda expression as the only argument to its constructor.	C:\Users\SimplyUnknown\documents\visual studio 2010\Projects\HC Loader\HC Loader\Form2.vb	78	83	HC Loader
3
Code:
Error	3	'Public Event DownloadProgressChanged(sender As Object, e As System.Net.DownloadProgressChangedEventArgs)' is an event, and cannot be called directly. Use a 'RaiseEvent' statement to raise an event.	C:\Users\SimplyUnknown\documents\visual studio 2010\Projects\HC Loader\HC Loader\Form2.vb	79	17	HC Loader
4
Code:
Error	4	Delegate 'System.Net.DownloadProgressChangedEventHandler' requires an 'AddressOf' expression or lambda expression as the only argument to its constructor.	C:\Users\SimplyUnknown\documents\visual studio 2010\Projects\HC Loader\HC Loader\Form2.vb	79	94	HC Loader
5 ( this one is a warning, not sure if i need to do anything about it! )

Code:
Warning	5	Using DirectCast operator to cast a value-type to the same type is obsolete.	C:\Users\SimplyUnknown\documents\visual studio 2010\Projects\HC Loader\HC Loader\Form2.vb	109	53	HC Loader
Original Code

Code:
If True Then
    Dim path As String = "C:/Program Files/hack.dll"

    If listBox1.SelectedIndex = -1 Then
    MessageBox.Show(selectError)
    ElseIf listBox1.SelectedIndex = 0 Then
    If File.Exists(path) Then
    File.Delete(path)
    End If
    Dim webClient As New WebClient()
    webClient.DownloadFileCompleted += New AsyncCompletedEventHandler(Completed)
    webClient.DownloadProgressChanged += New DownloadProgressChangedEventHandler(ProgressChanged)
    webClient.DownloadFileAsync(New Uri(pubDownload), path)

    Else
    MessageBox.Show(gameNA)
    End If

  End If
Thanks for the help!!
Lemme teamview you, cbf to write that all down.
ok 1 minute ill PM you
I get the sneaking suspicion that you're GTM.

Also, this is leeched. If you can't figure out these small errors where even the slight alteration in syntax between C# and VB.NET shouldn't pose a problem for someone who can so easily inject a DLL into the memory stream by himself .

Oh yeah, change Namespace at the top to Private Class as well.
i am GTM who care's i've had this account longer then you. just never used it

and its not fucking leeched ffs. open you eyes, and READ THE THREAD

i;ve already done this is C# i Private Class Converted it to vb.net using an online tool.. you no things arent the same in vb.net
Quote Originally Posted by TIS2 View Post
i am GTM who care's i've had this account longer then you. just never used it

and its not fucking leeched ffs. open you eyes, and READ THE THREAD

i;ve already done this is C# i Private Class Converted it to vb.net using an online tool.. you no things arent the same in vb.net
C# are both .NET based and apart from some slight syntax differences they are very similar. Also, May comes after April, just thought you should know .

And how does "I converted this from C# to VB.NET using an online converter" <> Leeching the original?

Okay very simple test for you, but no doubt you'll google the answer first

What does "UIntPtr" mean?
your asking me that because i've known vb.net for a whole 2 weeks.. rightt

and the original was mine and a friends, but no longer speak, and was going thru my thumb drive and found it on there. soo..
Quote Originally Posted by TIS2 View Post
your asking me that because i've known vb.net for a whole 2 weeks.. rightt

and the original was mine and a friends, but no longer speak, and was going thru my thumb drive and found it on there. soo..
Umm why are you even bring account creation into this. Also, UIntPtr is common to VB.NET and C#, I thought you were a C# master aren't you?
no.. :-/

who said that, i no C++ thats probley it
Quote Originally Posted by TIS2 View Post
no.. :-/

who said that, i no C++ thats probley it
You said that.

Quote Originally Posted by ☆TIS☆
The whole code has been converted from C# to vb.net via an online tool..
Quote Originally Posted by ☆TIS☆
i copied it from the convertion tool yea. but not from someone else's work :-/
Quote Originally Posted by ☆TIS☆
The whole code has been converted from C# to vb.net via an online tool.. and i get that error, if someone can kindly help me that would be great!! by that i mean, i have the project in C# and converting it over to vb.net

So let me get this straight, you were trying to tell us you didn't leech it when we challenged you, and now you're saying you don't even know C#, contradiction to the max!
Quote Originally Posted by Jason View Post

Post that pawned a user /
This is what I call a pure win !!
Posts 1–15 of 28 · Page 1 of 2
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?