Skip to content

Extract tools usage #23

Description

@nashi5566

Hi, I've try the extract tools included in firmware_tools/extract_tools to unpack the NOE77101.bin but facing some problem.

Star extract files
file_name: b' Executive firmw'
file_offset: 0x20657261
file_length: 779248982
file_name: b''
file_offset: 0x00010000
file_length: 4294967295
file_name: b'\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff'
file_offset: 0xffffffff
file_length: 4294967295
Traceback (most recent call last):
  File "/vxhunter/firmware_tools/extract_tools/cisco_firmware_extractor.py", line 102, in <module>
    extract_firmware(firmware_file_data, output_path)
  File "/vxhunter/firmware_tools/extract_tools/cisco_firmware_extractor.py", line 40, in extract_firmware
    output_file = open("{}/{:#08x}_{}".format(output_path, file_offset, file_name.decode('utf-8'), ), 'wb')
                                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte

And I've try the examples in the repo, there was also some problem in utf-8 decoding while generating output files.

Star extract files
file_name: b'\x01\xf0)\xe1\x0e\xf0\xa0\xe1\x10\x0f\xe1@\x10\xc1\xe3'
file_offset: 0xe2000040
file_length: 3783331840
Traceback (most recent call last):
  File "/vxhunter/firmware_tools/extract_tools/cisco_firmware_extractor.py", line 102, in <module>
    extract_firmware(firmware_file_data, output_path)
  File "/vxhunter/firmware_tools/extract_tools/cisco_firmware_extractor.py", line 40, in extract_firmware
    output_file = open("{}/{:#08x}_{}".format(output_path, file_offset, file_name.decode('utf-8'), ), 'wb')
                                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf0 in position 1: invalid continuation byte

According to the slides and the README there is less information about how to use the tools, I wonder if I mistaken the correct usage and the understanding of it.

My environment is

  • MacBook Air M2
  • MacOS Sequoia 15.2
  • Python 3.11

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions