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

GetInstructionSize returns wrong value for four byte sub rsp #7

Closed
ProN00b opened this issue Apr 21, 2024 · 2 comments
Closed

GetInstructionSize returns wrong value for four byte sub rsp #7

ProN00b opened this issue Apr 21, 2024 · 2 comments

Comments

@ProN00b
Copy link

ProN00b commented Apr 21, 2024

GetInstructionSize returns wrong value for
48 81 ec d0 00 00 00 sub rsp,0xd0
returns 11, should return 7.

@VXACDev
Copy link

VXACDev commented May 9, 2024

    else if ((HOOK_R < 4 && (HOOK_C == 5 || HOOK_C == 0xD)) || (HOOK_R == 0xB && HOOK_C >= 8) || (*b == 0xF7 && !(*(b + 1) & 48)) || FindByte(OP1_IMM32, sizeof(OP1_IMM32), *b))

"& 48" ?? I think this should be & 0x48
This is actually in 2 places. I could be wrong, but decimal 48 (0x30) seems... wrong??

@SamuelTulach
Copy link
Owner

The handling was indeed incorrect. I've added more checks and added a test program. It should now correctly handle instructions with REX.W bit set. Please let me know if you find any more problems.

image

^ old version would fail at 30+ instances

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

No branches or pull requests

3 participants