Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

a1batross
Copy link

@a1batross a1batross commented Apr 28, 2024

Imagine a situation where MemoryUtils::ResolveSymbol for some reason fails.
(not yet supported engine for example ( ͡° ͜ʖ ͡°))

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.

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.
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.

1 participant