Skip to content

Commit

Permalink
Fix endianness macros
Browse files Browse the repository at this point in the history
  • Loading branch information
WorksButNotTested authored and Your Name committed Jan 29, 2025
1 parent eec2250 commit b164180
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions gum/arch-arm64/gumarm64writer.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ gum_arm64_writer_init (GumArm64Writer * writer,
writer->ref_count = 1;
writer->flush_on_destroy = TRUE;

writer->data_endian = __BYTE_ORDER__;
writer->data_endian = G_BYTE_ORDER;
writer->target_os = gum_process_get_native_os ();
writer->ptrauth_support = gum_query_ptrauth_support ();
writer->sign = gum_sign_code_address;
Expand Down Expand Up @@ -1995,7 +1995,7 @@ gum_arm64_writer_commit_literals (GumArm64Writer * self)

for (slot = first_slot; slot != last_slot; slot++)
{
if (self->data_endian == __ORDER_LITTLE_ENDIAN__)
if (self->data_endian == G_LITTLE_ENDIAN)
{
if (GINT64_FROM_LE (*slot) == r->val)
break;
Expand All @@ -2010,7 +2010,7 @@ gum_arm64_writer_commit_literals (GumArm64Writer * self)

if (slot == last_slot)
{
if (self->data_endian == __ORDER_LITTLE_ENDIAN__)
if (self->data_endian == G_LITTLE_ENDIAN)
{
*slot = GINT64_TO_LE (r->val);
}
Expand Down Expand Up @@ -2043,7 +2043,7 @@ gum_arm64_writer_commit_literals (GumArm64Writer * self)

for (slot = first_slot; slot != last_slot; slot++)
{
if (self->data_endian == __ORDER_LITTLE_ENDIAN__)
if (self->data_endian == G_LITTLE_ENDIAN)
{
if (GINT32_FROM_LE (*slot) == r->val)
break;
Expand All @@ -2057,7 +2057,7 @@ gum_arm64_writer_commit_literals (GumArm64Writer * self)

if (slot == last_slot)
{
if (self->data_endian == __ORDER_LITTLE_ENDIAN__)
if (self->data_endian == G_LITTLE_ENDIAN)
{
*slot = GINT32_TO_LE (r->val);
}
Expand Down
6 changes: 3 additions & 3 deletions gum/arch-arm64/gumarm64writer.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ typedef guint GumArm64IndexMode;

/*
* Valid values for this field are:
* - __ORDER_LITTLE_ENDIAN__
* - __ORDER_BIG_ENDIAN__
* - __BYTE_ORDER__ (an alias for one of the above)
* - G_LITTLE_ENDIAN
* - G_BIG_ENDIAN
* - G_BYTE_ORDER (an alias for one of the above)
*/
typedef guint GumArm64DataEndian;

Expand Down

0 comments on commit b164180

Please sign in to comment.