Skip to content

Commit

Permalink
Fix: #1342
Browse files Browse the repository at this point in the history
Handle `endbr..` instructions in x86-64 ELF PLT stubs.
  • Loading branch information
uxmal committed Apr 18, 2024
1 parent cbba51e commit d90bdc7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Environments/SysV/ArchSpecific/TrampolineFinder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,14 @@ public static (Expression?, Address?) X86_64(IProcessorArchitecture arch, Addres
var instr = instrs.FirstOrDefault();
if (instr == null)
return null;
// Eat leading nops; these are caused by endbr64 instructions.
if (instr is RtlNop)
{
instrs = instrs.Skip(1);
instr = instrs.FirstOrDefault();
if (instr is null)
return null;
}
// Match x86-64 pattern.
// jmp [destination]
Address? addrTarget = null;
Expand Down

0 comments on commit d90bdc7

Please sign in to comment.