(s)
| 176 | } |
| 177 | |
| 178 | def parse_hexstring(s): |
| 179 | length = 0 |
| 180 | byte_data = [] |
| 181 | for num in s.split(' '): |
| 182 | if s.startswith("0x"): |
| 183 | num = num[2:] |
| 184 | while len(num) > 0: |
| 185 | byte_num = num[-2:] |
| 186 | byte_data.append(int(byte_num, 16)) |
| 187 | length += 1 |
| 188 | num = num[0:-2] |
| 189 | return length, byte_data |
| 190 | |
| 191 | |
| 192 | def parse_json(json_text, output_file): |