ReFirmLabs / binwalk

Firmware Analysis Tool
MIT License
10.8k stars 1.54k forks source link

API Issue: Recursive extraction using Binwalk API possible? #405

Closed HassamK97 closed 5 years ago

HassamK97 commented 5 years ago

Hi, I am using binwalk API to perform firmware extraction. When extraction is performed it only returns some extracted files and not the complete file system. Not like the tool which returns complete file system after recursive extraction.

binwalk -M -e dlink_DCS_930L.bin

This command recursively extracts binary file and displays following information in extracted folder: Screenshot from 2019-05-09 14-05-31

But if I perform extraction from binwalk API, it doesn't extract recursively. The following code is used for performing firmware extraction using API:

for module in binwalk.scan('dlink_DCS_930L.bin', signature=True, quiet=True, extract=True):

It does not display the complete file system of the firmware like above. The result is as follows: Screenshot from 2019-05-09 14-06-27

Is there any rule or any specific method that performs recursive extraction using binwalk Python API? Kindly acknowledge.

Kruxinator commented 5 years ago

Use for module in binwalk.scan('dlink_DCS_930L.bin', signature=True, quiet=True, matryoshka=True, extract=True):

HassamK97 commented 5 years ago

Use for module in binwalk.scan('dlink_DCS_930L.bin', signature=True, quiet=True, matryoshka=True, extract=True):

Thanks, issue resolved.