helix snake Posted July 11, 2015 Share Posted July 11, 2015 (edited) 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 July 11, 2015 by helix snake Link to comment Share on other sites More sharing options...
leftas Posted July 11, 2015 Share Posted July 11, 2015 (edited) 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 July 11, 2015 by leftas Link to comment Share on other sites More sharing options...
helix snake Posted July 12, 2015 Author Share Posted July 12, 2015 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 More sharing options...
Inco Posted July 12, 2015 Share Posted July 12, 2015 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 Link to comment Share on other sites More sharing options...
leftas Posted July 12, 2015 Share Posted July 12, 2015 (edited) 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 July 12, 2015 by leftas Link to comment Share on other sites More sharing options...
Inco Posted July 12, 2015 Share Posted July 12, 2015 (edited) 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 July 12, 2015 by Inco Link to comment Share on other sites More sharing options...
helix snake Posted July 13, 2015 Author Share Posted July 13, 2015 (edited) 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 July 13, 2015 by helix snake Link to comment Share on other sites More sharing options...
leftas Posted July 13, 2015 Share Posted July 13, 2015 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now