amxmodx: do not try to parse a signature starting with @ as hex

Imagine a situation where `MemoryUtils::ResolveSymbol` for some reason fails.

Then the signature gets parsed as a HEX value. The way the `MemoryUtils::DecodeHexString` (called by `MemoryUtils::DecodeAndFindPattern`) works is that it takes any symbols, checks if it's backslash and tries to parse it, otherwise it just silently puts into the buffer.

The problem of this is that the `MemoryUtils::FindPattern` will look for any pattern match, despite it's not a pattern but a symbol name in an ASCII. This might lead to unwanted consequences, and to me, it's better fail here than crash.
This commit is contained in:
Alibek Omarov 2024-04-28 03:33:03 +03:00 committed by GitHub
parent 27f451a868
commit 94133965c4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -584,8 +584,7 @@ SMCResult CGameConfig::ReadSMC_LeavingSection(const SMCStates *states)
}
#endif
}
if (!finalAddress)
else
{
finalAddress = g_MemUtils.DecodeAndFindPattern(addressInBase, TempSig.signature);
}