Raised This Month: $12 Target: $400
 3% 

Vtable question(s)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xerox8521
Senior Member
Join Date: Sep 2011
Old 11-04-2015 , 10:29   Vtable question(s)
Reply With Quote #1

Hi,

so i took a look on this topic (https://forums.alliedmods.net/showthread.php?t=191171) and the wiki entry regarding vtable offsets. Thing is now i found offsets which i need but i think those offsets are to low to be A) correct and B) working. Game im using is ZPS. I tried using GetMaxSpeed and GetMaxHealth but both crash the server. MaxHealth returns some number which is not the health of the survivor. (100 by default) maybe someone can take me to the correct offsets or atleast tell me where did i do what wrong.

Using m_iMaxHealth and Speed does not work for zps

VTable:

PHP Code:
// Auto reconstructed from vtable block @ 0x01217700
// from "server_i486.so", by ida_vtables.idc
0    CHuman::SetParent(CHL2MP_Player *)
1    CHuman::ReturnTeamID(void)
2    CHuman::Print(void)
3    CHuman::GetClassSpawnPoint(void)
4    CHuman::WaterBreathingCheck(void)
5    CHuman::GetPlayerMaxHealth(void)
6    CHuman::GetPlayerMaxSpeed(void)
7    CHuman::GetPlayerWeight(void)
8    CHuman::GetPlayerHeadHealth(void)
9    CHuman::TakeHeadDamage(float)
10    CHuman::RegenHead(float)
11    CHuman::GiveClassDefaultGear(void)
12    CHuman::CanEquipGear(CBaseCombatWeapon *)
13    CHuman::CanGetItems(void)
14    CHuman::CanUseAmmo(int)
15    CHuman::CanUseItem(int)
16    CHuman::GetPlayerSpeed(void)
17    CHuman::AddWeight(float)
18    CHuman::RemoveWeight(float)
19    CHuman::DropAllWeight(void)
20    CClassManager::AddHandicap(float)
21    CClassManager::RemoveHandicap(void)
22    CClassManager::SetJumping(bool)
23    CClassManager::SetShot(bool)
24    CHuman::AddFatigue(float)
25    CHuman::RemoveFatigue(float)
26    CHuman::StoreFatigue(bool)
27    CHuman::IsFatigueStored(void)
28    CHuman::ProcessDeath(void

Last edited by xerox8521; 11-04-2015 at 10:32.
xerox8521 is offline
psychonic

BAFFLED
Join Date: May 2008
Old 11-04-2015 , 10:50   Re: Vtable question(s)
Reply With Quote #2

That table is probably correct for a CHuman, but it sounds like maybe you're making the assumption that a CHuman is (or inherits from) an entity class, where there does not seem to be the case. To call or hook the functions in that list, you would need a CHuman instance, not the player's entity instance. Alternatively, maybe you meant to dump the CZPSPlayer class (may not be exact name).
psychonic is offline
xerox8521
Senior Member
Join Date: Sep 2011
Old 11-04-2015 , 11:17   Re: Vtable question(s)
Reply With Quote #3

Afaik (by looking through the file in IDA) zps uses CHL2MP_Player but it doesnt have those functions. But yea i actually assumed that CHuman is inherited from CHL2MP_Player or atleast CBasePlayer or CBaseEntity. I dont know if this helps but I found CBase class which has same functions. Can i assume that i will have the same issue as with the CHuman class and how do i get an instance of CHuman in that case ?

Last edited by xerox8521; 11-04-2015 at 11:18.
xerox8521 is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:19.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode