AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   Gamedata Checker (https://forums.alliedmods.net/showthread.php?t=186248)

psychonic 05-27-2012 12:05

Gamedata Checker
 
I don't know how many people that this will be useful too (as it takes some effort to set up), but I've decided to clean up and share the code for my gamedata checker, as well as some scripts to work with it. Some of it is a bit of a mess, but SHARING IS CARING.

Essentially, it's a small, linux program, originally based on Fyren's gdc. It checks for matches to byte signatures in both the linux and windows binaries, and symbol names in the linux binaries. It also looks for changes to vtable offsets in the linux binary, and will make a guess as to the new offset on windows if there was a change. This is all done by giving it the gamedata file, and paths to the linux and windows binaries for the engine and server.

The source, light documentation, and scripts can be found here.
https://hg.alliedmods.net/sourcemod-...ls/gdc-psyfork

Some of you have already seen my irc bot announce updates, along with gamedata changes. This program is what generates that output.

From the last CS:S update:
[16:36] <iboT2> CStrike Update - Gamedata check: http://users.alliedmods.net/~psychon...02-cstrike.log

To view any of the auto-logs as they're added from game updates: http://users.alliedmods.net/~psychonic/gdc/?C=M;O=D

glhf :crab:

psychonic 07-03-2012 10:32

Re: Gamedata Checker
 
This has been updated in the SM repo.

Changes include:
- Further cleaned up output format, including prefixing changed/notfound lines with "!".
- Removed requirement of "_vt" symbol lines for functions not existing on CBaseEntity.
- Added detection for Windows signatures that match multiple times or match but not at the start of a function.
- Updated symbols.txt with the latest in use.

API 07-05-2012 14:11

Re: Gamedata Checker
 
This is dope psy! Nice!

zeroibis 07-08-2012 11:59

Re: Gamedata Checker
 
Something this got me thinking about. Would it be possible to have a Meta Mod plugin that is able to do the same thing and then actually update the game data files or generate test ones for the user to try out automatically. It would be great if there actually was a simple way to allow for servers to auto update changes.

psychonic 07-08-2012 12:13

Re: Gamedata Checker
 
Quote:

Originally Posted by zeroibis (Post 1746121)
Something this got me thinking about. Would it be possible to have a Meta Mod plugin that is able to do the same thing and then actually update the game data files or generate test ones for the user to try out automatically. It would be great if there actually was a simple way to allow for servers to auto update changes.

Go for it if you want.

Some reasons that I haven't:
It would only be possible for virtual function offsets, and with the current code, only offsets on linux could be guaranteed to be correct.

That also doesn't take into account writing gamedata back out, which is extra difficult with how it's structured. Multiple files and even multiples of same sections in a file all get combined and flattened internally, without the info needed to write them back out. It would be much extra effort to keep all of the data required to write them back out as they were, rather than a single file per engine or game, with everything that got combined into it.

Another, possibly smarter approach would be to add another gamedata section type to SM, AutoOffset or something that takes a signature or symbol name and just looks up the offset from the vtable on the fly (similar to the checker), but then it still breaks if that signature changes, being more difficult to fix for signatures than the original offset would be, which is one reason why I haven't bothered to add it for Windows yet, and instead use a guess.

zeroibis 07-09-2012 09:36

Re: Gamedata Checker
 
Quote:

Originally Posted by psychonic (Post 1746126)
Go for it if you want.

If only I was a real programmer lol... I can imagine it is hard which is why it has not been done yet and something like this being hard for you guys is like oh throwing that ship was hard for superman but maybe you can do better rofl.

Despite the fact that I am in these forms a lot working on code I am a business major that works in telecommunications. I learned how to program java in HS and that is it. I am sure I could pickup MM in a few years but most of what I know and have learned has been thanks to the help of all the great people at SM over the years :wink:

On that note (and possible even more off topic) thanks again everyone for all your help over the years in helping us noobs learn to program! The great community here is what has allowed all of these amazing mods to prosper, thanks again! :crab:

berni 07-09-2012 10:38

Re: Gamedata Checker
 
Quote:

Originally Posted by psychonic (Post 1746126)
but then it still breaks if that signature changes, being more difficult to fix for signatures than the original offset would be, which is one reason why I haven't bothered to add it for Windows yet, and instead use a guess.

If the signature of a function changes (ie.: a parameter got changed), you would have to change the Call or Hook-Code anyway, wouldn't you ? The only problem I see is windows because it doesn't have symbols in the binaries.
Also some kind of caching would be nice then, something that compares the checksum of a library and loads the memory addresses from the cache instead of doing a pattern search / vtable offset resolving every time.

psychonic 07-09-2012 10:41

Re: Gamedata Checker
 
Quote:

Originally Posted by berni (Post 1746690)
If the signature of a function changes (ie.: a parameter got changed), you would have to change the Call or Hook-Code anyway, wouldn't you ? The only problem I see is windows because it doesn't have symbols in the binaries.

If the symbol name in the linux bin changed, yes, there is a good chance that the function call would have to change as well, (although we once ran into a single instance when this wasn't the case. Valve had just renamed a class). The issue is indeed mostly with Windows, and I'm not crazy about supporting a feature like that for a single OS, or with the assumption that symbol names will always be available on linux; (They aren't always on all games). But as I said, anyone else is free to give it a shot.

GoD-Tony 07-10-2012 10:54

Re: Gamedata Checker
 
I've seen this bot on IRC and it's very slick. Looks like it's gone through a lot of changes judging by the old logs. Nice job!

Would you be willing to add gamedata from community plugins to your bot? :)

psychonic 07-10-2012 10:56

Re: Gamedata Checker
 
Quote:

Originally Posted by GoD-Tony (Post 1747395)
I see this bot on IRC and it's very slick. Looks like it's gone through a lot of changes judging by the old logs. Nice job!

Would you be willing to add gamedata from community plugins to your bot? :)

Sure, and I already have some.

The biggest prerequisite is having the gamedata in a repository, either public or one that I can otherwise be granted access to, so that I don't have to manually keep the file up to date.

Shoot me a PM or catch me on irc to sort out details.


All times are GMT -4. The time now is 02:25.

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