Raised This Month: $7 Target: $400
 1% 

Gamedata Checker


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
psychonic

BAFFLED
Join Date: May 2008
Old 05-27-2012 , 12:05   Gamedata Checker
Reply With Quote #1

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

Last edited by psychonic; 04-29-2014 at 13:25. Reason: update some links
psychonic is offline
psychonic

BAFFLED
Join Date: May 2008
Old 07-03-2012 , 10:32   Re: Gamedata Checker
Reply With Quote #2

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.

Last edited by psychonic; 07-03-2012 at 10:35.
psychonic is offline
API
Veteran Member
Join Date: May 2006
Old 07-05-2012 , 14:11   Re: Gamedata Checker
Reply With Quote #3

This is dope psy! Nice!
__________________
API is offline
Send a message via AIM to API
zeroibis
Veteran Member
Join Date: Jun 2007
Old 07-08-2012 , 11:59   Re: Gamedata Checker
Reply With Quote #4

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.
__________________
zeroibis is offline
psychonic

BAFFLED
Join Date: May 2008
Old 07-08-2012 , 12:13   Re: Gamedata Checker
Reply With Quote #5

Quote:
Originally Posted by zeroibis View Post
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.
psychonic is offline
zeroibis
Veteran Member
Join Date: Jun 2007
Old 07-09-2012 , 09:36   Re: Gamedata Checker
Reply With Quote #6

Quote:
Originally Posted by psychonic View Post
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

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!
__________________
zeroibis is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 07-09-2012 , 10:38   Re: Gamedata Checker
Reply With Quote #7

Quote:
Originally Posted by psychonic View Post
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.
__________________
Why reinvent the wheel ? Download smlib with over 350 useful functions.

When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0

Last edited by berni; 07-09-2012 at 10:40.
berni is offline
psychonic

BAFFLED
Join Date: May 2008
Old 07-09-2012 , 10:41   Re: Gamedata Checker
Reply With Quote #8

Quote:
Originally Posted by berni View Post
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.
psychonic is offline
GoD-Tony
Veteran Member
Join Date: Jul 2005
Old 07-10-2012 , 10:54   Re: Gamedata Checker
Reply With Quote #9

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?
__________________

Last edited by GoD-Tony; 07-10-2012 at 10:55.
GoD-Tony is offline
psychonic

BAFFLED
Join Date: May 2008
Old 07-10-2012 , 10:56   Re: Gamedata Checker
Reply With Quote #10

Quote:
Originally Posted by GoD-Tony View Post
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.

Last edited by psychonic; 07-10-2012 at 10:57.
psychonic 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 01:28.


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