-
-
Notifications
You must be signed in to change notification settings - Fork 323
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
libafl_frida: Make cmplog work on x64 #1713
Conversation
I tried this on linux. and from what I observed, the recorded metadata is not correct. For example, I changed the harness (in frida_libpng) to
but then the recorded metadata is
|
Did you consider https://github.com/iximeow/yaxpeax-x86 ? If we do need more dependencies we might as well go with something that's potentially cross architecture? |
could you try again please? @tokatoka
Thanks for the suggestion @domenukk 👍 however, I also need to generate instructions with registers taken from disassembly. Frida |
d557c3b
to
8caabf2
Compare
i'll check this soon |
but do you have any idea for resolving register collision? because now you hide the register name behind |
Register collision fix is already pushed. Do you experience any issues related to this?
…________________________________
From: tokatoka ***@***.***>
Sent: Thursday, December 28, 2023 8:04:57 PM
To: AFLplusplus/LibAFL ***@***.***>
Cc: expend20 ***@***.***>; Author ***@***.***>
Subject: Re: [AFLplusplus/LibAFL] DRAFT: POC attempt to make cmplog work on x64 (PR #1713)
but do you have any idea for resolving register collision?
if not i think we can simply handle every corner cases.
—
Reply to this email directly, view it on GitHub<#1713 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AIWZYPYYHJAUOOEULDEGRXLYLYJLTAVCNFSM6AAAAABAG5J2EWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZRGY2TIOBXGA>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
no i haven't got a machine to test yet 😅 |
837a509
to
009f114
Compare
This is still a draft, right? |
yeah, need to craft fuzz targets in assembly to cover all the edge cases of instrumentation |
works for me 👍 |
look good. |
I'm pretty close to removing the draft mark, just getting some bugs with more testing |
Some tiny clippy nags remain: error: casting `u64` to `i64` may wrap around the value
--> libafl_frida/src/cmplog_rt.rs:671:17
|
671 | instruction.memory_displacement64() as i64,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_wrap
note: the lint level is defined here
--> libafl_frida/src/lib.rs:10:9
|
10 | #![deny(clippy::pedantic)]
| ^^^^^^^^^^^^^^^^
= note: `#[deny(clippy::cast_possible_wrap)]` implied by `#[deny(clippy::pedantic)]`
error: could not compile `libafl_frida` (lib test) due to 1 previous error /edit: removed unrelated warnings from this comment. |
yeah I'll fix that, I also have some tests which are not yet commited but failing on my machine
in that specific case I need to cast unsigned to signed and try_ gives me a panic, so I removed it PS: bear with me guys, I'll remove Draft mark, squash commits and let you know explicitly when it's ready for final review |
Sorry, just tried to be helpful :) |
No need to squash btw, we squash everything when we merge anyway |
windows POC seems working unix POC seems working :) * no register collisions * rsp-related ref support iced optional dep iced depends on cmplog warnings one more warning comments cleanup ci unbreak rebase windows unbreak rebase unix unbreak unix only fmt check clang formatting clang formatting again make clippy happy formatting double import windows unbreak hashmap is conditional leftover definition tutorial related formatter review fixes comments .asm fuzz targets for cmplog on Windows more tests rip-relative reference support without index register form proper ignore rip-related references and ignore 8 bit comparisons another try_into packing
9bb2c99
to
6b71b7d
Compare
Diff in /home/runner/work/LibAFL/LibAFL/libafl_frida/src/cmplog_rt.rs at line 879:
Self::new()
}
} This will need a |
Hm, I didn't write that code, and it's how it is in main branch, I guess during one of the rebases I enabled clippy, but it's actually disabled in main. Leaving as-is for now. |
… into cmplog-windows-x64
CI is 🟢 and there is no open conversations at the moment ✅ |
thanks @expend20 |
Aweseome! :) |
#823
Currently it stuck on not producing expected values to the input, despite call to
__libafl_targets_cmplog_instructions
seems correct at first glance