Hello! Maybe it is feature, not a bug, but to disassemble system libraries, one needs to be root, even if the file is globally readable and executable: $ ls -l /bin/das /usr/lib/libasound.so.2.0.0 -rwxr-xr-x 1 root root 11328 Apr 3 21:30 /bin/das -rwxr-xr-x 1 root root 1093988 Nov 14 10:03 /usr/lib/libasound.so.2.0.0 ˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇ $ /bin/das /usr/lib/libasound.so.2.0.0 | head Error: unable to open file "/usr/lib/libasound.so.2.0.0" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ $ cat /bin/das /usr/lib/libasound.so.2.0.0 | head ELF>� @@@%@8 @@@@@@ $ sudo /bin/das /usr/lib/libasound.so.2.0.0 | head 00000000 7f45 jg 0x47 00000002 4c dec esp 00000003 46 inc esi 00000004 0101 add [ecx],eax 00000006 0100 add [eax],eax 00000008 0000 add [eax],al 0000000a 0000 add [eax],al 0000000c 0000 add [eax],al 0000000e 0000 add [eax],al 00000010 0300 add eax,[eax]
It is a bug, fopen is called with parameter "r+b" (read and write, binary) instead of "rb" (read binary).
Created pull request upstream to fix this: https://github.com/jtpereyda/libdasm/pull/9 Patched also the fedora package in rawhide for next release. I won't be pushing the update packages now as this is not core or even purpose of libdasm or "das" example application to disassemble whole libraries. The libdasm / das is meant to be used for 32-bit opcode such as snippets of the shellcode / functions etc.
Sure. Thanx!