Skip to content

Detect SA-MP builds by PE signature before the version resource - #55

Merged
NeekoGta merged 1 commit into
aurora-mp:mainfrom
Masvidal99:fix/samp-version-detection
Oct 14, 2026
Merged

NeekoGta merged 1 commit into
aurora-mp:mainfrom
Masvidal99:fix/samp-version-detection

Conversation

@Masvidal99

Copy link
Copy Markdown
Contributor

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:

Build TimeDateStamp SizeOfImage
0.3.7-R1 0x5542F47A 0x330000
0.3.7-R3-1 0x5C0B4243 0x27E000
0.3.7-R5-1 / R5-2 0x6372C39E 0x27E000
0.3.DL-R1 / SAMP Addon 0x5A6A3130 0x2BE000

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.

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.
@NeekoGta
NeekoGta merged commit 2b7c7d7 into aurora-mp:main Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants