Lines Matching refs:output_file
78 output_file = _set_input_and_output(esiost_args)
79 _check_chip(output_file, esiost_args)
81 _copy_image(output_file, esiost_args)
82 _set_anchor(output_file, esiost_args)
83 _set_firmware_load_start_address(output_file, esiost_args)
84 _set_firmware_entry_point(output_file, esiost_args)
85 _set_firmware_length(output_file, esiost_args)
86 _set_firmware_load_hash(output_file, esiost_args)
87 _set_firmware_segment(output_file, esiost_args)
88 _set_firmware_segment_hash(output_file, esiost_args)
122 output_file = Path("out_" + input_file_path.name)
124 output_file = Path(output)
126 if output_file.exists():
127 if output_file.samefile(input_file_path):
131 output_file.unlink()
133 output_file.touch()
140 return output_file
167 with output.open("r+b") as output_file:
168 output_file.seek(HDR_ANCHOR_OFFSET)
170 output_file.write(anchor_hex)
175 output_file.close()
217 with output.open("r+b") as output_file:
242 output_file.seek(HDR_FW_FLASH_ADDR_START_LOAD_OFFSET)
243 output_file.write(start_flash_addr.to_bytes(4, "little"))
246 output_file.seek(HDR_FW_FLASH_ADDR_END_LOAD_OFFSET)
247 output_file.write(end_flash_addr.to_bytes(4, "little"))
250 output_file.seek(HDR_FW_LOAD_START_ADDR_OFFSET)
251 output_file.write(fw_load_addr.to_bytes(4, "little"))
264 output_file.close()
298 with output.open("r+b") as output_file:
299 output_file.seek(HDR_FW_ENTRY_POINT_OFFSET)
300 output_file.write(fw_entry_pt.to_bytes(4, "little"))
301 output_file.close()
333 with output.open("r+b") as output_file:
334 output_file.seek(HDR_FW_LENGTH_OFFSET)
335 output_file.write(fw_length.to_bytes(4, "big"))
340 output_file.close()
359 with output.open("r+b") as output_file:
360 output_file.seek(HDR_FW_LOAD_HASH_OFFSET)
361 output_file.write(hash_data)
362 output_file.close()
375 with output.open("r+b") as output_file:
377 output_file.seek(HDR_FW_SEG1_START_OFFSET)
378 output_file.write(FW_HDR_SEG1_START.to_bytes(4, "little"))
379 output_file.seek(HDR_FW_SEG1_SIZE_OFFSET)
380 output_file.write(FW_HDR_SEG1_SIZE.to_bytes(4, "little"))
383 output_file.seek(HDR_FW_SEG2_START_OFFSET)
384 output_file.write(FW_HDR_SEG2_START.to_bytes(4, "little"))
385 output_file.seek(HDR_FW_SEG2_SIZE_OFFSET)
386 output_file.write(FW_HDR_SEG2_SIZE.to_bytes(4, "little"))
389 output_file.seek(HDR_FW_SEG3_START_OFFSET)
390 output_file.write(FW_HDR_SEG3_START.to_bytes(4, "little"))
391 output_file.seek(HDR_FW_SEG3_SIZE_OFFSET)
392 output_file.write(fw_length.to_bytes(4, "little"))
395 output_file.seek(HDR_FW_SEG4_START_OFFSET)
396 output_file.write(FW_HDR_SEG4_START.to_bytes(4, "little"))
397 output_file.seek(HDR_FW_SEG4_SIZE_OFFSET)
398 output_file.write(FW_HDR_SEG4_SIZE.to_bytes(4, "little"))
435 output_file.close()
444 output_file = Path(output)
446 seg1_file = Path("seg1_" + output_file.name)
459 with output.open("r+b") as output_file:
461 output_file.seek(HDR_FW_SEG1_START_OFFSET)
462 seg1_start = int.from_bytes(output_file.read(4), "little")
463 output_file.seek(HDR_FW_SEG1_SIZE_OFFSET)
464 seg1_size = int.from_bytes(output_file.read(4), "little")
465 output_file.seek(seg1_start)
467 seg1_data = output_file.read(seg1_size)
469 seg1_file_path = Path("seg1_" + output_file.name)
477 output_file.seek(HDR_FW_SEG1_HASH_OFFSET)
478 output_file.write(hash_data)
482 output_file.seek(HEADER_SIZE)
484 for byte_block in iter(lambda: output_file.read(4096), b""):
489 output_file.seek(HDR_FW_SEG3_HASH_OFFSET)
490 output_file.write(hash_data)
524 with open(output, "r+b") as output_file:
526 output_file.seek(HEADER_SIZE)
528 output_file.write(line)
529 output_file.close()
551 output_file = Path(output)
552 if output_file.exists():
553 output_file.unlink()