Repository navigation
Detect SA-MP builds by PE signature before the version resource - #55
Merged
Merged
Conversation
Some client add-ons (e.g. SAMP Addon) rewrite the version resource of samp.dll while leaving the code untouched; the 0.3.DL-R1 DLL shipped with SAMP Addon reports 0.3.7.1 and was rejected as an unknown version. The official builds are now matched by PE TimeDateStamp and SizeOfImage first, with the version resource kept as a fallback.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SAMP Addon ships a 0.3.DL-R1 samp.dll whose code is byte-identical to the official one, but it changes the version resource to 0.3.7.1. SampVersionManager reads the version resource, so the client logs "Detected SA-MP version : Unknown" and CEF stays disabled.
This change identifies the official builds by PE header first (FileHeader.TimeDateStamp + OptionalHeader.SizeOfImage) and keeps the version resource as a fallback:
Values were taken from the official installers.
Tested with SAMP Addon 2.7 on 0.3.DL-R1: now detected as "0.3.DL-R1 (PE signature)", and CEF works normally.