liyansong2018 / firmware-analysis-plus

Simulate firmware with one click of firmadyne (使用 firmadyne 一键模拟固件)
MIT License
311 stars 30 forks source link

运行时错误 #3

Closed TimelifeCzy closed 3 years ago

TimelifeCzy commented 3 years ago

` Traceback (most recent call last): File "/usr/lib/python3/dist-packages/pexpect/spawnbase.py", line 166, in read_nonblocking s = os.read(self.child_fd, size) OSError: [Errno 5] Input/output error

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3/dist-packages/pexpect/expect.py", line 111, in expect_loop incoming = spawn.read_nonblocking(spawn.maxread, timeout) File "/usr/lib/python3/dist-packages/pexpect/pty_spawn.py", line 485, in read_nonblocking return super(spawn, self).read_nonblocking(size) File "/usr/lib/python3/dist-packages/pexpect/spawnbase.py", line 171, in read_nonblocking raise EOF('End Of File (EOF). Exception style platform.') pexpect.exceptions.EOF: End Of File (EOF). Exception style platform.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "fat.py", line 168, in main() File "fat.py", line 156, in main image_id = run_extractor(args.firm_path) File "fat.py", line 53, in run_extractor child.expect_exact("Tag: ") File "/usr/lib/python3/dist-packages/pexpect/spawnbase.py", line 418, in expect_exact return exp.expect_loop(timeout) File "/usr/lib/python3/dist-packages/pexpect/expect.py", line 117, in expect_loop return self.eof(e) File "/usr/lib/python3/dist-packages/pexpect/expect.py", line 63, in eof raise EOF(msg) pexpect.exceptions.EOF: End Of File (EOF). Exception style platform. <pexpect.pty_spawn.spawn object at 0x7fa64470e280> command: /usr/bin/python2 args: ['/usr/bin/python2', '/root/firmware-analysis-plus-master/firmadyne/sources/extractor/extractor.py', '-np', '-nk', '/root/WNAP320_V3.7.9.0_firmware.tar', '/root/firmware-analysis-plus-master/firmadyne/images'] buffer (last 100 chars): b'' before (last 100 chars): b'ctor/extractor.py", line 18, in \r\n import binwalk\r\nImportError: No module named binwalk\r\n' after: <class 'pexpect.exceptions.EOF'> match: None match_index: None exitstatus: None flag_eof: True pid: 24311 child_fd: 5 closed: False timeout: None delimiter: <class 'pexpect.exceptions.EOF'> logfile: None logfile_read: None logfile_send: None maxread: 2000 ignorecase: False searchwindowsize: None delaybeforesend: 0.05 delayafterclose: 0.1 delayafterterminate: 0.1 searcher: searcher_string: 0: b'Tag: ' ` 下载firmware-analysis-plus,/.sh成功,运行报错,-h参数成功,-q下没有2.5文件夹,指令如下 python3 fat.py -q /root/firmware-analysis-toolkit/qemu-builds/ /root/WNAP320_V3.7.9.0_firmware.tar

liyansong2018 commented 3 years ago

1、没有2.5文件夹,说明没有qemu环境,你需要重新git项目 2、看这个报错信息,还没有到qemu模拟部分,是binwalk的问题,按照博客源码编译binwalk

Kris-Jack commented 2 years ago

$ ./fat.py -q ./2.5.0/ ./testcases/wnap320_V3.7.11.4_firmware.tar

    ______   _                ___                 
    |  ___| (_)              / _ \                
    | |_     _   _ __ ___   / /_\ \  _ __    ___  
    |  _|   | | | '_ ` _ \  |  _  | | '_ \  / __| ++
    | |     | | | | | | | | | | | | | | | | \__ \ 
    \_|     |_| |_| |_| |_| \_| |_/ |_| |_| |___/

            Welcome to the Firmware Analysis Plus - v2.1

By lys - https://github.com/liyansong2018/firmware-analysis-plus | @liyansong

[+] Firmware: wnap320_V3.7.11.4_firmware.tar [+] Extracting the firmware... Traceback (most recent call last): File "/usr/lib/python3/dist-packages/pexpect/spawnbase.py", line 144, in read_nonblocking s = os.read(self.child_fd, size) OSError: [Errno 5] Input/output error

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3/dist-packages/pexpect/expect.py", line 97, in expect_loop incoming = spawn.read_nonblocking(spawn.maxread, timeout) File "/usr/lib/python3/dist-packages/pexpect/pty_spawn.py", line 455, in read_nonblocking return super(spawn, self).read_nonblocking(size) File "/usr/lib/python3/dist-packages/pexpect/spawnbase.py", line 149, in read_nonblocking raise EOF('End Of File (EOF). Exception style platform.') pexpect.exceptions.EOF: End Of File (EOF). Exception style platform.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "./fat.py", line 184, in main() File "./fat.py", line 172, in main image_id = run_extractor(args.firm_path, args.binwalk) File "./fat.py", line 54, in run_extractor child.expect_exact("Tag: ") File "/usr/lib/python3/dist-packages/pexpect/spawnbase.py", line 384, in expect_exact return exp.expect_loop(timeout) File "/usr/lib/python3/dist-packages/pexpect/expect.py", line 102, in expect_loop return self.eof(e) File "/usr/lib/python3/dist-packages/pexpect/expect.py", line 49, in eof raise EOF(msg) pexpect.exceptions.EOF: End Of File (EOF). Exception style platform. <pexpect.pty_spawn.spawn object at 0x7fcca3fab860> command: /usr/bin/python3 args: ['/usr/bin/python3', '/home/kris/Documents/firmware-analysis-plus/firmadyne/sources/extractor/extractor.py', '-np', '-nk', './testcases/wnap320_V3.7.11.4_firmware.tar', '/home/kris/Documents/firmware-analysis-plus/firmadyne/images'] searcher: None buffer (last 100 chars): b'' before (last 100 chars): b'ractor/extractor.py", line 17, in \r\n import magic\r\nImportError: No module named \'magic\'\r\n' after: <class 'pexpect.exceptions.EOF'> match: None match_index: None exitstatus: None flag_eof: True pid: 28499 child_fd: 5 closed: False timeout: None delimiter: <class 'pexpect.exceptions.EOF'> logfile: None logfile_read: None logfile_send: None maxread: 2000 ignorecase: False searchwindowsize: None delaybeforesend: 0.05 delayafterclose: 0.1 delayafterterminate: 0.1

please help me!Thank you.