IPB

Welcome Guest ( Log In | Register )

> rcbot_const_mstr_offset needs updating?
JRob
post Aug 26 2015, 12:52 AM
Post #1


Advanced Member
***

Group: Members
Posts: 52
Joined: 30-April 11
Member No.: 1,970



I tried playing around with rcbot again and it keeps crashing at

CTeamControlPointRound *CTeamControlPointMaster:: getCurrentRound ()

CBaseEntity *pent = m_ControlPointRounds[m_iCurrentRoundIndex];

So I took a look at what that was and apparently, CTeamControlPointRound is found through dark hackery and the magic number at rcbot_const_mstr_offset.

Can you update this? Or also tell people how to find these offsets?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
 
Reply to this topicStart new topic
Replies
Nightc0re
post Aug 29 2015, 12:52 PM
Post #2


Advanced Member
***

Group: Moderator
Posts: 58
Joined: 10-July 15
From: Austria
Member No.: 2,397



QUOTE(JRob @ Aug 27 2015, 09:02 PM) *

Surely there's an automatic way to find these offsets? Or an easier way to get the data you need from this entity?

It seems horrible that after each update, we have to load up dustbowl and HOPE that nothing else happens early in the structure happens to be 3.

This was my approach some weeks ago, but Cheeseh is using a different approach.
Look here.

Side note to Cheeseh:
You are not using this variable, was this intended?
CODE
unsigned long full_size = sizeof(pMasterEntity);

User is offlineProfile CardPM
Go to the top of the page
+Quote Post
JRob
post Aug 29 2015, 09:17 PM
Post #3


Advanced Member
***

Group: Members
Posts: 52
Joined: 30-April 11
Member No.: 1,970



QUOTE(Nightc0re @ Aug 29 2015, 12:52 PM) *

This was my approach some weeks ago, but Cheeseh is using a different approach.
Look here.

Side note to Cheeseh:
You are not using this variable, was this intended?
CODE
unsigned long full_size = sizeof(pMasterEntity);



He's not doing anything new here, he is adding a magic number to the CBaseEntity pointer.

He isn't even using sizeof(CBaseEntity). Is this even guaranteed to be the right number? The hl2sdk has some definitions for it, but the TF2 code can obviously diverge from the SDK because it was never made for people to mod TF2. If the TF2 team wants to add some extra stuff to CBaseEntity, it won't show up on the hl2sdk unless the people at AlliedMods reverse engineers it. And from what I see, they don't depend on CBaseEntity.

That's why the linux magic number increased. They might have added stuff or maybe changed compiler flags so the offset was increased.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Cheeseh
post Aug 30 2015, 05:53 AM
Post #4


Admin
*****

Group: Admin
Posts: 3,056
Joined: 11-September 03
From: uk
Member No.: 1



QUOTE(JRob @ Aug 29 2015, 10:17 PM) *

He's not doing anything new here, he is adding a magic number to the CBaseEntity pointer.

He isn't even using sizeof(CBaseEntity). Is this even guaranteed to be the right number? The hl2sdk has some definitions for it, but the TF2 code can obviously diverge from the SDK because it was never made for people to mod TF2. If the TF2 team wants to add some extra stuff to CBaseEntity, it won't show up on the hl2sdk unless the people at AlliedMods reverse engineers it. And from what I see, they don't depend on CBaseEntity.

That's why the linux magic number increased. They might have added stuff or maybe changed compiler flags so the offset was increased.


it was used as a test so it's not being used . sizeof(CBaseEntity) would be the correct way but the CBAseEntity class isn't declared in plugins - that's the problem and this is the way around it
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
JRob
post Aug 30 2015, 07:38 PM
Post #5


Advanced Member
***

Group: Members
Posts: 52
Joined: 30-April 11
Member No.: 1,970



QUOTE(Cheeseh @ Aug 30 2015, 05:53 AM) *

it was used as a test so it's not being used . sizeof(CBaseEntity) would be the correct way but the CBAseEntity class isn't declared in plugins - that's the problem and this is the way around it


How about this? You locate CTeamControlPointMaster::Spawn() which seems to have never changed, and is unlikely to change.

https://github.com/ValveSoftware/source-sdk..._master.cpp#L85

Then you scan the function for this

m_bFoundPoints = false;

Which looks like this in a dissembler.
CTeamControlPointMaster::Spawn() + 0x1A
mov byte ptr [ebx+37Ch], 0

So you know that m_bFoundPoints is located at 892. If you subtract sizeof(bool) and sizeof(CUtlMap<int, CTeamControlPoint *>), I believe you will get the size of CBaseEntity.

This method should work for other classes based on CBaseEntity and maybe there is an easier one to use. It could be automated and more robust than the current method.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 19th April 2024 - 10:33 PM