Page 1 of 2 12 LastLast
Results 1 to 15 of 28
  1. #1
    ☆TIS☆'s Avatar
    Join Date
    May 2010
    Gender
    male
    Posts
    89
    Reputation
    10
    Thanks
    26

    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!!

  2. #2
    Blubb1337's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Germany
    Posts
    5,915
    Reputation
    161
    Thanks
    3,108
    [php]If hThread <> Nothing Then
    CloseHandle(hThread)
    End If[/php]

    Working on an injector <> Plain copy & paste.



  3. #3
    ☆TIS☆'s Avatar
    Join Date
    May 2010
    Gender
    male
    Posts
    89
    Reputation
    10
    Thanks
    26
    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

  4. #4
    Blubb1337's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Germany
    Posts
    5,915
    Reputation
    161
    Thanks
    3,108
    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]



  5. #5
    ☆TIS☆'s Avatar
    Join Date
    May 2010
    Gender
    male
    Posts
    89
    Reputation
    10
    Thanks
    26
    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!!

  6. #6
    Blubb1337's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Germany
    Posts
    5,915
    Reputation
    161
    Thanks
    3,108
    Lemme teamview you, cbf to write that all down.



  7. #7
    ☆TIS☆'s Avatar
    Join Date
    May 2010
    Gender
    male
    Posts
    89
    Reputation
    10
    Thanks
    26
    ok 1 minute ill PM you

  8. #8
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    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.

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  9. #9
    ☆TIS☆'s Avatar
    Join Date
    May 2010
    Gender
    male
    Posts
    89
    Reputation
    10
    Thanks
    26
    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

  10. #10
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    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?

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  11. The Following User Says Thank You to Jason For This Useful Post:

    Blubb1337 (10-05-2010)

  12. #11
    ☆TIS☆'s Avatar
    Join Date
    May 2010
    Gender
    male
    Posts
    89
    Reputation
    10
    Thanks
    26
    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..

  13. #12
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    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?

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  14. #13
    ☆TIS☆'s Avatar
    Join Date
    May 2010
    Gender
    male
    Posts
    89
    Reputation
    10
    Thanks
    26
    no.. :-/

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

  15. #14
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    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!

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  16. The Following User Says Thank You to Jason For This Useful Post:

    Hassan (10-05-2010)

  17. #15
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,133
    My Mood
    Dead
    Quote Originally Posted by Jason View Post

    Post that pawned a user /
    This is what I call a pure win !!

Page 1 of 2 12 LastLast

Similar Threads

  1. Injector help - Auto-Inject
    By CheatCreatorzz in forum CrossFire Help
    Replies: 5
    Last Post: 06-30-2011, 03:44 PM
  2. [Help]Auto Inject[Solved]
    By DS45SD in forum Visual Basic Programming
    Replies: 6
    Last Post: 12-04-2010, 06:01 PM
  3. [HELP]Manual/Auto Inject option
    By Klumzy in forum Visual Basic Programming
    Replies: 6
    Last Post: 11-21-2009, 06:14 PM
  4. Injecter help
    By pointbl in forum CrossFire Hacks & Cheats
    Replies: 8
    Last Post: 07-05-2009, 05:47 PM
  5. Injection help
    By Ghost Sniper in forum CrossFire Hacks & Cheats
    Replies: 0
    Last Post: 06-16-2009, 05:00 PM