Missing "bcrypt.dll" on Windows XP.
Missing "bcrypt.dll" on Windows XP.
"makemkvcon.exe" depends on "libffm.dll", which depends on "bcrypt.dll", which doesn't exist. It is trying to import 3 symbols: "BCryptCloseAlgorithmProvider", "BCryptGenRandom", and "BCryptOpenAlgorithmProvider".
This is on Windows XP 32 bit SP3. I have just upgraded to MakeMKV 1.15.4. I don't remember what my prior version was, but I was able to rip on Windows XP earlier this year.
A google search found this: http://forum.doom9.org/archive/index.php/t-175173.html
I wonder why ripping a video requires cryptographically secure random numbers? The thought crosses my mind to hack my own bcrypt.dll just to provide those 3 functions, maybe even just stubs. Otherwise, I wonder if an older version of libffm.dll can be dropped in? Otherwise, I might just have to use an older version of MakeMKV with my clock set back.
This is on Windows XP 32 bit SP3. I have just upgraded to MakeMKV 1.15.4. I don't remember what my prior version was, but I was able to rip on Windows XP earlier this year.
A google search found this: http://forum.doom9.org/archive/index.php/t-175173.html
I wonder why ripping a video requires cryptographically secure random numbers? The thought crosses my mind to hack my own bcrypt.dll just to provide those 3 functions, maybe even just stubs. Otherwise, I wonder if an older version of libffm.dll can be dropped in? Otherwise, I might just have to use an older version of MakeMKV with my clock set back.
Re: Missing "bcrypt.dll" on Windows XP.
I hacked a stub, which allows MakeMKV 1.15.4 to run on Windows XP 32 bit.
I used g++ 4.7.1 20120524 (from the MinGW that came with QB64 1.2), and cl 15.00.30729.01 x86 (from Visual C++ 2008 Express).
bcrypt.cpp
MinGW files:
bcryptgcc.def
bcryptoldgcc.def
testbcryptgcc.cpp
mbcryptgcc.bat
mtestbcryptgcc.bat
mbcryptoldgcc.bat
mtestbcryptoldgcc.bat
MSVC++ files:
bcryptvc.def
testbcryptvc.cpp
mbcryptvc.bat
mtestbcryptvc.bat
If you use the bat files, you'll have to adjust the paths. (The reason for the \c\ path on the bcrypt.cpp is so that I could have only one copy of that, because it's identical for both compilers.) (The source files should contain the same lines in the comments, but without the paths.)
The commands for msvc++ need to be run from the msvc++ command prompt shortcut, so that the environment variables will be set.
Hopefully I didn't make too many mistakes.
It seems to work. It seems like MakeMKV doesn't even call those functions, at least when ripping DVD files from a folder. I'm about to try ripping from an actual disk.
Happy ripping to my fellow XP users.
Edit: It also ripped a DVD from disk without calling those functions.
Edit: updated the bcryptvc.def within the comments in bcrypt.cpp
Edit: 2021 Jan 1:
Accommodated g++ 3.4.2, which comes with Dev-C++ 4.9.9.2. I refer to this as "older MinGW" and "oldgcc". This involves removing ",--nxcompat" from the command lines, and "bcrypt.dll." from the def lines.
Changed testbcrypt to zero initialize bBuffer, and have cbBuffer use sizeof instead of hardcoding.
Added a comment that the message boxes can be underneath and thus hidden by the console window. (I think when launching it from Windows Explorer, the initial message box can be created a fraction of a second prior to the console window.)
Come to think of it, I should have put the revision date in text strings so it'd be in the binaries. Maybe next time, if I revise them again...
I used g++ 4.7.1 20120524 (from the MinGW that came with QB64 1.2), and cl 15.00.30729.01 x86 (from Visual C++ 2008 Express).
bcrypt.cpp
Code: Select all
// bcrypt stub to allow newer versions of MakeMKV to run on Windows XP.
// Public domain, 2020 December, Michael Calkins ("qbasicmichael"). No warranty. Use at your own risk.
// Revision 2021 January 01
// Borrows from the "w64 mingw-runtime package", which is also public domain.
// mingw: ----------------------------------- (for older mingw, remove ",--nxcompat".)
// g++.exe -O3 -Wall -shared -Wl,-s,-shared,--enable-auto-image-base,-dy,--nxcompat,--kill-at -o bcrypt.dll bcrypt.cpp
// msvc++:
// cl.exe /O2 /LD /MD bcrypt.cpp bcryptvc.def user32.lib /link /NXCOMPAT
// mt.exe -manifest bcrypt.dll.manifest -outputresource:bcrypt.dll;2
// bcryptvc.def should contain the following:
// LIBRARY bcrypt.dll
// EXPORTS
// BCryptOpenAlgorithmProvider
// BCryptCloseAlgorithmProvider
// BCryptGenRandom
// ThisDllIsJustAStub
// Place the resulting "bcrypt.dll" into the MakeMKV folder. Do not put it in the system32 folder.
// You should probably delete any resulting bcrypt.a or bcrypt.lib files afterwards, so as not to interfere with linking other projects to genuine bcrypt.
#define NOCRYPT
#include <windows.h>
typedef LONG NTSTATUS;
typedef LPVOID BCRYPT_ALG_HANDLE;
#define STATUS_SUCCESS ((NTSTATUS)0x00000000L)
extern "C" __declspec(dllexport) NTSTATUS WINAPI BCryptOpenAlgorithmProvider(BCRYPT_ALG_HANDLE *phAlgorithm, LPCWSTR pszAlgId, LPCWSTR pszImplementation, DWORD dwFlags) {
MessageBoxW(NULL, pszAlgId, L"BCryptOpenAlgorithmProvider", 0);
return STATUS_SUCCESS;
}
extern "C" __declspec(dllexport) NTSTATUS WINAPI BCryptCloseAlgorithmProvider(BCRYPT_ALG_HANDLE hAlgorithm, ULONG dwFlags) {
MessageBoxW(NULL, L"", L"BCryptCloseAlgorithmProvider", 0);
return STATUS_SUCCESS;
}
extern "C" __declspec(dllexport) NTSTATUS WINAPI BCryptGenRandom(BCRYPT_ALG_HANDLE hAlgorithm, PUCHAR pbBuffer, ULONG cbBuffer, ULONG dwFlags) {
MessageBoxW(NULL, L"", L"BCryptGenRandom", 0);
return STATUS_SUCCESS;
}
extern "C" BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {
return TRUE;
}
extern "C" __declspec(dllexport) const char * WINAPI ThisDllIsJustAStub(void) {
return "This bcrypt.dll is just a stub to get MakeMKV to work on WinXP.";
}
bcryptgcc.def
Code: Select all
LIBRARY bcrypt.dll
EXPORTS
BCryptOpenAlgorithmProvider@16 = bcrypt.dll.BCryptOpenAlgorithmProvider
BCryptCloseAlgorithmProvider@8 = bcrypt.dll.BCryptCloseAlgorithmProvider
BCryptGenRandom@16 = bcrypt.dll.BCryptGenRandom
ThisDllIsJustAStub@0 = bcrypt.dll.ThisDllIsJustAStub
Code: Select all
LIBRARY bcrypt.dll
EXPORTS
BCryptOpenAlgorithmProvider@16 = BCryptOpenAlgorithmProvider
BCryptCloseAlgorithmProvider@8 = BCryptCloseAlgorithmProvider
BCryptGenRandom@16 = BCryptGenRandom
ThisDllIsJustAStub@0 = ThisDllIsJustAStub
Code: Select all
// Code to test the message boxes in the bcrypt stub. mingw version.
// Revision 2021 January 01.
// Note: the console window can cover and hide the message box.
// for older mingw, remove ",--nxcompat" from command line, and "bcrypt.dll." from before the function names on the def file lines.
// dlltool.exe -k -l bcrypt.a -d bcryptgcc.def
// g++.exe -O3 -Wall -Wl,-s,-dy,--nxcompat,--enable-stdcall-fixup -o testbcryptgcc.exe testbcryptgcc.cpp bcrypt.a
// bcryptgcc.def should contain the following:
// LIBRARY bcrypt.dll
// EXPORTS
// BCryptOpenAlgorithmProvider@16 = bcrypt.dll.BCryptOpenAlgorithmProvider
// BCryptCloseAlgorithmProvider@8 = bcrypt.dll.BCryptCloseAlgorithmProvider
// BCryptGenRandom@16 = bcrypt.dll.BCryptGenRandom
// ThisDllIsJustAStub@0 = bcrypt.dll.ThisDllIsJustAStub
#define NOCRYPT
#include <windows.h>
typedef LONG NTSTATUS;
typedef LPVOID BCRYPT_ALG_HANDLE;
extern "C" __declspec(dllimport) NTSTATUS WINAPI BCryptOpenAlgorithmProvider(BCRYPT_ALG_HANDLE *phAlgorithm, LPCWSTR pszAlgId, LPCWSTR pszImplementation, DWORD dwFlags);
extern "C" __declspec(dllimport) NTSTATUS WINAPI BCryptCloseAlgorithmProvider(BCRYPT_ALG_HANDLE hAlgorithm, ULONG dwFlags);
extern "C" __declspec(dllimport) NTSTATUS WINAPI BCryptGenRandom(BCRYPT_ALG_HANDLE hAlgorithm, PUCHAR pbBuffer, ULONG cbBuffer, ULONG dwFlags);
extern "C" __declspec(dllimport) const char * WINAPI ThisDllIsJustAStub(void);
BCRYPT_ALG_HANDLE hAlgorithm = 0;
LPCWSTR pszAlgId = L"fghij";
LPCWSTR pszImplementation = L"abcde";
DWORD dwFlags = 0;
UCHAR bBuffer[16] = {};
ULONG cbBuffer = sizeof(bBuffer);
int main() {
BCryptOpenAlgorithmProvider(& hAlgorithm, pszAlgId, pszImplementation, dwFlags);
BCryptCloseAlgorithmProvider(hAlgorithm, dwFlags);
BCryptGenRandom(hAlgorithm, bBuffer, cbBuffer, dwFlags);
MessageBoxA(NULL, ThisDllIsJustAStub(), "", 0);
return 0;
}
Code: Select all
\qb64\internal\c\c_compiler\bin\g++.exe -O3 -Wall -shared -Wl,-s,-shared,--enable-auto-image-base,-dy,--nxcompat,--kill-at -o bcrypt.dll bcrypt.cpp
Code: Select all
\qb64\internal\c\c_compiler\bin\dlltool.exe -k -l bcrypt.a -d bcryptgcc.def
\qb64\internal\c\c_compiler\bin\g++.exe -O3 -Wall -Wl,-s,-dy,--nxcompat,--enable-stdcall-fixup -o testbcryptgcc.exe testbcryptgcc.cpp bcrypt.a
Code: Select all
c:\dev-cpp\bin\g++.exe -O3 -Wall -shared -Wl,-s,-shared,--enable-auto-image-base,-dy,--kill-at -o bcrypt.dll bcrypt.cpp
Code: Select all
c:\dev-cpp\bin\dlltool.exe -k -l bcrypt.a -d bcryptoldgcc.def
c:\dev-cpp\bin\g++.exe -O3 -Wall -Wl,-s,-dy,--enable-stdcall-fixup -o testbcryptgcc.exe testbcryptgcc.cpp bcrypt.a
bcryptvc.def
Code: Select all
LIBRARY bcrypt.dll
EXPORTS
BCryptOpenAlgorithmProvider
BCryptCloseAlgorithmProvider
BCryptGenRandom
ThisDllIsJustAStub
Code: Select all
// Code to test the message boxes in the bcrypt stub. msvc++ version.
// Revision 2021 January 01.
// Note: the console window can cover and hide the message box.
// cl.exe /O2 /MD testbcryptvc.cpp bcrypt.lib user32.lib /link /NXCOMPAT
// mt.exe -manifest testbcryptvc.exe.manifest -outputresource:testbcryptvc.exe;1
#include <windows.h>
extern "C" __declspec(dllimport) const char * WINAPI ThisDllIsJustAStub(void);
BCRYPT_ALG_HANDLE hAlgorithm = 0;
LPCWSTR pszAlgId = L"fghij";
LPCWSTR pszImplementation = L"abcde";
DWORD dwFlags = 0;
UCHAR bBuffer[16] = {};
ULONG cbBuffer = sizeof(bBuffer);
int main() {
BCryptOpenAlgorithmProvider(& hAlgorithm, pszAlgId, pszImplementation, dwFlags);
BCryptCloseAlgorithmProvider(hAlgorithm, dwFlags);
BCryptGenRandom(hAlgorithm, bBuffer, cbBuffer, dwFlags);
MessageBoxA(NULL, ThisDllIsJustAStub(), "", 0);
return 0;
}
Code: Select all
cl.exe /O2 /LD /MD \c\bcrypt.cpp bcryptvc.def user32.lib /link /NXCOMPAT
mt.exe -manifest bcrypt.dll.manifest -outputresource:bcrypt.dll;2
Code: Select all
cl.exe /O2 /MD testbcryptvc.cpp bcrypt.lib user32.lib /link /NXCOMPAT
mt.exe -manifest testbcryptvc.exe.manifest -outputresource:testbcryptvc.exe;1
The commands for msvc++ need to be run from the msvc++ command prompt shortcut, so that the environment variables will be set.
Hopefully I didn't make too many mistakes.
It seems to work. It seems like MakeMKV doesn't even call those functions, at least when ripping DVD files from a folder. I'm about to try ripping from an actual disk.
Happy ripping to my fellow XP users.
Edit: It also ripped a DVD from disk without calling those functions.
Edit: updated the bcryptvc.def within the comments in bcrypt.cpp
Edit: 2021 Jan 1:
Accommodated g++ 3.4.2, which comes with Dev-C++ 4.9.9.2. I refer to this as "older MinGW" and "oldgcc". This involves removing ",--nxcompat" from the command lines, and "bcrypt.dll." from the def lines.
Changed testbcrypt to zero initialize bBuffer, and have cbBuffer use sizeof instead of hardcoding.
Added a comment that the message boxes can be underneath and thus hidden by the console window. (I think when launching it from Windows Explorer, the initial message box can be created a fraction of a second prior to the console window.)
Come to think of it, I should have put the revision date in text strings so it'd be in the binaries. Maybe next time, if I revise them again...
Last edited by qbm0000 on Fri Jan 01, 2021 8:40 am, edited 2 times in total.
Re: Missing "bcrypt.dll" on Windows XP.
^ I normally think of myself as a technical person, but unfortunately, this is mostly beyond me. This is C++ that needs to be compiled? Can you share the compiled result?
I run a Windows XP SP3 machine solely for ripping, and while it's been fine through 1.15.3 (though Mike keeps nagging me to get off XP), with 1.15.4 I can confirm the same error that you encountered.
Perhaps Mike can address this within MakeMKV for 1.15.5.

