Code Monkey home page Code Monkey logo

Comments (9)

devttys0 avatar devttys0 commented on June 19, 2024

You shouldn't have gotten this error with file-5.14; make sure that you also installed the file-5.14 python wrapper, and that all other python magic wrappers are removed from your system.

With that said, you should never get this error with the binwalk code from the master branch. It has had its own libmagic python wrapper for some time to address these types of issues: https://github.com/devttys0/binwalk/blob/master/src/binwalk/core/magic.py

from binwalk.

fronald avatar fronald commented on June 19, 2024

Hi,

On CentOS with the file-5.14 intalled still doesn't work. With the PyQt or PySide installed, at runtime the error "PyQt needs the Qt 4.7 or above to work". The PyQt and PySide are installed by yum and your dependents packages are Qt 4.6 (fail on repository). Ok, i'm back to FreeBSD and installation work like a charm. But...

[fronald@sagan] ~/Labs/D-Link 2500-E% binwalk dlink2500e_retail.img
Segmentation fault

This error can appear because the master version is unstable? I'm running Python 2.7.6 on FreeBSD 10.

from binwalk.

devttys0 avatar devttys0 commented on June 19, 2024

Hmmm, possibly related to issue #30? Try running it in python with the -O switch and see if you get any debug output before the crash:

 $ python -O $(which binwalk) dlink2500e_retail.img

from binwalk.

fronald avatar fronald commented on June 19, 2024

Do it. And the error is:

DEBUG: libmagic.magic_open(0x328000)
DEBUG: libmagic.magic_load(0x1C19480, /tmp/tmpZGMiiX)
Segmentation fault

Curiously on the my Mac machine, the very similar error appear too. Segmentation fault at libmagic. This information help anything?

from binwalk.

fronald avatar fronald commented on June 19, 2024

The library integrity apparently is ok...

[fronald@capiroto] ~/Labs/D-Link% du -h /usr/lib/libmagic.so.4
102K /usr/lib/libmagic.so.4
[fronald@capiroto] ~/Labs/D-Link% ldd /usr/lib/libmagic.so
/usr/lib/libmagic.so:
libz.so.6 => /lib/libz.so.6 (0x801619000)
libc.so.7 => /lib/libc.so.7 (0x80081d000)
[fronald@capiroto] ~/Labs/D-Link% nm -D /usr/lib/libmagic.so.4
U _CurrentRuneLocale
U _DefaultRuneLocale
w _Jv_RegisterClasses
U _ThreadRuneLocale
U ___runetype
U __assert
0000000000218d04 A __bss_start
w __cxa_finalize
U __error
U __mb_sb_limit
U __stack_chk_fail
U __stack_chk_guard
U __stderrp
U __stdoutp
U __tls_get_addr
0000000000218d04 A _edata
0000000000218f58 A _end
00000000000147e8 T _fini
0000000000003aa8 T init
U abort
U access
U asctime
U asprintf
U calloc
000000000000b520 T cdf_count_chain
000000000000ab90 T cdf_ctime
000000000000c6d0 T cdf_print_classid
000000000000c7a0 T cdf_print_elapsed_time
000000000000c750 T cdf_print_property_name
000000000000b990 T cdf_read_dir
000000000000af90 T cdf_read_header
000000000000b580 T cdf_read_long_sector_chain
000000000000bff0 T cdf_read_property_info
000000000000b280 T cdf_read_sat
000000000000b140 T cdf_read_sector
000000000000b950 T cdf_read_sector_chain
000000000000b200 T cdf_read_short_sector
000000000000b740 T cdf_read_short_sector_chain
000000000000be40 T cdf_read_short_stream
000000000000bca0 T cdf_read_ssat
000000000000beb0 T cdf_read_summary_info
000000000000aec0 T cdf_swap_class
000000000000ade0 T cdf_swap_dir
000000000000ac30 T cdf_swap_header
000000000000ab80 T cdf_timespec_to_timestamp
000000000000a880 T cdf_timestamp_to_timespec
000000000000abd0 T cdf_tole2
000000000000abf0 T cdf_tole4
000000000000ac10 T cdf_tole8
000000000000af10 T cdf_unpack_dir
000000000000ad40 T cdf_unpack_header
000000000000c540 T cdf_unpack_summary_info
U close
U closedir
U ctime
U dup
U dup2
U execvp
U exit
U fclose
U fcntl
U fflush
000000000000e2e0 T file_apprentice
00000000000139b0 T file_ascmagic
0000000000013a90 T file_ascmagic_with_encoding
0000000000012660 T file_badread
0000000000012630 T file_badseek
0000000000012690 T file_buffer
0000000000012e00 T file_check_mem
000000000000e290 T file_delmagic
0000000000014260 T file_encoding
00000000000123c0 T file_error
000000000000cf50 T file_fmttime
0000000000218eb0 B file_formats
000000000000d9f0 T file_fsmagic
0000000000012b00 T file_getbuffer
0000000000012120 T file_is_tar
0000000000014630 T file_looks_utf8
0000000000012520 T file_magerror
000000000000d010 T file_magwarn
000000000000c980 T file_mdump
0000000000218d60 B file_names
0000000000015740 R file_nformats
0000000000015748 R file_nnames
0000000000012600 T file_oomem
00000000000137b0 T file_pipe2file
0000000000012ea0 T file_printedlen
0000000000012490 T file_printf
000000000000ecb0 T file_pstring_get_length
000000000000ec50 T file_pstring_length_size
0000000000012ec0 T file_replace
0000000000012a90 T file_reset
000000000000eb20 T file_showstr
000000000000ea10 T file_signextend
0000000000004450 T file_softmagic
0000000000009ed0 T file_trycdf
0000000000007980 T file_tryelf
0000000000012330 T file_vprintf
0000000000013020 T file_zmagic
U fopen
U fork
U fprintf
U fputc
U free
U fstat
U fwrite
U getenv
U getline
U gmtime
U inflate
U inflateEnd
U inflateInit2

