Advanced Search
Search Results
25 total results found
Strings
This page contains documentation about string types, including the hashing functions native to blib. String typedef struct _MeasuredBuffer { DWORD length; char* buffer; } String, MeasuredBuffer; Initialisers String* vallocString(PBYTE text) This funct...
Buffers
This page contains the primitives and their associated functions for buffer primitives within blib. While the measured buffers support the valloc family of allocators, the Measured Buffer helper functions all use the halloc family, so halloc should be used wh...
Hashes
This page details the hashing functions for blib. MiniHash The Blib MiniHash is not cryptographically secure, but is a fast way to evaluate two arbitrary values where small collision chances are possible. Ideally, this can be used when searching for a string a...
Signing Binaries with Self-Signed Certificates
Osslsigncode can be used to sign binaries on Linux with X509 certificates. The following codeblock shows installing osslsigncode on a Linux machine, generating a self-signed certificate, and signing where the password 'bunny' has been used when creating the p1...
Including Icons and Property Metadata
Resource files can be used to include both icons and populate property data in the binary.
Symbol Stripping
Compiling with the -s flag on GNU GCC and similar CC programs will strip symbols during the linker phase of compilation. This will hide the names of the variables given in the code when producing a final binary.
Creating a Certificate Authority
This guide is based upon a deliciousbrains.com article. Creating a CA Generate a private key. openssl genrsa -des3 -out myCA.key 2048 Generate a root certificate with the private key. openssl req -x509 -new -nodes -key myCA.key -sha256 -days 1825 -out my...
Generating Archives
The archive tool ar can be used to pack object files or shared object files into a singular archive for linking purposes. # Compiling some source, such as blib # Note, the -c flag compiles, but does not perform any form of linking. x86_64-w64-mingw32-gcc -nost...
Win32 Minimum Client Socket Transaction
This is the minimal WinAPI using winsock2.h References: https://learn.microsoft.com/en-us/windows/win32/winsock/using-secure-socket-extensions https://learn.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-wsasocketa https://learn.microsoft.co...
Generating a Self-Signed Certificate RSA
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout mycert.key -out mycert.pem
Win32 SChannel TLS
MVP here is Copilot. There's actually no solid guides on this at all. There's a gist but it missed a step in my case. Here’s a basic outline and some example code to get you started: Initialize the Security Package: Use AcquireCredentialsHandle to o...
Win32 SChannel TLS message send (gross)
This works but it's super gross. For TLS you have to Init like 3 times to finish the exchange and negotiation. typedef struct { SOCKET socket; CredHandle hCredential; CtxtHandle hContext; char* ServerCertificate; unsigned int recei...
Dictionaries
This page contains a definition for the MeasuredDictionary functionality within blib. This entity uses measuredbuffers for all members, including keys and values. Measured Dictionaries uses the halloc family to allocate on the heap. Keys are freed using hfree ...
Windows Functionality
This page details some windows functionality for Blib processes. #include <blibwin.h> ## General typedef struct _BLIB_ENV { unsigned int size; WCHAR* env; } ENV, BLIB_ENV; BLIB_ENV bGetEnv(); Returns a BLIB_ENV struct from the TEB->PEB. UNICODE_STRI...
Definitions when working with Windows.h
// GODTIER COMMENT DUE TO SDHARED NAMES // https://github.com/raysan5/raylib/issues/1217 #if defined(_WIN32) #define NOGDI // All GDI defines and routines #define NOUSER // All USER defines and routines #endif #inc...
Cross Compiling OPENSSL from WSL/Linux to Windows
Flags for the different binaries need to be overwritten when generating the Makefile with Configure https://github.com/openssl/openssl?tab=readme-ov-file https://gist.github.com/udnaan/80c5ad125fc4702309b9 ./Configure --cross-compile-prefix=x86_64-w64-mingw32-...
CrossCompiling from Linux
May need to override AR and CC. sudo make PLATFORM=PLATFORM_DESKTOP PLATFORM_OS=WINDOWS
LINKING ON BUILD (MUST USE C-STD-LIB)
You must link to RAYLIB and to GDI32 https://github.com/raysan5/raylib/discussions/2492 -lraylib -lgdi32 -lwinmm
Documentation
https://openquantumsafe.org/liboqs/api/ Building was super easy with cross-compilation. https://github.com/open-quantum-safe/liboqs/wiki/Platform-specific-notes-for-building-liboqs#cross-compiling
Mounting images as devices using loopback devices.
Mounting with a Loopback Loop Device in Linux - DZone Copy the Image that you want to mount using DD dd if=/dev/zero of=/loopfile Check for the unused loop device. # losetup -f /dev/loop1 Set up the loop device with the backing file. If this has parti...