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

Add support for debug entry iteration #123

Closed
woodruffw opened this issue Mar 31, 2020 · 3 comments
Closed

Add support for debug entry iteration #123

woodruffw opened this issue Mar 31, 2020 · 3 comments
Milestone

Comments

@woodruffw
Copy link
Member

We should add a high-level iter-style API for the debug data directory entry vector, similar to the other iter-style APIs.

One challenge: the contents of the debug entries are heterogeneously typed and have drastically different contents. Maybe a visitor pattern instead, where IterDebug is registered with a struct of callbacks, one per type.

See trailofbits/winchecksec#44.

@woodruffw
Copy link
Member Author

One downside to the visitor-style iter design: most entries in the vector will probably be one of a kind, so there isn't much of a point in "iterating" over them.

Some options:

  1. VFS-style visitor pattern:
visitors = { .extended_dll_characteristics = some_func, /* ... */ };
VisitDebugEntries(pe, visitors);
  1. Individual iter-style interfaces for each type:
IterDebugCodeviewEntries(pe, /* ... */);
IterDebugReproEntries(pe, /* ... */);
  1. Others?

@woodruffw woodruffw added this to the 2.0 milestone Jun 4, 2020
@woodruffw
Copy link
Member Author

cc @yardenshafir for visibility: this is the backing work we'll need for CET detection in winchecksec.

@woodruffw
Copy link
Member Author

I think we can consider this closed. Users can use the functionality in #173 to iterate over the referenced debug entries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant