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

Retrieving core and plugin info from an external app written in c++


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
fakuivan
Senior Member
Join Date: Nov 2015
Old 10-21-2016 , 18:57   Retrieving core and plugin info from an external app written in c++
Reply With Quote #1

I need to get sm's version installed on a server and some basic info from plugins (author, name, version). Where can I find the headers? What binaries do I need to load?
fakuivan is offline
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Old 10-21-2016 , 23:48   Re: Retrieving core and plugin info from an external app written in c++
Reply With Quote #2

The source headers are not included in the release archives. However, there is a version in the scripting headers inside version_auto.inc.

To get info out of plugins, you're going to have to write code to parse the SMX format. There is probably zero documentation, so you'd have to look at SP's source code (smx-v1-image.cpp/.h) or find tools others have made (like the decompiler or https://forums.alliedmods.net/showthread.php?t=189809).

Last edited by Fyren; 10-21-2016 at 23:48.
Fyren is offline
fakuivan
Senior Member
Join Date: Nov 2015
Old 10-22-2016 , 00:23   Re: Retrieving core and plugin info from an external app written in c++
Reply With Quote #3

That seems complicated. Is there a way to pull that info out of the binaries?

sourcemm_api.cpp
Code:
const char *SourceMod_Core::GetVersion()
{
	return SOURCEMOD_VERSION;
}
GetVersion seems to return a literal. Can I load the binary and call that?
fakuivan is offline
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Old 10-22-2016 , 01:55   Re: Retrieving core and plugin info from an external app written in c++
Reply With Quote #4

For the SM version, it's not going to be impossible but it's not going to be easier than parsing a text file. On Linux, we compile with -fvisibility=hidden. I don't think the situation is better on Windows, but I know less there.
Fyren is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 10-22-2016 , 04:56   Re: Retrieving core and plugin info from an external app written in c++
Reply With Quote #5

On Windows the version information is included in the file properties, so you can just use GetFileVersionInfo / VerQueryValue.
This covers all of SM's DLLs, and a number of 3rd party extensions as well.
__________________

Last edited by asherkin; 10-22-2016 at 04:57.
asherkin 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 13:43.


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