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

Armbe8 patches #1130

Merged
merged 2 commits into from
Jan 17, 2025
Merged

Armbe8 patches #1130

merged 2 commits into from
Jan 17, 2025

Conversation

WorksButNotTested
Copy link
Contributor

Fixes to support ARMBE8

Copy link
Member

@oleavr oleavr left a comment

Choose a reason for hiding this comment

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

Thanks!

@@ -1988,7 +1988,11 @@ namespace Frida {
#elif ARM
target_address &= ~1;

# if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
Copy link
Member

Choose a reason for hiding this comment

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

Does the Vala compiler define this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah. It seems to work just fine. Without the change it dies.

Copy link
Member

Choose a reason for hiding this comment

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

ISTM this will always be false, because I can't see the Vala compiler defining this. (Just grepped through the codebase.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am setting the CFLAGS environment variable before I run ./configure and make to set -mbe8 and it seems to work ok for me. Without this change frida-inject seems to fail? Perhaps vala still uses the C pre-processor and that's why this works?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let me check this and confirm that it is working as expected.

src/linux/helpers/loader.c Outdated Show resolved Hide resolved
src/linux/helpers/loader.c Outdated Show resolved Hide resolved
/* avoid inline initialization to prevent the compiler attempting to insert a call to memset */
/*
* Avoid inline initialization to prevent the compiler attempting to insert
* a call to memset.
Copy link
Member

Choose a reason for hiding this comment

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

Extra space before memset.

/* avoid inline initialization to prevent the compiler attempting to insert a call to memset */
/*
* Avoid inline initialization to prevent the compiler attempting to insert
* a call to memset.
Copy link
Member

Choose a reason for hiding this comment

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

Extra space before memset.

@oleavr oleavr merged commit 7644f3d into frida:main Jan 17, 2025
32 of 37 checks passed
@oleavr
Copy link
Member

oleavr commented Jan 17, 2025

Thanks! 🙌

@WorksButNotTested WorksButNotTested deleted the armbe8-patches branch January 20, 2025 08:39
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.

2 participants