Skip to content

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/SlimDetours/Instruction.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -767,15 +767,15 @@ BOOL
767767
detour_does_code_end_function(
768768
_In_ PBYTE pbCode)
769769
{
770-
ULONG Opcode = fetch_opcode(pbCode);
771-
772770
// When the OS has patched a function entry point, it will incorrectly
773771
// appear as though the function is just a single branch instruction.
774772
if (detour_is_code_os_patched(pbCode))
775773
{
776774
return FALSE;
777775
}
778-
if ((Opcode & 0xfffffc1f) == 0xd65f0000 || // br <reg>
776+
777+
ULONG Opcode = fetch_opcode(pbCode);
778+
if ((Opcode & 0xffbffc1f) == 0xd61f0000 || // ret/br <reg>
779779
(Opcode & 0xfc000000) == 0x14000000) // b <imm26>
780780
{
781781
return TRUE;

0 commit comments

Comments
 (0)