14 CRC32: Ethernet (Poly 0x04C11DB7)
17 0x00005700: Any version
18 0x00005731: NAND 1MB data partition
19 0x00005732: Normal version
39 0x00000002: Secure BootROM
53 def create_tag(args
, in_bytes
):
54 # JAM CRC32 is bitwise not and unsigned
55 crc
= ~binascii
.crc32(in_bytes
) & 0xFFFFFFFF
67 def create_output(args
):
68 in_st
= os
.stat(args
.input_file
)
69 in_size
= in_st
.st_size
71 in_f
= open(args
.input_file
, "r+b")
72 in_bytes
= in_f
.read(in_size
)
75 tag
= create_tag(args
, in_bytes
)
77 out_f
= open(args
.output_file
, "w+b")
86 parser
= argparse
.ArgumentParser(description
="")
109 help="WFI Tag Version",
125 help="WFI Flash Type",
129 "--flags", dest
="flags", action
="store", type=auto_int
, help="WFI Flags"
132 args
= parser
.parse_args()
138 (not args
.input_file
)
139 or (not args
.output_file
)
140 or (not args
.tag_version
)
141 or (not args
.chip_id
)
142 or (not args
.flash_type
)