Return True if the given file is an ELF file
(filename: pathlib.Path)
| 123 | |
| 124 | |
| 125 | def is_elf(filename: pathlib.Path) -> bool: |
| 126 | "Return True if the given file is an ELF file" |
| 127 | try: |
| 128 | elf_header = b"\x7fELF" |
| 129 | with open(filename, "br") as thefile: |
| 130 | return thefile.read(4) == elf_header |
| 131 | except OSError: |
| 132 | return False |
| 133 | |
| 134 | |
| 135 | def get_thread_name(pid: int, tid: int) -> Optional[str]: |
no outgoing calls