Results 1 to 14 of 14
  1. #1
    AbsoluteMadman's Avatar
    Join Date
    Jun 2016
    Gender
    male
    Posts
    29
    Reputation
    10
    Thanks
    1

    [C#] Getting started on external aimbot

    It seems most sources I've come across either use C++ and are internal or don't include the part about finding the bones, which is where my trouble lies. I don't have any bit of the aimbot done yet since I'm still on the first step, which as far as I can tell is getting the BoneID for the head, and doing stuff with that. Along with view angles. Though I'm pretty lost. I promise I didn't just google for 10 minutes and give up. I've actually been at this for longer than I'd like to admit.

  2. #2
    derkrasseboy's Avatar
    Join Date
    Mar 2015
    Gender
    male
    Location
    right there
    Posts
    117
    Reputation
    10
    Thanks
    7
    First of all i'd recommend you doing a function which picks a target (You can do it by Player Distance or nearest Player to Crosshair what i'd recommend or with a Visibility Check which is quite hard if you're external(dont use bSpotted))

  3. #3
    WasserEsser's Avatar
    Join Date
    Jul 2015
    Gender
    male
    Posts
    735
    Reputation
    174
    Thanks
    677
    My Mood
    Busy
    Quote Originally Posted by derkrasseboy View Post
    First of all i'd recommend you doing a function which picks a target (You can do it by Player Distance or nearest Player to Crosshair what i'd recommend or with a Visibility Check which is quite hard if you're external(dont use bSpotted))
    External visibility checks aren't hard, people just keep copy and pasting code without coding their own stuff.
    BSP parsing is pretty easy once you read the documentation by valve about the BSP file format.
    Once you've read it, you should easily be able to build your visibility check around that.

    The only problem about BSP parsing is that it only contains the map, not the entities that are used on the map, for instance crates or silos. These are entities and would have to be parsed by parsing the entitylist, checking if the position + mins and maxs are within the line of sight. But even that isn't hard.

  4. #4
    derkrasseboy's Avatar
    Join Date
    Mar 2015
    Gender
    male
    Location
    right there
    Posts
    117
    Reputation
    10
    Thanks
    7
    Quote Originally Posted by WasserEsser View Post
    External visibility checks aren't hard, people just keep copy and pasting code without coding their own stuff.
    BSP parsing is pretty easy once you read the documentation by valve about the BSP file format.
    Once you've read it, you should easily be able to build your visibility check around that.

    The only problem about BSP parsing is that it only contains the map, not the entities that are used on the map, for instance crates or silos. These are entities and would have to be parsed by parsing the entitylist, checking if the position + mins and maxs are within the line of sight. But even that isn't hard.
    Oh i didn't even know there was a documentation by Valve, im defenetly gonna check that out

    Update: You are actually right. I just finished my BSP Parsing and this article is really useful: https://developer.valvesoftware.com/...SP_File_Format
    I thought its pretty hard but it actually isn't.
    Last edited by Hunter; 06-26-2016 at 04:36 AM.

  5. #5
    AbsoluteMadman's Avatar
    Join Date
    Jun 2016
    Gender
    male
    Posts
    29
    Reputation
    10
    Thanks
    1
    Quote Originally Posted by derkrasseboy View Post
    First of all i'd recommend you doing a function which picks a target (You can do it by Player Distance or nearest Player to Crosshair what i'd recommend or with a Visibility Check which is quite hard if you're external(dont use bSpotted))
    hmm, ok. Any tips on getting bones of players? I can't seem to figure out how to find them

  6. #6
    Graaff's Avatar
    Join Date
    Mar 2016
    Gender
    male
    Location
    The Valley of Death
    Posts
    157
    Reputation
    30
    Thanks
    113
    My Mood
    Daring
    Quote Originally Posted by AbsoluteMadman View Post
    hmm, ok. Any tips on getting bones of players? I can't seem to figure out how to find them
    Code:
    DWORD GetBoneMatrixAddr(DWORD BaseAddr) {
    	return Memory.Read<DWORD>(BaseAddr + m_dwBoneMatrix);
    }
    
    Vector3 GetBonePos(DWORD BoneMatrixAddr, int TargetBone) {
    	Vector3 temp;
    	temp.x = Memory.Read<float>(BoneMatrixAddr + 0x30 * TargetBone + 0x0C);
    	temp.y = Memory.Read<float>(BoneMatrixAddr + 0x30 * TargetBone + 0x1C);
    	temp.z = Memory.Read<float>(BoneMatrixAddr + 0x30 * TargetBone + 0x2C);
    
    	return temp;
    }

  7. #7
    AbsoluteMadman's Avatar
    Join Date
    Jun 2016
    Gender
    male
    Posts
    29
    Reputation
    10
    Thanks
    1
    Quote Originally Posted by derkrasseboy View Post
    First of all i'd recommend you doing a function which picks a target (You can do it by Player Distance or nearest Player to Crosshair what i'd recommend or with a Visibility Check which is quite hard if you're external(dont use bSpotted))
    Also, what's wrong with bSpotted? Most resources I find on external visibility checks mention it.

  8. #8
    WasserEsser's Avatar
    Join Date
    Jul 2015
    Gender
    male
    Posts
    735
    Reputation
    174
    Thanks
    677
    My Mood
    Busy
    Quote Originally Posted by AbsoluteMadman View Post
    Also, what's wrong with bSpotted? Most resources I find on external visibility checks mention it.
    m_bSpotted is used for the radar and indicates whether you know about the position of an entity or not. This means that the entity is also displayed when a teammate of yours sees the enemy. You would rather want to use m_bSpottedByMask, which is a bitmask. You can mask out your own player to know whether your player sees the entity or not. You can also query the bitmask to ask if your teammates saw the entity.

    The radar is not as important as the gameplay, so the radar isn't instantly updated nor is it accurate. If you can clearly see his back, it doesn't mean your radar shows the entity as visible.

    The following video shows you how detecting an entity works in csgo.



    It's slowly updating and not really accurate.
    Last edited by WasserEsser; 06-24-2016 at 10:12 AM.

  9. The Following 2 Users Say Thank You to WasserEsser For This Useful Post:

    AbsoluteMadman (06-24-2016),Hunter (06-24-2016)

  10. #9
    AbsoluteMadman's Avatar
    Join Date
    Jun 2016
    Gender
    male
    Posts
    29
    Reputation
    10
    Thanks
    1
    Quote Originally Posted by WasserEsser View Post
    It's slowly updating and not really accurate.
    Ok, well I'll use it in the beginning just to get everything working since I assume it's easier than setting up BSP Parsing. How do I find my current view angle and then use that method Graaff posted to set my view angle to the head of the entity closest to my crosshair? I don't really get anything about how aimbots work, tbh. I've searched google and the forums, and it's only made some things more confusing.

  11. #10
    rwby's Avatar
    Join Date
    Jul 2015
    Gender
    male
    Location
    client.dll
    Posts
    1,631
    Reputation
    142
    Thanks
    6,724
    Quote Originally Posted by AbsoluteMadman View Post
    Ok, well I'll use it in the beginning just to get everything working since I assume it's easier than setting up BSP Parsing. How do I find my current view angle and then use that method Graaff posted to set my view angle to the head of the entity closest to my crosshair? I don't really get anything about how aimbots work, tbh. I've searched google and the forums, and it's only made some things more confusing.
    You might be over complicating it for yourself.

  12. #11
    AbsoluteMadman's Avatar
    Join Date
    Jun 2016
    Gender
    male
    Posts
    29
    Reputation
    10
    Thanks
    1
    Quote Originally Posted by Azay View Post


    You might be over complicating it for yourself.
    Probably, but I'm just kinda unclear on some things and overall confused. lol

  13. #12
    AbsoluteMadman's Avatar
    Join Date
    Jun 2016
    Gender
    male
    Posts
    29
    Reputation
    10
    Thanks
    1
    Right now I'm just trying to get my Eye Position since I assume this is the first thing I have to do. Though I can't figure out how to read Vectors from memory in c#. I'm using Zat's vector3 class, since m_vecOrigin + m_vecViewOffset returns a Vector3.

    My ReadInt method would look like this

    Code:
    public int ReadInt(int address)
    {  
        byte[] buffer = new byte[4];
        ReadProcessMemory(handle, address, buffer, 4, 0);
        return BitConverter.ToInt32(buffer, 0);
    }
    I can't do the same thing and just try to pass in a Vector3 because I have to somehow convert the byte array (buffer) to a Vector3. Tried using anonymous types, but the same problem arises.

    EDIT: Got reading a vector working, however, as for getting the eye position in order to calculate the angles. I'm reading LocalPlayer + m_vecOrigin as a Vector3. Is the Z here my Eye Position? So now would I go on to find the position of the head bone of the entity I want to shoot at and subtract that from the vector I just read?
    Last edited by AbsoluteMadman; 06-26-2016 at 04:01 PM.

  14. #13
    WasserEsser's Avatar
    Join Date
    Jul 2015
    Gender
    male
    Posts
    735
    Reputation
    174
    Thanks
    677
    My Mood
    Busy
    Quote Originally Posted by AbsoluteMadman View Post
    Right now I'm just trying to get my Eye Position since I assume this is the first thing I have to do. Though I can't figure out how to read Vectors from memory in c#. I'm using Zat's vector3 class, since m_vecOrigin + m_vecViewOffset returns a Vector3.

    My ReadInt method would look like this

    Code:
    public int ReadInt(int address)
    {  
        byte[] buffer = new byte[4];
        ReadProcessMemory(handle, address, buffer, 4, 0);
        return BitConverter.ToInt32(buffer, 0);
    }
    I can't do the same thing and just try to pass in a Vector3 because I have to somehow convert the byte array (buffer) to a Vector3. Tried using anonymous types, but the same problem arises.

    EDIT: Got reading a vector working, however, as for getting the eye position in order to calculate the angles. I'm reading LocalPlayer + m_vecOrigin as a Vector3. Is the Z here my Eye Position? So now would I go on to find the position of the head bone of the entity I want to shoot at and subtract that from the vector I just read?
    I'm sorry to say this, but if you don't even know how to use ReadProcessMemory properly to read a vector, you shouldn't try to make an aimbot. You'll end up copy pasting everything you see, which is not the point of programming. I'd suggest learning the basics first, practice with easier stuff, then learn the proper math for an aimbot and eventually move onto making an aimbot.

  15. #14
    AbsoluteMadman's Avatar
    Join Date
    Jun 2016
    Gender
    male
    Posts
    29
    Reputation
    10
    Thanks
    1
    Quote Originally Posted by WasserEsser View Post
    I'm sorry to say this, but if you don't even know how to use ReadProcessMemory properly to read a vector, you shouldn't try to make an aimbot. You'll end up copy pasting everything you see, which is not the point of programming. I'd suggest learning the basics first, practice with easier stuff, then learn the proper math for an aimbot and eventually move onto making an aimbot.
    I've been programming for a few years. Made a bunch of generic bhop/triggerbot/glow cheats, etc. Never had to deal with vectors in C# though. I didn't think i could just use a float array to represent the x/y/z, but i realized today i could. I copy pasted stuff in the beginning, but messed with stuff immediately and came to understand it, which is pretty much what i'm trying to do with the aimbot, just without the copy paste.

Similar Threads

  1. [Help Request] What do i need to get started for aimbot?
    By AKSpartan117 in forum Garry's Mod Discussions & Help
    Replies: 4
    Last Post: 06-29-2015, 12:57 AM
  2. How do I get started?im NEW NEW
    By rog99m2 in forum Programming Tutorial Requests
    Replies: 2
    Last Post: 01-03-2009, 11:51 AM
  3. Getting started in programming hacks for combat arms.
    By killerthc in forum Combat Arms Hacks & Cheats
    Replies: 15
    Last Post: 08-25-2008, 04:47 PM
  4. Need help getting started
    By skittlznick2 in forum Combat Arms Hacks & Cheats
    Replies: 2
    Last Post: 08-03-2008, 12:53 AM
  5. Got VB 6, I see new Adress thread, how to get started?
    By soulbind4 in forum WarRock - International Hacks
    Replies: 10
    Last Post: 01-24-2008, 07:38 PM