Skip to content

Commit

Permalink
#1549 idiot.
Browse files Browse the repository at this point in the history
  • Loading branch information
koekeishiya committed Dec 7, 2022
1 parent 206c0d6 commit c02de22
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/osax/common.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef SA_COMMON_H
#define SA_COMMON_H

#define OSAX_VERSION "2.0.16"
#define OSAX_VERSION "2.0.17"

#define OSAX_ATTRIB_DOCK_SPACES 0x01
#define OSAX_ATTRIB_DPPM 0x02
Expand Down
17 changes: 1 addition & 16 deletions src/osax/payload.m
Original file line number Diff line number Diff line change
Expand Up @@ -204,21 +204,6 @@ static uint64_t hex_find_seq(uint64_t baddr, const char *c_pattern)
}

#if __arm64__
static int log2_hash_table[32] = { 0, 9, 1, 10, 13, 21, 2, 29, 11, 14, 16, 18, 22, 25, 3, 30, 8, 12, 20, 28, 15, 17, 24, 7, 19, 27, 23, 6, 26, 5, 4, 31};
static uint64_t get_page_address(uint64_t addr)
{
uint32_t key = PAGE_SIZE;

key |= key >> 1;
key |= key >> 2;
key |= key >> 4;
key |= key >> 8;
key |= key >> 16;

int bits = log2_hash_table[(uint32_t)(key*0x07C4ACDD) >> 27];
return (addr >> (bits - 1)) << (bits - 1);
}

uint64_t decode_adrp_add(uint64_t addr, uint64_t offset)
{
uint32_t adrp_instr = *(uint32_t *) addr;
Expand All @@ -236,7 +221,7 @@ uint64_t decode_adrp_add(uint64_t addr, uint64_t offset)
imm12 <<= 12;
}

return get_page_address(offset) + value_64 + imm12;
return (offset & 0xfffffffffffff000) + value_64 + imm12;
}
#endif

Expand Down

0 comments on commit c02de22

Please sign in to comment.