Skip to content

Commit 6ea3f16

Browse files
authored
Fix detour_does_code_end_function for ARM64 (#348)
It incorrectly returned FALSE for br <reg> instructions.
1 parent ea6c4ae commit 6ea3f16

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/detours.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1228,7 +1228,7 @@ inline BOOL detour_does_code_end_function(PBYTE pbCode)
12281228
if (detour_is_code_os_patched(pbCode)) {
12291229
return FALSE;
12301230
}
1231-
if ((Opcode & 0xfffffc1f) == 0xd65f0000 || // br <reg>
1231+
if ((Opcode & 0xffbffc1f) == 0xd61f0000 || // ret/br <reg>
12321232
(Opcode & 0xfc000000) == 0x14000000) { // b <imm26>
12331233
return TRUE;
12341234
}

0 commit comments

Comments
 (0)