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

How to determine virtual functions since update


Post New Thread Reply   
 
Thread Tools Display Modes
BeetleFart
SourceMod Donor
Join Date: Apr 2004
Old 12-07-2005 , 22:06  
Reply With Quote #21

Quote:
Originally Posted by c0ldfyr3
Mani > I told you on L Dukes thread, that method he posted will work for anything you could possibly need or want do, including teleport, health, armour, money, hostage interaction. You can even set things you couldnt without, play with it and see ;)

Maybe Valve intended on doing it that way, but it also means alot more compaitibility, I MEAN ALOT.

I see it as a sign from the coding Gods =)
I tried setting a model index that way and couldnt get it to work either
__________________
CSource Server:
69.90.34.10:27015 Beetlesmod.com And CS-Addicts{US}



http://www.clanuseast.com
BeetleFart is offline
[email protected]
Member
Join Date: Dec 2005
Old 12-07-2005 , 22:24  
Reply With Quote #22

Quote:
Originally Posted by c0ldfyr3
Mani > I told you on L Dukes thread, that method he posted will work for anything you could possibly need or want do, including teleport, health, armour, money, hostage interaction. You can even set things you couldnt without, play with it and see ;)

Maybe Valve intended on doing it that way, but it also means alot more compaitibility, I MEAN ALOT.

I see it as a sign from the coding Gods =)
I've been able to use that method to get and set member variables, but Is there any way to access virtual functions that way? If there is, then it would definately be much better that way.
Lojo.jacob@gmail.com is offline
c0ldfyr3
AlliedModders Donor
Join Date: Aug 2005
Location: Ireland
Old 12-07-2005 , 22:45  
Reply With Quote #23

No, but most functions just change member variables anyway, actually, thats all they do
__________________
c0ldfyr3 is offline
Send a message via MSN to c0ldfyr3 Send a message via Yahoo to c0ldfyr3
Mani
Veteran Member
Join Date: Dec 2004
Location: UK
Old 12-08-2005 , 04:35  
Reply With Quote #24

I'm not using the header files anymore.
I'm only posting the dumps I have of them for other people to use.

Mani
__________________
Installation files, documentation and help can be found at: -

www.mani-admin-plugin.com
Mani is offline
[email protected]
Member
Join Date: Dec 2005
Old 12-08-2005 , 08:23  
Reply With Quote #25

Yeah, I'm thinking that's the way to go really. It's a whole lot of work to go through when valve changes things like this. When you're talking about a plugin that other people are using and are going to relly on, I'd give up speed and file size any day for reliablility.

Speeking of which. Where did L.Duke's post go? I can't seem to find it anymore...
Lojo.jacob@gmail.com is offline
robot
Junior Member
Join Date: Oct 2005
Old 12-08-2005 , 09:58  
Reply With Quote #26

I've been toying around with Bailopan's/LDukes ServerClass/Offset methods for setting and getting class members. I can happily say switching models works fine for me - you just have to do something like:

Code:
	g_terror = engine->PrecacheModel("models/player/terror.mdl", false);
	g_urban = engine->PrecacheModel("models/player/urban.mdl", false);
in your LevelInit function so that it returns you some Indices to feed the model index. I am however having lots of trouble doing much else with it (beware I am a tad newb to C++!).

It seems I can get m_iTeamNum in CBaseEntity, but not set it without crash, same for m_iHealth in CBasePlayer. Most int members that I have queried seem to return 0 I seem to be able to get the float m_flMaxSpeed and not much else...I can sort of see how I might do Teleports etc by playing with m_vecAbsOrigin vector type member etc - but am just wondering if anyone else has any tips on this - my general aim is to:

* set/get health of any ent
* set/get armor of any ent
* set/get vel/origin of any ent ie Tele
* set/get gravity of any player/ent
* kill a player
* burninate a player

I really like the idea of using this technique as it seems both mod independent and almost API friendly (in that it is far less likely to break with next server update).

