cgsecurity / testdisk

TestDisk & PhotoRec
https://www.cgsecurity.org/
GNU General Public License v2.0
1.55k stars 190 forks source link

tesdisk / photorec failed to run in MacOS Catalina #65

Closed syhrz closed 4 years ago

syhrz commented 5 years ago

Seems like the binary for MacOS still in 32 bit. This cause the binary failed to run since MacOS Catalina removing support for 32 bit application.

sh: ./photorec: Bad CPU type in executable
syhrz commented 5 years ago

Just a little update, it's successfully run after I build the 64 bit binary version myself.

cgsecurity commented 5 years ago

I don't have a Mac computer myself. TestDisk documentation https://www.cgsecurity.org/testdisk.pdf about compilation on macOS is very light. Can you add more information ? Documentation can be edited via https://github.com/cgsecurity/testdisk_documentation

darnel commented 4 years ago

Quick lazy solution is brew install testdisk, it currently installs 7.1 and works well.

MohdMash commented 4 years ago

Hi guys, I am tired of trying to run testDisk on my macPro wish Catalina 10.15. It never works, it just says: Bad CPU type in executable. Can you help me with the 64 bit version?

darnel commented 4 years ago

@MohdMash use Homebrew package system (https://brew.sh) as I did :)

MohdMash commented 4 years ago

Hi Darnel, Thanks for the reply. I visited the link and saw the testDisk, but actually I am lost, I don't know what to do.

darnel commented 4 years ago

@MohdMash Homebrew is package manager - similar to apt, yum... etc in Linux. It can deliver (mostly command-line interface) programmes in form of pre-compiled binaries or source codes, that are compiled during install. /someone correct me if needed/

If you need testdisk simply install Homebrew from Terminal by long command from https://brew.sh/#install and then enter brew install testdisk into Terminal.

MohdMash commented 4 years ago

It worked very well! Thanks a lot Darnel :)

Dumpling5375 commented 4 years ago

Hello! I am able to get it running on Catalina, but not having external harddrives showing up. Any tips or help would be appreciated!

1pavanb commented 4 years ago

Hello! I am able to get it running on Catalina, but not having external harddrives showing up. Any tips or help would be appreciated!

@filipfjeldstad You have to run it with sudo. sudo testdisk /list

Otherwise it shows this message TestDisk 7.1, Data Recovery Utility, July 2019 Christophe GRENIER grenier@cgsecurity.org https://www.cgsecurity.org Please wait... No disk detected. You need to be root to use TestDisk.

is that what happened to you? hope it helps

janjan32 commented 4 years ago

I've installed homebrew and still can't get photorec to work. It worked on High Sierra but not Catalina. :( Any advice? I'm using the root account, too. Any ideas?

Last login: Sun Jun 21 09:59:34 on ttys004 MacBook-Pro-2:~ root# /var/root/Downloads/testdisk-7.2-WIP/photorec ; exit; -sh: /var/root/Downloads/testdisk-7.2-WIP/photorec: Bad CPU type in executable logout -n Saving session... -ne ...copying shared history... -ne ...saving history... -n truncating history files... -ne ... completed.

[Process completed]

cgsecurity commented 4 years ago

I've installed homebrew and still can't get photorec to work. It worked on High Sierra but not Catalina. :( Any advice? I'm using the root account, too. Any ideas?

Last login: Sun Jun 21 09:59:34 on ttys004 MacBook-Pro-2:~ root# /var/root/Downloads/testdisk-7.2-WIP/photorec ; exit; -sh: /var/root/Downloads/testdisk-7.2-WIP/photorec: Bad CPU type in executable

Use the binary photorec installed via homebrew instead of the binary downloaded from cgsecurity.org. Run "sudo photorec"

janjan32 commented 4 years ago

Thank you so much! Recovering now. I hope it works. : )

janjan32 commented 4 years ago

And I don't need the root! So nice.

janjan32 commented 4 years ago

I was able to download files, but i'm getting an error 32 broken pipe when I try to expand them. I can't seem to find a way to expand them.

files
darnel commented 4 years ago

@janjan32 Fact that some file is recovered unfortunately doesn't imply that content is correct.

janjan32 commented 4 years ago

I'm testing it with a formatted GoPro SD card.and it's finding files (MP4) quicktime can't open them. I've changed the file type to .mov. no luck. Oh well.

LeeBinder commented 2 years ago

Thank you very much. Is there any way to install testdisk-7.2-WIP (beta) via brew - and if so, can you please share the command?

On https://formulae.brew.sh/formula/testdisk I only see 7.1, so I guess the answer is no ..

cgsecurity commented 2 years ago

TestDisk 7.2-WIP is available for i386 and x86_64 macos from https://www.cgsecurity.org/ So no need to use brew

LeeBinder commented 2 years ago

Great, thank you Christophe - just had seen that a few seconds before you replied 👍 I am wishing you a pleasant remainder of your Sunday.

bram-03 commented 2 years ago

Hello! I am able to get it running on Catalina, but not having external harddrives showing up. Any tips or help would be appreciated!

Hii, I have the same issue. installed both Testdisk 7.1 and 7.2-WIP and still the same result with "No hard disk found". I try to recover my external harddisk on a macbook (2014, MacOS Catalina).

I hope someone could give me THE solution? Thanks in advance.

alehxandro commented 1 year ago

I did all that you said here and still no working, macbook pro 2107 catalina "/Applications/testdisk-7.2-WIP/photorec ; exit; zsh: bad CPU type in executable: /Applications/testdisk-7.2-WIP/photorec"

cgsecurity commented 1 year ago

I did all that you said here and still no working, macbook pro 2107 catalina "/Applications/testdisk-7.2-WIP/photorec ; exit; zsh: bad CPU type in executable: /Applications/testdisk-7.2-WIP/photorec"

You need to use TestDisk 7.2-WIP "Mac OS X Intel 64-bit"

LeeBinder commented 1 year ago

also Catalina, also Intel MacBook. Confirming that as supposed and expected with TestDisk 7.2-WIP "Mac OS X Intel 64-bit":

Bildschirmfoto 2022-09-19 um 22 01 55

:)

alehxandro commented 1 year ago

I did all that you said here and still no working, macbook pro 2107 catalina "/Applications/testdisk-7.2-WIP/photorec ; exit; zsh: bad CPU type in executable: /Applications/testdisk-7.2-WIP/photorec"

You need to use TestDisk 7.2-WIP "Mac OS X Intel 64-bit"

I did it and does not work, says this . . .

PhotoRec 7.2-WIP, Data Recovery Utility, March 2022 Christophe GRENIER grenier@cgsecurity.org https://www.cgsecurity.org

PhotoRec is free software, and comes with ABSOLUTELY NO WARRANTY.

No hard disk found You need to be root to use PhotoRec.

And I'm the administrator I don't understand it!

Captura de Pantalla 2022-09-19 a la(s) 18 16 12
cgsecurity commented 1 year ago

You may have to disable SIP: https://developer.apple.com/documentation/security/disabling_and_enabling_system_integrity_protection

LeeBinder commented 1 year ago

FYI, I do have SIP partially disabled:

System Integrity Protection status: unknown (Custom Configuration).

Configuration:
    Apple Internal: disabled
    Kext Signing: disabled
    Filesystem Protections: disabled
    Debugging Restrictions: disabled
    DTrace Restrictions: enabled
    NVRAM Protections: enabled
    BaseSystem Verification: enabled

Current csr-active-config value in NVRAM..

..as 32 bit hex:
0x00000a0f

..as base64:
DwoAAA==

Maybe that's why photorec works here.