Skip to content

Graceful handling for invalid target function#16

Open
m417z wants to merge 1 commit intoKNSoft:mainfrom
m417z:handle-invalid-func
Open

Graceful handling for invalid target function#16
m417z wants to merge 1 commit intoKNSoft:mainfrom
m417z:handle-invalid-func

Conversation

@m417z
Copy link
Copy Markdown

@m417z m417z commented Apr 5, 2025

Fixes #14.

Note that this fix is not 100% complete. For example, the x64 command FF 01 is valid, but FF FF isn't. Still, both are reported as 2-byte commands.

I'm not an assembly guru, but this comment:

Makes me think that perhaps a check like if (b1 & 0x80) return NULL; (edit: probably if ((b1 & 0x38) == 0x38) return NULL;) will cover this case and similar cases where this comment is found.

I don't know if other adjustments are required, and I didn't want to make changes in these sensitive areas which I don't fully understand.

@RatinCN
Copy link
Copy Markdown
Member

RatinCN commented Apr 6, 2025

Me too, I may need some time to confirm.

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.

Graceful handling for invalid target function

2 participants