mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2024-12-25 06:15:37 +03:00
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:
parent
27f451a868
commit
94133965c4
@ -584,8 +584,7 @@ SMCResult CGameConfig::ReadSMC_LeavingSection(const SMCStates *states)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
else
|
||||||
if (!finalAddress)
|
|
||||||
{
|
{
|
||||||
finalAddress = g_MemUtils.DecodeAndFindPattern(addressInBase, TempSig.signature);
|
finalAddress = g_MemUtils.DecodeAndFindPattern(addressInBase, TempSig.signature);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user