As for using hacked header files, I am concurrently working through learning how to extract the vfunc table orders as per mani's lists and bail's suggestions using dlopen, dlsym and dladdr - but don't expect to achieve anything useful in the near future.

It is sort of interesting how much info you can get with commands like:

Code:
[gameop@medic bin]$ nm -n server_i486.so | c++filt | grep CBasePlayer:: > CBP_classes.txt
That at least is a nice way to see what is in the symbol table. You can also get similarly useful info out of gdb by attaching it to a running srcds instance - ie if the PID of srcds:

Code:
[gameop@medic srcds_l]$ ./cssd.sh
Starting CS:Source Server
[gameop@medic srcds_l]$ ps c | grep srcds
4918 pts/11    Ss+    0:00 srcds_run
4929 pts/11    Sl+    0:03 srcds_i686
[gameop@medic srcds_l]$ gdb srcds_run 4929

{lots of reading/loaded symbol msgs here!}

(gdb) info fun CBaseEntity::
That will list a whole bunch of CBaseEntity functions for those that are interested. It is great that it even has auto completion so you can just type a partial match and hit TAB a couple of times....

I know most of you guys already know about this stuff in much greater detail than I, I just thought I might share it with anyone that hasn't played in linux much. If I ever get any useful stuff out of these things I will be sure to post it here for you guys...

robot
robot is offline
c0ldfyr3
AlliedModders Donor
Join Date: Aug 2005
Location: Ireland
Old 12-08-2005 , 10:48  
Reply With Quote #27

Quote:
Originally Posted by [email protected]
Speeking of which. Where did L.Duke's post go? I can't seem to find it anymore...
Its at the top of this thread lol.


Well, considering a player is CBasePlayer a derived class of CBaseEntity, why dont you try looking there for things like health and stuff ;) ?
__________________
c0ldfyr3 is offline
Send a message via MSN to c0ldfyr3 Send a message via Yahoo to c0ldfyr3
L. Duke
Veteran Member
Join Date: Apr 2005
Location: Walla Walla
Old 12-08-2005 , 11:16  
Reply With Quote #28

With a couple exceptions, I've changed all of my "broken" functions to sig scans using BAILOPAN's methods. The signatures may change occasionally, but I record how I find them in case they do and it's not too big of a deal to find new ones and recompile if they do change.

I'm using this for things like CBaseCombatCharacter::Weapon_GetSlot, CBaseCombatWeapon::GetName, etc.

Here are the articles he wrote on the devlog in case you missed them:
Oh, you’ve not hacked yet?
Finding Functions, Part 2
Finding Functions, Part 3
__________________
"Good grammar is essential, Robin."
- Batman
L. Duke is offline
[email protected]
Member
Join Date: Dec 2005
Old 12-08-2005 , 22:33  
Reply With Quote #29

Beetle:

I went through again and tried to see if I missed anything last time in the headers. I made a few changes. Teleport definately works now, I tested it out. Only thing is, somewhere along the way I'm still missing or adding a virtual function or two, because now CBasePlayer::CommitSuicide( ) wont work. The updated files are in the .zip again.

Quote:
Originally Posted by L. Duke
With a couple exceptions, I've changed all of my "broken" functions to sig scans using BAILOPAN's methods. The signatures may change occasionally, but I record how I find them in case they do and it's not too big of a deal to find new ones and recompile if they do change.

I'm using this for things like CBaseCombatCharacter::Weapon_GetSlot, CBaseCombatWeapon::GetName, etc.

Here are the articles he wrote on the devlog in case you missed them:
Oh, you’ve not hacked yet?
Finding Functions, Part 2
Finding Functions, Part 3
You wouldn't happen to be interesting in posting the sigs would you?
Lojo.jacob@gmail.com is offline
L. Duke
Veteran Member
Join Date: Apr 2005
Location: Walla Walla
Old 12-08-2005 , 22:40  
Reply With Quote #30

I'll email them to your "user name"

__________________
"Good grammar is essential, Robin."
- Batman
L. Duke is offline
Reply



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 07:59.


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