diff --git a/pwnlib/rop/rop.py b/pwnlib/rop/rop.py index 2032963066..8bab24c7e6 100644 --- a/pwnlib/rop/rop.py +++ b/pwnlib/rop/rop.py @@ -1477,8 +1477,6 @@ def ret2csu(self, edi=Padding('edi'), rsi=Padding('rsi'), # Find an appropriate, non-library ELF. # Prioritise non-PIE binaries so we can use _fini exes = (elf for elf in self.elfs if not elf.library and elf.bits == 64) - if not exes: - log.error('No non-library binaries in [elfs]') nonpie = csu = None for elf in exes: @@ -1488,6 +1486,8 @@ def ret2csu(self, edi=Padding('edi'), rsi=Padding('rsi'), nonpie = elf elif '__libc_csu_init' in elf.symbols: csu = elf + else: + log.error('No non-library binaries in [elfs]') if elf.pie: if nonpie: