Utilize data structures?
Hey,
I've got this structure for CBaseCombatCharacter. How do i access its offsets? I need to access m_bPreventWeaponPickup to check if weapon pickup is prevented. Would this be the appropriate way? I was trying out FindDataMapInfo, but couldn't figure how to check each slot? PHP Code:
PHP Code:
|
Re: Utilize data structures?
The offsets you've provided aren't absolute; CBaseCombatCharacter is a subclass of other classes with properties.
There is a datamap dump for L4D2 here. m_bPreventWeaponPickup is a named property (at offset 6105); just use GetEntProp(client, Prop_Data, "m_bPreventWeaponPickup") to access it. For properties that aren't defined as a netprop / dataprop, you'd probably opt for offsets relative to a named property (e.g., to access m_weaponIDToIndex you'd call FindDataMapInfo to get the offset for the named property m_impactEnergyScale, add 0x04, then use GetEntData to read it -- well, you'll probably need to read out the bytes as a string since it's a 38-byte char array). It sounds like you're using this as reference, which has a comment right above your struct stating the offset is 6092 bytes relative to the CTerrorPlayer entity address. |
Re: Utilize data structures?
Hmm so how would I switch between slots?
Thanks for your input as always. You have been a real help. |
Re: Utilize data structures?
I'm not sure what "slots" refers to in this context. Weapon slots?
I don't have a deep-level understanding of L4D2 (only played it casually), but if m_bPreventWeaponPickup changes depending on the weapon, you'll have to continue browsing through the assembly for modifications to that offset (6105 being 17D9 in hex). I believe you can set a watchpoint on the memory address as well in GDB; have never done it myself, though. |
Re: Utilize data structures?
Yeah I was referring to weapon slots. Guess I got to stare at the disassembly some more.
|
All times are GMT -4. The time now is 15:19. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.