Results 1 to 12 of 12
  1. #1
    NightmareTX_RETIRED's Avatar
    Join Date
    Apr 2011
    Gender
    male
    Posts
    1,240
    Reputation
    57
    Thanks
    15,075
    My Mood
    Fine

    Lightbulb [VB.Net Tutorial]Add a Flicker-less Overlay to your Project

    First of all, this will only work in games that allows Windowed Mode or Windowed (No border) Mode. Do not forget to save your project often in any case of unwanted situations. Let's Start!

    -Step 1: The Basic-

    Step 1:

    Once your project is open, click on "Project" then "Add Windows Form". Give it a name and press "Add".

    Step 2:

    Click on "Project" then "Add Module". Name it "Overlay" then click "Add"

    Step 3:

    Double click on your Overlay Module and replace all code with this one (Base off the code by Stefsot)

    Code:
    Imports System.Runtime.InteropServices
    Imports System.Net.Mail
    Imports System.Text
    Public Module Overlay
        Public Structure RECT
            Public Left As Integer
            Public Top As Integer
            Public Right As Integer
            Public Bottom As Integer
        End Structure
        Public window_loc As RECT
        Public screencenter(1) As Integer
        <DllImport("user32.dll")> _
        Public Function GetWindowRect(ByVal hWnd As IntPtr, ByRef lpRect As RECT) As Boolean
        End Function
        <DllImportAttribute("kernel32.dll", EntryPoint:="ReadProcessMemory", SetLastError:=True)> _
        Private Function ReadProcessMemory(<InAttribute()> ByVal hProcess As System.IntPtr, <InAttribute()> ByVal lpBaseAddress As System.IntPtr, <Out()> ByVal lpBuffer As Byte(), ByVal nSize As UInteger, <OutAttribute()> ByRef lpNumberOfBytesRead As UInteger) As <System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.Bool)> Boolean
        End Function
        Public Declare Function ReadProcessMemory2 Lib "kernel32" Alias "ReadProcessMemory" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByRef lpBuffer As Long, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Integer
        Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal Classname As String, ByVal WindowName As String) As IntPtr
        Public Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hWnd As IntPtr, ByRef lpdwProcessId As Integer) As Integer
        Public Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Integer, ByVal bInheritHandle As Integer, ByVal dwProcessId As Integer) As IntPtr
        Public Declare Function CloseHandle Lib "kernel32" (ByVal hObject As IntPtr) As Integer
        Public Const PROCESS_VM_ALL As Integer = &H1F0FFF
        Public hWnd As IntPtr, pHandle As IntPtr, processID As Integer
        Const ProcessName As String = "iw6mp64_ship"
        Function load_()
            Dim proc As Process() = Process.GetProcessesByName(ProcessName)
            Dim windowname As String
            windowname = proc(0).MainWindowTitle
            hWnd = FindWindow(vbNullString, windowname)
            GetWindowThreadProcessId(hWnd, processID)
            pHandle = OpenProcess(PROCESS_VM_ALL, 0, processID)
            If hWnd = 0 Then Return 0 Else Return 1
        End Function
        Sub is_active(Optional ByVal exit_ As Boolean = True)
            Dim p As Process() = Process.GetProcessesByName(ProcessName)
            If p.Length = 0 And exit_ Then
                Environment.Exit(0)
            End If
        End Sub
        Function readInt(ByVal address As Integer, ByVal bytes As Integer)
            Dim read_value As Long = 0
            ReadProcessMemory2(pHandle, address, read_value, bytes, 0)
            Return read_value
        End Function
        Function readFloat(ByVal address As Integer, ByVal bytes As Integer)
            Dim read_value(bytes) As Byte
            ReadProcessMemory(pHandle, address, read_value, bytes, 0)
            Return BitConverter.ToSingle(read_value, 0)
        End Function
        Function readString(ByVal address As Integer, ByVal bytes As Integer, ByVal terminator As Byte)
            Dim read_value As String = ""
            Dim buffer As Byte
            For i = 0 To bytes
                ReadProcessMemory2(pHandle, address + i, buffer, 1, 0)
                If Not buffer = terminator Then
                    read_value &= Chr(buffer)
                Else
                    Exit For
                End If
            Next
            Return read_value
        End Function
    End Module
    Replace iw6mp64_ship at the line Const ProcessName As String = "iw6mp64_ship" by another process name if you wish to use it with a different game.

    -Chapter 2: The Form Editing-

    In this chapter, we will editing the newly created form to make it invisible and make it our overlay.

    Step 1:

    Change the form's Back Color and Transparency Key to Black. You can find those 2 options in the form's properties located at the bottom right (By default) of Visual Studio. Make sure that the form is selected.

    Step 2: Change the FormBorderStyle to None, the ShowInTaskbar to False and TopMost to True.

    Step 3: Double click on the form and add this code under Public Class (Form Name) (Base off the code by Stefsot)

    Code:
    Public Declare Function ReadProcessMemory2 Lib "kernel32" Alias "ReadProcessMemory" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByRef lpBuffer As Long, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Integer
        Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal Classname As String, ByVal WindowName As String) As IntPtr
        Public Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hWnd As IntPtr, ByRef lpdwProcessId As Integer) As Integer
        Public Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Integer, ByVal bInheritHandle As Integer, ByVal dwProcessId As Integer) As IntPtr
        Public Declare Function CloseHandle Lib "kernel32" (ByVal hObject As IntPtr) As Integer
        Public Const PROCESS_VM_ALL As Integer = &H1F0FFF
        Public hWnd As IntPtr, pHandle As IntPtr, processID As Integer
        Const ProcessName As String = "iw6mp64_ship"
    Change the process name again if you wish to use it on another game.

    Step 4:

    Add a Timer to your form with an Interval of 1. This timer will make sure that the form will be as big as the game's resolution and at the same location as the game. Add this code to your timer. (Base off the code by Stefsot)

    Code:
    Call load_()
            Dim proc As Process() = Process.GetProcessesByName(ProcessName)
            Dim MyHeight = Me.Height
            Dim windowname As String
            windowname = proc(0).MainWindowTitle
            hWnd = FindWindow(vbNullString, windowname)
            GetWindowThreadProcessId(hWnd, processID)
            pHandle = OpenProcess(PROCESS_VM_ALL, 0, processID)
            GetWindowRect(Overlay.hWnd, window_loc)
            Me.Location = New Point(window_loc.Left, window_loc.Top)
            Me.Size = New Point(window_loc.Right - window_loc.Left, window_loc.Bottom - window_loc.Top)
            screencenter(0) = Me.Width = 100
            screencenter(1) = Me.Height = 100
    You can set the timer to be Enabled at all time by changing the "Enabled" properties to true but I suggest to load the form and turn on the timer when your project detects the game. This way, it will prevent crash.

    All you have to do now is to add whatever you like to the form. You might need to play with the location of the items to fit well on the game's window.

    Happy Editing!
    Last edited by NightmareTX_RETIRED; 01-06-2014 at 03:33 PM.

  2. The Following 5 Users Say Thank You to NightmareTX_RETIRED For This Useful Post:

    distiny (01-06-2014),Izochor (05-26-2014),KingX735 (01-06-2014),TryOne (01-29-2014),xDasEinhorn (05-17-2015)

  3. #2
    Horror's Avatar
    Join Date
    Oct 2010
    Gender
    male
    Location
    51,4.
    Posts
    6,940
    Reputation
    574
    Thanks
    5,004
    My Mood
    Twisted
    Quote Originally Posted by NightmareTX View Post
    the newly created for
    form, lil typo.
    Didn't expect you to post it this early, nice share
     

    Minion+ : February 2014 - January 2015
    Counter Strike: Global Offensive Minion : November 2014 - January 2015
    Alliance of Valiant Arms Minion : August 2014 - January 2015
    Need For Speed World Minion : January 2014 - January 2015
    Rust Minion : January 2014 - January 2015
    Call of Duty Minion : January 2013 - January 2015
    Editor : December 2012 - April 2013
    Donator : March 2014 - Current
    Member : October 2010 - Current

    Previously known as "Isaakske".

  4. #3
    distiny's Avatar
    Join Date
    Mar 2011
    Gender
    male
    Posts
    560
    Reputation
    67
    Thanks
    560
    My Mood
    Cynical
    nice share bro
    FBI got my PC...Hardcore cheating is paused atm..

  5. #4
    NightmareTX_RETIRED's Avatar
    Join Date
    Apr 2011
    Gender
    male
    Posts
    1,240
    Reputation
    57
    Thanks
    15,075
    My Mood
    Fine
    Quote Originally Posted by Horror View Post

    form, lil typo.
    Didn't expect you to post it this early, nice share
    Corrected. Thanks!

  6. #5
    Lovroman's Avatar
    Join Date
    Sep 2012
    Gender
    male
    Posts
    9,430
    Reputation
    611
    Thanks
    9,717
    My Mood
    Cheerful
    Thanks for sharing!
    Last edited by Lovroman; 05-08-2014 at 01:38 PM.

  7. #6
    Minnesota Dabs's Avatar
    Join Date
    Nov 2013
    Gender
    male
    Location
    VOTE TRUMP
    Posts
    4,209
    Reputation
    615
    Thanks
    1,069
    My Mood
    Relaxed
    Thanks for supplying the leechers with more code.

    Nice release
    Successful Trades: 52

    Scammed Trades: 6

    Vouch Profile!



    Consider donating to my PayPal!

  8. #7
    distiny's Avatar
    Join Date
    Mar 2011
    Gender
    male
    Posts
    560
    Reputation
    67
    Thanks
    560
    My Mood
    Cynical
    I'll see if can get the same result in c# and share that. (Inb4 it is possible, I mean if I can do it)
    FBI got my PC...Hardcore cheating is paused atm..

  9. #8
    NightmareTX_RETIRED's Avatar
    Join Date
    Apr 2011
    Gender
    male
    Posts
    1,240
    Reputation
    57
    Thanks
    15,075
    My Mood
    Fine
    There is also another piece of code that you can add but this is optional. This code will prevent the the game to lose focus if the user click on something that is on the Overlay form. This is useful if you want to create a external crosshair in vb.net

    This code is from @master131

    Put it under Public Class <Overlay Form Name Here>

    Code:
    Private Const WS_EX_TRANSPARENT As Integer = &H20
    
        Protected Overrides ReadOnly Property CreateParams() As System.Windows.Forms.CreateParams
            Get
                Dim cp As CreateParams = MyBase.CreateParams
                cp.ExStyle = cp.ExStyle Or WS_EX_TRANSPARENT
                Return cp
            End Get
        End Property

  10. #9
    COD3RIN's Avatar
    Join Date
    May 2013
    Gender
    male
    Location
    Posts
    4,942
    Reputation
    315
    Thanks
    22,162
    My Mood
    Busy
    nice info i am not good in vb.net but great


    Love you.
    ~Kenshit13
    Quote Originally Posted by cheaterman26 View Post
    COD3RIN PUT A BACKDOOR ON HIS OWN CHEAT HE HACK MY COMPUTER AND MY STEAM, DON'T TRUST THIS GUYS !

  11. #10
    Nubzgetkillz's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Location
    hacktown
    Posts
    838
    Reputation
    13
    Thanks
    411
    My Mood
    Amazed
    Hi thank you for your share!
    I was wondering if there is a way to make the overlay re-size itself if I were to re-size the game client?

    Member since September 25, 2010

    Current Objectives:
    • Graduate college with a degree in Computer Science
    • Find a decent job in the Computer Science Field
    • Learn more programming languages

    Looking for Elo Boosting Job - League of Legends
    Looking for Bronze -> Gold Jobs


    Skype: whatthedream

  12. #11
    NightmareTX_RETIRED's Avatar
    Join Date
    Apr 2011
    Gender
    male
    Posts
    1,240
    Reputation
    57
    Thanks
    15,075
    My Mood
    Fine
    Quote Originally Posted by Nubzgetkillz View Post
    Hi thank you for your share!
    I was wondering if there is a way to make the overlay re-size itself if I were to re-size the game client?
    Read Step 4

  13. #12
    Nubzgetkillz's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Location
    hacktown
    Posts
    838
    Reputation
    13
    Thanks
    411
    My Mood
    Amazed
    Quote Originally Posted by NightmareTX View Post
    Read Step 4
    LOL I figured this out right after i posted the message but mpgh went down so oops

    Member since September 25, 2010

    Current Objectives:
    • Graduate college with a degree in Computer Science
    • Find a decent job in the Computer Science Field
    • Learn more programming languages

    Looking for Elo Boosting Job - League of Legends
    Looking for Bronze -> Gold Jobs


    Skype: whatthedream

Similar Threads

  1. [Discussion]VB.Net Flicker-less FPS Overlay
    By NightmareTX_RETIRED in forum Call of Duty Ghosts Discussions & Help
    Replies: 27
    Last Post: 01-07-2014, 02:53 PM
  2. [Tutorial] [vb.NET Tutorial] WolfTeam Hack Making
    By matthieu503 in forum WolfTeam Hacks
    Replies: 4
    Last Post: 04-24-2013, 03:44 AM
  3. [Tutorial] Injecting Sh_z_Sektor's Public v3 [MPGH.net Tutorials by Cheatz]
    By CheatCreatorzz in forum CrossFire Tutorials
    Replies: 18
    Last Post: 04-19-2011, 06:42 AM
  4. [Request] Paint.net Tutorial
    By Soladis in forum Tutorials
    Replies: 11
    Last Post: 11-10-2010, 07:14 PM
  5. vb.net tutorial need help
    By vahnvallain in forum Visual Basic Programming
    Replies: 4
    Last Post: 10-01-2010, 09:50 PM