Last active
August 22, 2025 18:56
-
-
Save rfl890/d21bab897c29f17e3b94c4e7f0f45915 to your computer and use it in GitHub Desktop.
Prints the cipher suites available on a Windows machine
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <Windows.h> | |
#include <bcrypt.h> | |
#include <ntstatus.h> | |
int main() { | |
ULONG pcbBuffer = 0; | |
CRYPT_CONTEXT_FUNCTIONS *pBuffer = NULL; | |
NTSTATUS status = BCryptEnumContextFunctions(CRYPT_LOCAL, L"SSL", NCRYPT_SCHANNEL_INTERFACE, &pcbBuffer, &pBuffer); | |
if (status != STATUS_SUCCESS) { | |
exit(EXIT_FAILURE); | |
} | |
for (int i = 0; i < pBuffer->cFunctions; i++) { | |
int cbMultiByte = WideCharToMultiByte(GetConsoleOutputCP(), 0, pBuffer->rgpszFunctions[i], -1, NULL, 0, NULL, NULL); | |
char *pszMultiByte = malloc(cbMultiByte); | |
WideCharToMultiByte(GetConsoleOutputCP(), 0, pBuffer->rgpszFunctions[i], -1, pszMultiByte, cbMultiByte, NULL, NULL); | |
printf("%s\n", pszMultiByte); | |
free(pszMultiByte); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment