Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › Programming › Visual Basic Programming › Auto Inject Help

Auto Inject Help

Posts 1–15 of 28 · Page 1 of 2
☆T
☆TIS☆
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!!
#1 · 15y ago
Blubb1337
Blubb1337
[php]If hThread <> Nothing Then
CloseHandle(hThread)
End If[/php]

Working on an injector <> Plain copy & paste.
#2 · 15y ago
☆T
☆TIS☆
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
#3 · 15y ago
Blubb1337
Blubb1337
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]
#4 · 15y ago
☆T
☆TIS☆
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!!
#5 · 15y ago
Blubb1337
Blubb1337
Lemme teamview you, cbf to write that all down.
#6 · 15y ago
☆T
☆TIS☆
ok 1 minute ill PM you
#7 · 15y ago
Jason
Jason
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.
#8 · 15y ago
☆T
☆TIS☆
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
#9 · 15y ago
Jason
Jason
Quote Originally Posted by ☆TIS☆ 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?
#10 · 15y ago
☆T
☆TIS☆
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..
#11 · 15y ago
Jason
Jason
Quote Originally Posted by ☆TIS☆ 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?
#12 · 15y ago
☆T
☆TIS☆
no.. :-/

who said that, i no C++ thats probley it
#13 · 15y ago
Jason
Jason
Quote Originally Posted by ☆TIS☆ 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!
#14 · 15y ago
Hassan
Hassan
Quote Originally Posted by Jason View Post

Post that pawned a user /
This is what I call a pure win !!
#15 · 15y ago
Posts 1–15 of 28 · Page 1 of 2

Post a Reply

Similar Threads

  • [HELP]Manual/Auto Inject optionBy Klumzy in Visual Basic Programming
    6Last post 16y ago
  • [Help]Auto Inject[Solved]By DS45SD in Visual Basic Programming
    6Last post 15y ago
  • Injector help - Auto-InjectBy CheatCreatorzz in CrossFire Help
    5Last post 15y ago
  • Injection helpBy Ghost Sniper in CrossFire Hacks & Cheats
    0Last post 17y ago
  • Injecter helpBy pointbl in CrossFire Hacks & Cheats
    8Last post 17y ago

Tags for this Thread

None