Closed rev111 closed 3 years ago
I solved it and can read and write bitlocker-encrypted partitions. For anyone else looking for this, here is a list of steps for building and running on OS X 11 and an M1-processor. It took a few days trying and leaving it and trying again, I hope I haven't forgotten some details:
Building: -OSX Big Sur 11.1 -M1/Silicon processor. -Install MacFuse 4.0.5 (formerly known as OSXFuse). This requires making changes about kernel extensions at boot time. You may verify that it's working by installing and running Veracrypt. -Install the standalone command line tools from Apple, so that they are found later under /Library/Developer/CommandLineTools Maybe the command line tools are also available under /Applications/Xcode/.... but I haven't checked.
Install macports. Then install these packages:
port install cmake
port install mbedtls
Link some include files to be found later by src/dislocker-fuse.c
ln -s /usr/local/include/osxfuse /usr/local/include/fuse/osxfuse
ln -s /usr/local/include/osxfuse /usr/local/include/fuse
Download the dislocker source and make a few changes: Change cmake/FindFUSE.cmake:
FIND_PATH (FUSE_INCLUDE_DIRS fuse.h
/usr/local/include/osxfuse
/usr/local/include/fuse
if (APPLE)
SET(FUSE_NAMES libosxfuse.dylib fuse)
Now start cmake:
LIBRARY_PATH=/usr/local/lib:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib CPATH=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include cmake .
to make make find the fuse libs, export LIBRARY_PATH:
export LIBRARY_PATH="$LIBRARY_PATH:/usr/local/lib"
make
sudo make install
Attach a bitlocker partition:
-Insert a Bitlocker encrypted partition on a mobile device
-Find the name of the partition with 'diskutil list
'. In this case the partition is at /dev/disk4s1
sudo dislocker -vvv -V /dev/disk4s1 -u /Volumes/bitlocker-partition1
sudo hdiutil attach -imagekey diskimage-class=CRawDiskImage /Volumes/bitlocker-partition1/dislocker-file
the partition name will appear as a new drive in Finder. In this case, the partition's name is BITLOCKER_PARTITION
To de-attach the partition:
sudo umount /Volumes/BITLOCKER_PARTITION
Hope this helps someone! Thank you Aorimn!
@rev111
I wasted almost 3 weeks trying to compile it on M1 but I can't, I have problems in MAKE
and CMAKE
can you please provide more details or can you provide the compiled version of it, I'd really appreciate it.
Hi Emad, sorry I’m a bit late. I’m really no expert on this, so I might not be able to help you. However, if you send more info on the problems you face, I can look into it. In the meantime, here is the compiled binary from my M1, hope that helps! dislocker-fuse.zip
My instructions above to mount and umount are a bit outdated, lately I used the gist from here: https://gist.github.com/dumbledore/2c9f2a6410763c3f96516945b65bc5bb which was mentioned here: https://apple.stackexchange.com/questions/239714/open-bitlocker-usb-stick-on-os-x
Edit: Adding .jpg as file extension was a stupid idea, zipped it instead.
I solved it and can read and write bitlocker-encrypted partitions. For anyone else looking for this, here is a list of steps for building and running on OS X 11 and an M1-processor. It took a few days trying and leaving it and trying again, I hope I haven't forgotten some details:
Thanks! This is very helpful. I tested this on M2 macbook air with Ventura 13.4.1.
After installing macfuse
, macports
and other dependencies, I just ran the following commands:
port install cmake
port install mbedtls
LIBRARY_PATH=/usr/local/lib:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib CPATH=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include cmake .
make
sudo make install
Then dislocker
is ready to go!
I solved it and can read and write bitlocker-encrypted partitions. For anyone else looking for this, here is a list of steps for building and running on OS X 11 and an M1-processor. It took a few days trying and leaving it and trying again, I hope I haven't forgotten some details:
Thanks! This is very helpful. I tested this on M2 macbook air with Ventura 13.4.1.
After installing
macfuse
,macports
and other dependencies, I just ran the following commands:port install cmake port install mbedtls LIBRARY_PATH=/usr/local/lib:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib CPATH=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include cmake . make sudo make install
Then
dislocker
is ready to go!
This is great, thanks @qiyan98. To add, for anyone who is still struggling to set up dislocker and finds this issue, I tested these commands on my M1 Macbook Pro running macOS 14.1 Sonoma.
Make sure to install MacPorts first (https://www.macports.org/). Then install macFUSE through the installer (https://osxfuse.github.io/) and make sure the kernel extensions are enabled.
Perform the commands given by @qiyan98 above to install cmake
and mbedtls
. Before you go and make the dislocker build, you will have to edit mbedtls slightly to prevent the build from failing, just run sed
/gsed
(I used gsed
) with the following command: https://github.com/Aorimn/dislocker/issues/313#issuecomment-1599710305.
gsed -i 's/^#include "mbedtls\/config.h"/#include "mbedtls\/mbedtls_config.h"/;s/# define SHA256(input, len, output) mbedtls_sha256_ret(input, len, output, 0)/# define SHA256(input, len, output) mbedtls_sha256(input, len, output, 0)/' include/dislocker/ssl_bindings.h
After this, run the cmake
and make
install commands in the comment from @qiyan98 and dislocker should be up and running.
This also works on Sonoma 14.5 M2 & M3 with homebrew instead of macports just need to do the following:
brew install cmake mbedtls@2 pkg-config fuse
LIBRARY_PATH=/usr/local/lib:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib CPATH=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include cmake .
make
sudo make install
Compiling dislocker requires the second version of Mbed-TSL (previously PolarSSL). Trying to compile with the latest (third) version causes an error so you have to use
mbedtls@2
As the mbedlts@2 package is only available as a keg, no symbolic links are created into /usr/local by default. Thankfully, we may easily temporarily replace the linked libraries from mbedtls (if installed) with mbedtls@2:
brew unlink mbedtls
brew link mbedtls@2
Now we may get the latest version of dislocker, compile and install it:
git clone https://github.com/Aorimn/dislocker.git
cd dislocker &&
cmake . &&
make &&
sudo make install
Finally with dislocker installed, we may undo the previous changes and relink to version 3 if you have it installed:
brew unlink mbedtls@2
brew link mbedtls
Hello, since I have a different processor, OS and OSXFuse version I moved this into a separate issue.
I'm trying to build under OSX Big Sur 11.1 with the new M1/Silicon processor.
I rely on Macports as package manager and installing homebrew along it is not recommended. So I'm trying to build from source. cmake runs successful (albeit with warnings) with this command from issue 223:
LIBRARY_PATH=/usr/local/lib:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib CPATH=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include cmake .
But make fails:
The libraries below have been installed by the latest version of OSXFuse (now renamed to MacFuse) 4.0.5. Are these the osxfuse libraries that dislocker expects?
I tried to alter search terms in make/FindFUSE.cmake like this:
I also tried appending the library path:
as well as presetting it like with the cmake command:
LIBRARY_PATH=/usr/local/lib:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib CPATH=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include make
But the error remains, and I'm running out of ideas. I'm not even sure where the check for losxfuse_i64 comes from. Maybe somebody knows how to find out which library exactly is expected here and where it should be found? Any help very much appreciated!