-
Notifications
You must be signed in to change notification settings - Fork 47
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
Allow analyzing s390x on little-endian hosts #19
Conversation
perl -p -i -e 's/\(&ovl\.value\)/&ovl/g; s/ovl\.value/ovl/g; s/ovl\.fmt\.([a-zA-Z\d_]+)\.([a-z\d]+)/$1_$2(ovl)/g' priv/guest_s390_toIR.c
This looks great! I was able to load your test program in angr and do a little symbolic execution, up to the first call instruction, at which point angr's callstack tracking malfunctions and everything crashes. You may need to hack into this part with an exception for s390x specifically, since as far as I can tell there's no dedicated "link register" in the ISA so you'll have to parse it out of the brasl instruction for the purpose of callstack tracking. |
btw - I follow the valgrind mailing list and as of today, support for a bunch more s390x instructions was just added to vex. idk what you want to do about this - you'll need to redo these commits if you want to pull this commit from upstream or submit your changes to upstream. We're not shy about force-pushing to this repo, so do what you like. |
Yeah, the analysis is still not functional. Another issue I'm currently facing is exrl instruction: in addition to insn bytes, it needs a buffer pointed to by its operand. VEX assumes it lives in its address space, which is not the case under angr. So I'm thinking about adding a callback, through which VEX can request address space contents from angr. I'm thinking about approaching upstream later, once angr more or less works. Also, AFAIK they are preparing a release now, so it's unlikely that they would accept such a big (albeit mostly mechanical) change. |
...I see. I think that sort of callback would be a terrible idea - it would have to be propogated all the way up through pyvex into angr, and would make using pyvex without angr super complicated. One thing we could do instead is to use the pyvex |
For now that sounds really good. In the samples that I currently have, all exrls and their targets belong to the same section. Thanks for all the advice! |
Could not reopen #18, so making a new one.
Split into multiple patches to ease the pain of rebasing.
The worst one is patch 3, but fortunately 99% of it can be redone using the perl one-liner from its commit message.