U ioctl
U localtime
U lseek
U lstat
000000000000d880 T magic_buffer
000000000000d480 T magic_check
000000000000d310 T magic_close
000000000000d410 T magic_compile
000000000000d560 T magic_descriptor
000000000000d900 T magic_errno
000000000000d8e0 T magic_error
000000000000d870 T magic_file
000000000000d110 T magic_getpath
000000000000d4f0 T magic_list
000000000000d390 T magic_load
000000000000d270 T magic_open
000000000000d300 T magic_setflags
U malloc
U mbrtowc
U memchr
U memcmp
U memcpy
U memset
U mkstemp
U mktime
U mmap
U munmap
U open
U opendir
U pipe
U printf
U puts
U qsort
U read
U readdir
U readlink
U realloc
U regcomp
U regerror
U regexec
U regfree
U select
U snprintf
0000000000013600 T sread
U stat
U strchr
U strcmp
U strcspn
U strdup
U strerror
U strlcat
U strlcpy
U strlen
U strncmp
U strndup
U strrchr
U strstr
U strtod
U strtof
U strtol
U strtoul
U strtoull
U time
U unlink
U utimes
U vasprintf
U vfprintf
U waitpid
U write

from binwalk.

fronald avatar fronald commented on June 19, 2024

What the Linux distribution you use to develop binwalk? I can download and install that version in a virtual machine to test. If all ok, i'm back to FreeBSD to help you with the deploy. I can create a package for binwalk to FreeBSD and contribute with the project.

from binwalk.

devttys0 avatar devttys0 commented on June 19, 2024

From the debug output, it looks like it is crashing in libmagic's magic_load. This could be due to a bug in the new libmagic wrapper, or libmagic version incompatibilities.

I'm currently running on Ubuntu 12.04 with no problems; IIRC, I'm just using the libmagic that came with the distro - I'll try upgrading to 5.14 and see if I can replicate the issue.

from binwalk.

devttys0 avatar devttys0 commented on June 19, 2024

I've just tested binwalk on Ubuntu with both libmagic v5.09 and v5.14 without any issues. However, I may know what was causing your original problem..

When I installed the newer file v5.14, the supporting libraries (e.g., libmagic) were installed to /usr/local/lib; so even though the file utility reported that it was v5.14, the old libraries were still in the /usr/lib directory, so binwalk was still loading the older library (/usr/lib was first in my system's search path). Is this the case on your CentOS system as well?

from binwalk.

devttys0 avatar devttys0 commented on June 19, 2024

Binwalk now includes all core dependencies; if you grab the latest code from master, you shouldn't have these install problems anymore. The segfault (issue #30) has also been fixed.

from binwalk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.