-
Notifications
You must be signed in to change notification settings - Fork 530
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
check if the instruction reads/writes a part of the given register #458
Conversation
What about that?: - if (pair.first.getId() == target.getConstRegister().getId())
- return true;
+ if (pair.first.getParent().getId() == target.getConstRegister().getParent().getId())
+ return true; (doing the check only on parent registers) |
If an instruction writes to AH, then we don't want to match if we are checking whether it writes AL. However we do want to match if we are checking whether it writes EAX. |
Mmmh okay. But in your case you are thinking about 32-bits. It's not true for 64-bits. E.g: if you provide |
I think you should deal with subset and bitvector. Thus, it is going to be valid for multi-architectures. |
It could be done like this: if (pair.first.getParent().getId() == target.getConstRegister().getParent().getId()) {
if (pair.first.getLow() <= target.getConstRegister().getLow() && target.getConstRegister().getLow() <= pair.first.getHigh()) return true;
if (target.getConstRegister().getLow() <= pair.first.getLow() && pair.first.getLow() <= target.getConstRegister().getHigh()) return true; |
Something like that yep. And this just shown me that |
This works for memory access: auto &&m1 = pair.first;
auto &&m2 = target.getConstMemory();
if (m1.getAddress() <= m2.getAddress() && m2.getAddress() < m1.getAddress()+m1.getSize())
return true;
if (m2.getAddress() <= m1.getAddress() && m1.getAddress() < m2.getAddress()+m2.getSize())
return true; |
No description provided.