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

PE: Skip instruction analysis except for the first frame #22

Closed
ishitatsuyuki opened this issue Mar 1, 2024 · 2 comments
Closed

PE: Skip instruction analysis except for the first frame #22

ishitatsuyuki opened this issue Mar 1, 2024 · 2 comments

Comments

@ishitatsuyuki
Copy link
Contributor

Only the top frame can be potentially in an epilog; further frames should point to a function call, which is by definition outside an epilog. Instruction parsing can be skipped in such cases as a small optimization.

An exception is interruption coming from signal-like primitives. There are no signals on Win32, but access violation exceptions work similarly. These will push a KiUserExceptionDispatcher entry on stack along with a MACHFRAME entry. We should make sure to treat anything beyond a MACHFRAME entry as the same as a first frame.

@ishitatsuyuki
Copy link
Contributor Author

Opened a PoC at #26.

Actually, this was more critical than I thought since the lookup address is shifted by 1 for return address frames. Which means that instruction analysis was basically reading garbage all the time.

@mstange
Copy link
Owner

mstange commented Mar 14, 2024

Fixed by #27.

I've opened #30 and #31 for the remaining work.

@mstange mstange closed this as completed Mar 14, 2024
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

2 participants