Skip to content

librasan: Simplify assembly patches #3192

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

wfdewith
Copy link
Contributor

@wfdewith wfdewith commented May 3, 2025

Description

@domenukk as per your comment in #3176, I've simplified the assembly patches a bit to remove the Vec usage. The rustfmt::skip attributes are there to keep lines matching with the assembly code in the comments.

Checklist

  • I have run ./scripts/precommit.sh and addressed all comments

@wfdewith wfdewith force-pushed the assembly branch 2 times, most recently from bbcb655 to 472b5b3 Compare May 3, 2025 05:52
@WorksButNotTested
Copy link
Collaborator

Nice. Let's land this.

[0xff, 0xe0].to_vec(),
let addr = destination.to_ne_bytes();
#[rustfmt::skip]
let insns: &[&[u8]] = &[
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Random question @WorksButNotTested can't we also do dynasm here like we do in libafl_frida?

fn generate_instrumentation_blobs(&mut self) {

Would be more maintable than pasting random bytes, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's pretty nice actually, but dynasm doesn't support ARMv7 and PowerPC. We can migrate the supported architectures if you'd like.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. Nobody loves powerpc! Just went with it as it was the lowest common denominator. Happy if you want to port the others though.

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

Successfully merging this pull request may close these issues.

3 participants