View Single Post
StrikerMan780
AlliedModders Donor
Join Date: Jul 2009
Location: Canada
Old 04-09-2016 , 10:54   Re: [IDA/DHooks]How to get vtable offsets
Reply With Quote #44

I found this: https://forums.alliedmods.net/showpo...&postcount=129
and this: https://forums.alliedmods.net/showpo...2&postcount=60

Neither make sense to me.

What does "read" and "keys" do, what do the sections mean, why doesn't the name of the interface match what it says in IDA? HOW do I find the correct name for the interface to hook? Nothing makes sense, and the lack of GameData documentation on the Wiki is pretty horrendous. (Finding VTable offsets is the only thing I could find.) I don't see how to target a specific vtable, or a specific dll/so file and what any of the syntax means.

EDIT: Found the interface by pure stroke of luck and an educated guess, but the steps I need to take to get it weren't gone over by anybody (as far as I could see). So I will.

When I was looking to hook CEngineSoundServer::SetPlayerDSP, I needed to find the interface, so I went to the base function in the class


In this case it was CEngineSoundServer::~CEngineSoundServer()

So, I clicked on it, and clicked on the first line of the function, like so:


Then, clicked "Jump", then "Jump to Cross-Reference"

Click on the global subroutine, like so, and hit OK.


Which should lead you to a page, where, if you look down a little, you can see the interface name. I highlighted it in this image:


Here is my resulting gamedata:
Code:
"Games"
{
	"#default"
	{
		"Keys"
		{
			"EngineInterface"	"IEngineSoundServer003"
		}
		"Signatures"
		{
			"CreateInterface"
			{
				"library"		"engine"
				"windows"		"@CreateInterface"
				"linux"			"@CreateInterface"
			}
		}
		"Offsets"
		{
			"SetPlayerDSP"
			{
				"windows"	"9"
				"linux"		"10"
			}
		}
	}
}

Last edited by StrikerMan780; 04-09-2016 at 11:25.
StrikerMan780 is offline