Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Support

    3. Suggestions

Happy Holidays from the GTANet team!

How does RagePluginHook get all entities/vehicles/peds?


helix snake
 Share

Recommended Posts

helix snake

I really want to do that in my code but I don't want to require people to install Rage Plugin Hook. I've been trying to do this for a while and apparently the people who created Rage Plugin Hook found out how to do it but didn't share it with the rest of us. I have a script I want to release to people but I'm using unmanaged C++ which isn't compatible with Rage Plugin Hook.

Edited by helix snake
Link to comment
Share on other sites

They access vehicle pool/array do some bitwise operations and give you vehicles, but from what I heard it works different than most of pools.

 

All the best,

Paul.

Edited by leftas
Link to comment
Share on other sites

helix snake

So since I don't know what the pool address is and I don't know how to operate on it, I guess I'm stuck with my current horrible solution of placing peds in the world on the ground, getting the vehicles near them, and immediately deleting them, which is extremely slow and misses cars a lot of the time, as well as not being able to access entities or aerial vehicles at all.

 

People watching my youtube channel want me to release my scripts but I'm f*cking embarrassed to with the solution I'm using. I really need to figure out what the pool is and how to access it. It doesn't help that I'm not a good hacker or great programmer in general. Even if someone told me what the pool address was and how they're stored, I'd still probably need to see sample code before I could do it myself.

Link to comment
Share on other sites

 

Even if someone told me what the pool address was and how they're stored, I'd still probably need to see sample code before I could do it myself.

https://github.com/crosire/scripthookvdotnet/blob/dev/source/NativeMemory.cpp

 

Nice, I see you the only one who knows about memory reading, there. But if I found correct vehicle array/pool address, then it means that vehicle uses not the same class structure as most pools does, they do some padding after each pointer and other sh*t, which I can't remember now. And I won't/can't confirm this until next week.

 

So since I don't know what the pool address is and I don't know how to operate on it, I guess I'm stuck with my current horrible solution of placing peds in the world on the ground, getting the vehicles near them, and immediately deleting them, which is extremely slow and misses cars a lot of the time, as well as not being able to access entities or aerial vehicles at all.

 

People watching my youtube channel want me to release my scripts but I'm f*cking embarrassed to with the solution I'm using. I really need to figure out what the pool is and how to access it. It doesn't help that I'm not a good hacker or great programmer in general. Even if someone told me what the pool address was and how they're stored, I'd still probably need to see sample code before I could do it myself.

Inco provided you a code, you a code, learn from it. And there numerous tutorials about memory access, doesn't need to be a hacker, though. You just create a class with types sizes, respectively, and you can then do memory accessing ;)

 

All the best,

Paul.

Edited by leftas
Link to comment
Share on other sites

 

 

Even if someone told me what the pool address was and how they're stored, I'd still probably need to see sample code before I could do it myself.

https://github.com/crosire/scripthookvdotnet/blob/dev/source/NativeMemory.cpp

 

Nice, I see you the only one who knows about memory reading, there.

 

This class was not added by me (i was just found some offsets to get vehicle rpm and ect :) ). As far i know, this methods returns not quite all entities, but this better than

 

placing peds in the world on the ground, getting the vehicles near them, and immediately deleting them

 

P.S. The implementation similar to implementation in GTA 4 .NET ScriptHook.

Edited by Inco
Link to comment
Share on other sites

helix snake

 

 

 

Even if someone told me what the pool address was and how they're stored, I'd still probably need to see sample code before I could do it myself.

https://github.com/crosire/scripthookvdotnet/blob/dev/source/NativeMemory.cpp

 

Nice, I see you the only one who knows about memory reading, there.

 

This class was not added by me (i was just found some offsets to get vehicle rpm and ect :) ). As far i know, this methods returns not quite all entities, but this better than

 

placing peds in the world on the ground, getting the vehicles near them, and immediately deleting them

 

P.S. The implementation similar to implementation in GTA 4 .NET ScriptHook.

 

I actually tried imitating the implementation that scripthookdotnet uses, and tested it, and my method is actually superior in terms of amount of vehicles grabbed. Using the pool you use, only nearby vehicles and peds (and sometimes not even those) are grabbed. It's practically inferior to using the "get all vehicles near ped" function on the player (sometimes it will grab a vehicle outside that range, but it's very rare).

 

Unless I get the FULL pool with all entities, I have no choice but to stick with the extremely slow method I'm using. I still have the code for if I want to switch back, but I don't really understand how the scripthookdotnet code gets the actual data (the method they used doesn't make sense to me). It seems to search for a specific "pattern" and then somehow takes whatever's after that and re-casts it as a "pool" struct, but then it does some operations on the data that don't make any sense to me. This line:

 

 

sAddressEntityPool = reinterpret_cast<MemoryPool **>(*reinterpret_cast<int *>(patternAddress + 3) + patternAddress + 7);

 

I don't understand what's happening here, even with the comment. If I had to recreate this with different logic I don't know if I would be able to.

Edited by helix snake
Link to comment
Share on other sites

 

 

 

 

Even if someone told me what the pool address was and how they're stored, I'd still probably need to see sample code before I could do it myself.

https://github.com/crosire/scripthookvdotnet/blob/dev/source/NativeMemory.cpp

 

Nice, I see you the only one who knows about memory reading, there.

 

This class was not added by me (i was just found some offsets to get vehicle rpm and ect :) ). As far i know, this methods returns not quite all entities, but this better than

 

placing peds in the world on the ground, getting the vehicles near them, and immediately deleting them

P.S. The implementation similar to implementation in GTA 4 .NET ScriptHook.

 

I actually tried imitating the implementation that scripthookdotnet uses, and tested it, and my method is actually superior in terms of amount of vehicles grabbed. Using the pool you use, only nearby vehicles and peds (and sometimes not even those) are grabbed. It's practically inferior to using the "get all vehicles near ped" function on the player (sometimes it will grab a vehicle outside that range, but it's very rare).

 

Unless I get the FULL pool with all entities, I have no choice but to stick with the extremely slow method I'm using. I still have the code for if I want to switch back, but I don't really understand how the scripthookdotnet code gets the actual data (the method they used doesn't make sense to me). It seems to search for a specific "pattern" and then somehow takes whatever's after that and re-casts it as a "pool" struct, but then it does some operations on the data that don't make any sense to me. This line:

 

sAddressEntityPool = reinterpret_cast<MemoryPool **>(*reinterpret_cast<int *>(patternAddress + 3) + patternAddress + 7);

I don't understand what's happening here, even with the comment. If I had to recreate this with different logic I don't know if I would be able to.

I said that the pool scripthook uses, isn't anything like entity pool or what ever it's script related guide pool, which holds peds and vehicles related to running scripts, in this pool vehicles and peds are added when you sit in new vehicle, use get nearby peds and so on...

 

That code you posted get address to pool address, first it gets value to instruction which moves global to register. So first three opcodes are for mov instruction other ones are relative address to global so it adds next instruction address to get global.

 

Inco,

Ah, also I know that Sergeeeek implement that memory access, but you added some offsets so I thought you are reverse engineering.

 

All the best,

Paul.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.