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

thisptr-overhaul branch to improve support for virtual bases #224

Closed
sei-eschwartz opened this issue Jun 14, 2022 · 3 comments
Closed

thisptr-overhaul branch to improve support for virtual bases #224

sei-eschwartz opened this issue Jun 14, 2022 · 3 comments

Comments

@sei-eschwartz
Copy link
Collaborator

I am sure I'll forget my progress by the time I get back from vacation, so I'll add some notes here. I added a new fact type, thisPtrDefinition, which expresses pointers as expressions.

Here is an example:

[eschwartz@pd4 Lite]$ cat oo.facts | fgrep sv_3544081266679891044
possibleVFTableWrite(0x402487, 0x40247e, sv_18024155638382103558, 0, sv_3544081266679891044, 0x41238c).
thisPtrDefinition(sv_3544081266679891044, add([read([sv(sv_2925039723046125976, 'Mem'), add([read([sv(sv_2925039723046125976, 'Mem'), sv(sv_10664833297080542982, ecx_0)]), 0x4])]), sv(sv_10664833297080542982, ecx_0)]), 0x402487, 0x40247e).

I added a hash for the "full" or "expanded" thisptr to possibleVFTableWrite, which is sv_3544081266679891044 here. Then we can see the definition of sv_3544081266679891044, which must be describing a virtual base. Notice that the "old" fact information of sv_18024155638382103558 and offset 0 is laughably wrong.

So how do we use this on the vft_overwrite branch? Perhaps by verifying that the address is an offset from ecx at some point.

Originally posted by @edmcman in #222 (comment)

@sei-eschwartz sei-eschwartz self-assigned this Jun 14, 2022
@sei-eschwartz sei-eschwartz changed the title thisptr-overhaul branch thisptr-overhaul branch to improve support for virtual bases Jun 14, 2022
@sei-eschwartz
Copy link
Collaborator Author

This branch adds thisPtrDefinition, which we are going to need to properly support virtual bases.

@sei-eschwartz
Copy link
Collaborator Author

All this branch does is add more information to thisptrs. Is there a reason we can't merge it to master immediately?

@sei-eschwartz
Copy link
Collaborator Author

Unit tests pass

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