Results 1 to 11 of 11
  1. #1
    Nitehawk772's Avatar
    Join Date
    Jan 2011
    Gender
    male
    Location
    Downtown.
    Posts
    5,284
    Reputation
    111
    Thanks
    636
    My Mood
    Amazed

    Injector Code Error

    Hello members of the Visual Basic Section. I come to you today asking for help with 2 errors I keep getting trying to make my personal Injector, Hawk Inject V1.4. Any help would be greatly appreciated.

    Below is the section of code that both errors are in.


    Code:
    Public Class Form1
        Dim dlls As New Dictionary(Of String, String)
    
        Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Integer, ByVal bInheritHandle As Integer, ByVal dwProcessId As Integer) As Integer
        Private Declare Function VirtualAllocEx Lib "kernel32" (ByVal hProcess As Integer, ByVal lpAddress As Integer, ByVal dwSize As Integer, ByVal flAllocationType As Integer, ByVal flProtect As Integer) As Integer
        Private Declare Function WriteProcessMemory Lib "kernel32" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByVal lpBuffer() As Byte, ByVal nSize As Integer, ByVal lpNumberOfBytesWritten As UInteger) As Boolean
        Private Declare Function GetProcAddress Lib "kernel32" (ByVal hModule As Integer, ByVal lpProcName As String) As Integer
        Private Declare Function GetModuleHandle Lib "kernel32" Alias "GetModuleHandleA" (ByVal lpModuleName As String) As Integer
        Private Declare Function CreateRemoteThread Lib "kernel32" (ByVal hProcess As Integer, ByVal lpThreadAttributes As Integer, ByVal dwStackSize As Integer, ByVal lpStartAddress As Integer, ByVal lpParameter As Integer, ByVal dwCreationFlags As Integer, ByVal 
    
    lpThreadId As Integer) As Integer
        Private Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Integer, ByVal dwMilliseconds As Integer) As Integer
        Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Integer) As Integer

    The first error highlights the 'l' on the very last 'ByVal'. The error reads, 'Identifier Expected'


    Code:
    Private Declare Function CreateRemoteThread Lib "kernel32" (ByVal hProcess As Integer, ByVal lpThreadAttributes As Integer, ByVal dwStackSize As Integer, ByVal lpStartAddress As Integer, ByVal lpParameter As Integer, ByVal dwCreationFlags As Integer, ByVal

    The second error highlights the first command 'IpThreadId'.
    The error reads, 'Declaration Expected'.



    Code:
    lpThreadId As Integer) As Integer
        Private Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Integer, ByVal dwMilliseconds As Integer) As Integer
        Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Integer) As Integer
    Last edited by Nitehawk772; 11-06-2011 at 01:59 PM.

  2. #2
    If ℜul℮s doηt b℮ηd, th℮y ฿r℮αk.
    Donator
    DarkByte7's Avatar
    Join Date
    Oct 2011
    Gender
    male
    Location
    n/a
    Posts
    368
    Reputation
    24
    Thanks
    368
    My Mood
    Cynical
    Replace your last 3 lines of code with these:
    Code:
    Public Declare Function CreateRemoteThread Lib "kernel32" (ByVal hProcess As Integer, ByVal lpThreadAttributes As Integer, ByVal dwStackSize As Integer, ByVal lpStartAddress As Integer, ByVal lpParameter As Integer, ByVal dwCreationFlags As Integer, ByVal lpThreadId As Integer) As Integer
    Public Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Integer, ByVal dwMilliseconds As Integer) As Integer
    Public Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Integer) As Integer

  3. The Following User Says Thank You to DarkByte7 For This Useful Post:

    Nitehawk772 (11-06-2011)

  4. #3
    Nitehawk772's Avatar
    Join Date
    Jan 2011
    Gender
    male
    Location
    Downtown.
    Posts
    5,284
    Reputation
    111
    Thanks
    636
    My Mood
    Amazed
    Quote Originally Posted by GreenLighting View Post
    Replace your last 3 lines of code with these:
    Code:
    Public Declare Function CreateRemoteThread Lib "kernel32" (ByVal hProcess As Integer, ByVal lpThreadAttributes As Integer, ByVal dwStackSize As Integer, ByVal lpStartAddress As Integer, ByVal lpParameter As Integer, ByVal dwCreationFlags As Integer, ByVal lpThreadId As Integer) As Integer
    Public Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Integer, ByVal dwMilliseconds As Integer) As Integer
    Public Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Integer) As Integer
    The last 3 lines of the larger portion of code?

  5. #4
    If ℜul℮s doηt b℮ηd, th℮y ฿r℮αk.
    Donator
    DarkByte7's Avatar
    Join Date
    Oct 2011
    Gender
    male
    Location
    n/a
    Posts
    368
    Reputation
    24
    Thanks
    368
    My Mood
    Cynical
    Quote Originally Posted by Nitehawk772 View Post

    The last 3 lines of the larger portion of code?
    Here I just did the entire thing for you. Try that hope that works. If it doesn't feel free to ask if you have more questions.
    Code:
    Public Class Form1
    Dim dlls As New Dictionary(Of String, String)
    
    Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Integer, ByVal bInheritHandle As Integer, ByVal dwProcessId As Integer) As Integer
    Private Declare Function VirtualAllocEx Lib "kernel32" (ByVal hProcess As Integer, ByVal lpAddress As Integer, ByVal dwSize As Integer, ByVal flAllocationType As Integer, ByVal flProtect As Integer) As Integer
    Private Declare Function WriteProcessMemory Lib "kernel32" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByVal lpBuffer() As Byte, ByVal nSize As Integer, ByVal lpNumberOfBytesWritten As UInteger) As Boolean
    Private Declare Function GetProcAddress Lib "kernel32" (ByVal hModule As Integer, ByVal lpProcName As String) As Integer
    Private Declare Function GetModuleHandle Lib "kernel32" Alias "GetModuleHandleA" (ByVal lpModuleName As String) As Integer
    Private Declare Function CreateRemoteThread Lib "kernel32" (ByVal hProcess As Integer, ByVal lpThreadAttributes As Integer, ByVal dwStackSize As Integer, ByVal lpStartAddress As Integer, ByVal lpParameter As Integer, ByVal dwCreationFlags As Integer, ByVal lpThreadId As Integer) As Integer
    Private Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Integer, ByVal dwMilliseconds As Integer) As Integer
    Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Integer) As Integer

  6. The Following User Says Thank You to DarkByte7 For This Useful Post:

    Nitehawk772 (11-06-2011)

  7. #5
    Nitehawk772's Avatar
    Join Date
    Jan 2011
    Gender
    male
    Location
    Downtown.
    Posts
    5,284
    Reputation
    111
    Thanks
    636
    My Mood
    Amazed
    Quote Originally Posted by GreenLighting View Post
    Here I just did the entire thing for you. Try that hope that works. If it doesn't feel free to ask if you have more questions.
    Code:
    Public Class Form1
    Dim dlls As New Dictionary(Of String, String)
    
    Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Integer, ByVal bInheritHandle As Integer, ByVal dwProcessId As Integer) As Integer
    Private Declare Function VirtualAllocEx Lib "kernel32" (ByVal hProcess As Integer, ByVal lpAddress As Integer, ByVal dwSize As Integer, ByVal flAllocationType As Integer, ByVal flProtect As Integer) As Integer
    Private Declare Function WriteProcessMemory Lib "kernel32" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByVal lpBuffer() As Byte, ByVal nSize As Integer, ByVal lpNumberOfBytesWritten As UInteger) As Boolean
    Private Declare Function GetProcAddress Lib "kernel32" (ByVal hModule As Integer, ByVal lpProcName As String) As Integer
    Private Declare Function GetModuleHandle Lib "kernel32" Alias "GetModuleHandleA" (ByVal lpModuleName As String) As Integer
    Private Declare Function CreateRemoteThread Lib "kernel32" (ByVal hProcess As Integer, ByVal lpThreadAttributes As Integer, ByVal dwStackSize As Integer, ByVal lpStartAddress As Integer, ByVal lpParameter As Integer, ByVal dwCreationFlags As Integer, ByVal lpThreadId As Integer) As Integer
    Private Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Integer, ByVal dwMilliseconds As Integer) As Integer
    Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Integer) As Integer
    [IMG]https://i1198.photobucke*****m/albums/aa459/nitehawk772/Untitled12321321.png[/IMG]

    Thanks but it's still not working.

  8. #6
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Learn to read, and fix your own errors. I can understand with complicated errors but seriously. Your only problem in the original code you posted was that you had a linebreak in the original declaration, which should be obvious as hell. In the image you just posted, READ THE ERROR. You have declared CreateRemoteThread multiple times.

    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. #7
    Nitehawk772's Avatar
    Join Date
    Jan 2011
    Gender
    male
    Location
    Downtown.
    Posts
    5,284
    Reputation
    111
    Thanks
    636
    My Mood
    Amazed
    Quote Originally Posted by Jason View Post
    Learn to read, and fix your own errors. I can understand with complicated errors but seriously. Your only problem in the original code you posted was that you had a linebreak in the original declaration, which should be obvious as hell. In the image you just posted, READ THE ERROR. You have declared CreateRemoteThread multiple times.
    I'm a very new coder. I'm in the process of learning VB so I don't know.

    Do I have to delete 'CreateRemoteThread' and replace it with something else that has the same meaning?
    Last edited by Nitehawk772; 11-07-2011 at 06:22 AM.

  10. #8
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    No, you have to learn the basics before you start leeching injectors. I get very frustrated very quickly with people who just don't care about learning and wanna leech an injector etc.

    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. #9
    Nitehawk772's Avatar
    Join Date
    Jan 2011
    Gender
    male
    Location
    Downtown.
    Posts
    5,284
    Reputation
    111
    Thanks
    636
    My Mood
    Amazed
    Quote Originally Posted by Jason View Post
    No, you have to learn the basics before you start leeching injectors. I get very frustrated very quickly with people who just don't care about learning and wanna leech an injector etc.
    I know all the other code I just don't know the actual code to inject the .DLL into the process.

  12. #10
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    So basically, you don't know the code. If you can't even write out a simple API declaration then I don't really believe you. There is a sticky at the top of this forum which provides you with pretty much C+P'able injection source code.

    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)

  13. #11
    SecretDataz's Avatar
    Join Date
    Oct 2011
    Gender
    male
    Posts
    31
    Reputation
    10
    Thanks
    11
    My Mood
    Asleep
    Code:
        Public Declare Function CreateRemoteThread Lib "kernel32" ( _
        ByVal hProcess As Integer, _
        ByVal lpThreadAttributes As Integer, _
        ByVal dwStackSize As Integer, _
        ByVal lpStartAddress As Integer, _
        ByVal lpParameter As Integer, _
        ByVal dwCreationFlags As Integer, _
        ByRef lpThreadId As Integer) As Integer

  14. The Following User Says Thank You to SecretDataz For This Useful Post:

    Nitehawk772 (11-10-2011)

Similar Threads

  1. Hack not working, code error I think
    By myonemanga in forum C++/C Programming
    Replies: 2
    Last Post: 01-07-2010, 09:57 AM
  2. VB INJECTOR CODE
    By asdf12345678 in forum Visual Basic Programming
    Replies: 16
    Last Post: 11-02-2009, 03:26 PM
  3. Ugleh's Injector Cancel Error fix
    By Ugleh in forum Visual Basic Programming
    Replies: 2
    Last Post: 09-29-2009, 09:10 PM
  4. Replies: 17
    Last Post: 05-10-2009, 05:26 PM
  5. > KWR KSSN code error <
    By gameking57 in forum WarRock Korea Hacks
    Replies: 8
    Last Post: 08-23-2007, 04:03 PM