Using: ASUS BW-16D1HT 3.00
Re: Missing "bcrypt.dll" on Windows XP.
Try this link
https://www.dll-files.com/bcrypt.dll.html
Pick the correct one and download
NOTE
Please sandbox and check for malware before using.
I never had need to use that site before so I can't tell you if they are legit or not
https://www.dll-files.com/bcrypt.dll.html
Pick the correct one and download
NOTE
Please sandbox and check for malware before using.
I never had need to use that site before so I can't tell you if they are legit or not
Re: Missing "bcrypt.dll" on Windows XP.
Out of curiosity… why continue to run a Windows XP machine only for ripping?
Re: Missing "bcrypt.dll" on Windows XP.
I just happened to check back on a whim, and noticed your response.
I'm not comfortable uploading binaries here.
I'll walk you through it using the old version of MinGW (3.4.2) that comes with the old version of Bloodshed Dev-C++ (4.9.9.2). This is a very old compiler, but it should be sufficient for this. The download is <9MB.
https://sourceforge.net/projects/dev-cp ... e/download
Proceed through the setup.
On the "Choose components" part, it's up to you. Definitely leave "MinGW compiler system" checked. Starting from "Typical", I would suggest leaving "Help files" and "Create shortcuts in Start Menu" checked. I would recommend unchecking "Associate C and C++ files" and "Create Quick Launch shortcut". (I like having the files associated with Notepad.)
The default folder is "C:\Dev-Cpp", and I'll assume you install there.
It asks whether you want to install for all users. It probably won't matter, but I'm choosing "Yes".
After installation, you don't have to run Dev-C++. If you do, it will ask you a few configuration questions. But we won't be using the IDE. We'll be compiling directly from the command line.
Now, you can create a new folder. I'll assume you create a folder named "bcrypt" in your "C:" drive.
Extract the following Zip file into that folder.
Now, go to the "Start" menu, "All Programs", "Accessories", and run "Command Prompt".
Type:
Code: Select all
c:
cd \bcrypt
mbcryptoldgcc
copy bcrypt.dll "c:\program files\makemkv\"
That should do it.
I edited my earlier post to update the source code.
Please let me know if it works, or if you have trouble.
Re: Missing "bcrypt.dll" on Windows XP.
Worked perfectly, thank you very much for making this, and taking the time to write out the instructions!
Just because I have a lot to rip, and I'm often gaming, processing video, etc. on my primary system, so until I get a new system, I've been using my old XP system for ripping, and I haven't had the time or the energy to look into whether a newer Windows would even run on that system... it's currently the path of least resistance lol.
Using: ASUS BW-16D1HT 3.00
-
- Posts: 1
- Joined: Wed Jan 13, 2021 10:46 pm
Re: Missing "bcrypt.dll" on Windows XP.
Hello qbasic michael,
thank you very much for your effort to keep achieve Windows XP compatibility.
Sadly, I am experiencing problems with the latest MakeMKVversion 1.15.4.0 on Windows XP.
I successfully built the stub library and copied it to the program directory, but the program crashes.
First, a child process (?)gets terminated in the background "MakeMKV console application has encountered a problem and needs to close."
The main program window launches though. I can also see that it tries to establish a server connection.
Then a corrupted error message appears (black window - see attached screenshot) and the program hangs and needs to be terminated.
IDA Pro Debugger is able to detect these errors:
Debugged application message: OpenThemeData() failed for theme 5 (MENU). (Element not found.)
[...]
Debugged application message: OpenThemeData() failed for theme 11 (TASKDIALOG). (Element not found.)
[ ...]
Debugger: thread 5688 has exited (code 0)
Debugger: thread 5160 has exited (code 0)
Debugger: thread 5328 has exited (code 0)
Debugger: process has exited (exit code 0)
Do you have any idea how to fix this?
On another note: I am not an experienced programmer, but I think it should be possible to make the library load of bcrypt.dll conditional (e.g. NT VERSION > NT5) in makemkv's main source code. If backwards compatibility is desired, that is.
Cheers,
schreiberstein
- Attachments
-
- Error message
- makemkv-11540-winxp.PNG (29.87 KiB) Viewed 659 times