Lines Matching refs:f

69         with open(elf, "rb") as f:
70 e = ELFFile(f)
72 assert section, f"{section_name} should be in the ELF"
78 f"comparing seg {seg.addr:#x} sec {sh_addr:#x} len {len(data):#x}"
82 ), f"{section_name} should not be in the binary image"
89 with open(elf, "rb") as f:
90 e = ELFFile(f)
92 assert section, f"{section_name} should be in the ELF"
101 f"comparing seg {seg.addr:#x} sec {sh_addr:#x} len {len(data):#x}"
107 ), f"ELF '{section_name}' section has mis-matching bin image data"
113 f"ELF {elf} section '{section_name}' has no encompassing"
114 f" segment(s) in bin image (image segments: {image.segments})"
177 with open(self.ELF, "rb") as f:
178 e = ELFFile(f)
235 with open(elfpath, "rb") as f:
236 e = ELFFile(f)
241 f"irom segment ({len(irom_segment.data):#x}) should be same size "
242 f"(16 padded) as .irom0.text section ({sh_size:#x})"
246 with open(binpath, "rb") as f:
247 f.seek(-4, os.SEEK_END)
248 image_len = f.tell()
249 crc_stored = struct.unpack("<I", f.read(4))[0]
250 f.seek(0)
251 crc_calc = esptool.bin_image.esp8266_crc32(f.read(image_len))
355 with open(BIN, "rb") as f:
356 header = f.read(4)
357 print(f"header {header}")
382 with open(BIN, "rb") as f:
383 header = f.read(24)
448 extra_args=["--elf-sha256-offset", f"{self.SHA_OFFS:#x}"],
456 with open(self.ELF, "rb") as f:
457 elf_computed_sha256 = hashlib.sha256(f.read()).digest()
459 with open(self.BIN, "rb") as f:
460 f.seek(self.SHA_OFFS)
461 bin_sha256_raw = f.read(len(elf_computed_sha256))
497 with open(self.BIN, "rb") as f:
498 bin_with_hash = f.read()
514 with open(self.BIN, "rb") as f:
515 bin_without_hash = f.read()