From a MSYS2 shell, switch to the UCRT64 environment and install prerequisites
# source shell ucrt64
# pacman -Syu --needed mingw-w64-ucrt-x86_64-toolchain vimCompile standalone.cc to an object file
# g++ -std=c++23 standalone.cc -c -Oz -fno-exceptions -fno-asynchronous-unwind-tablesCopy the .text section to standalone.bin
# objcopy --dump-section .text=standalone.bin standalone.oStrip any trailing NOP bytes (there's probably a better way to do this)
# truncate -s $(($(grep -aobP '[^\x90]' standalone.bin | tail -1 | cut -d: -f1) + 1)) standalone.binDump to C array
# xxd -i standalone.binunsigned char standalone_bin[] = {
0x6a, 0x60, 0x58, 0x65, 0x67, 0x48, 0x8b, 0x00, 0x48, 0x8b, 0x40, 0x18,
0x4c, 0x8d, 0x48, 0x20, 0x48, 0x8b, 0x40, 0x20, 0x49, 0x39, 0xc1, 0x0f,
0x84, 0x35, 0x01, 0x00, 0x00, 0x4c, 0x8b, 0x40, 0x50, 0xba, 0x05, 0x15,
0x00, 0x00, 0x66, 0x41, 0x8b, 0x08, 0x66, 0x85, 0xc9, 0x74, 0x11, 0x6b,
0xd2, 0x21, 0x81, 0xe1, 0xdf, 0x00, 0x00, 0x00, 0x49, 0x83, 0xc0, 0x02,
0x01, 0xca, 0xeb, 0xe6, 0x81, 0xfa, 0xf5, 0xe4, 0xe1, 0x20, 0x75, 0x30,
0x57, 0x56, 0x53, 0x48, 0x83, 0xec, 0x20, 0x48, 0x8b, 0x40, 0x20, 0x48,
0x63, 0x50, 0x3c, 0x8b, 0x94, 0x10, 0x88, 0x00, 0x00, 0x00, 0x48, 0x01,
0xc2, 0x8b, 0x5a, 0x20, 0x44, 0x8b, 0x4a, 0x1c, 0x44, 0x8b, 0x52, 0x24,
0x44, 0x8b, 0x5a, 0x18, 0x31, 0xd2, 0x48, 0x8d, 0x3c, 0x18, 0xeb, 0x08,
0x48, 0x8b, 0x00, 0xeb, 0x97, 0x48, 0xff, 0xc2, 0x44, 0x39, 0xda, 0x73,
0x44, 0x44, 0x8b, 0x04, 0x97, 0xb9, 0x05, 0x15, 0x00, 0x00, 0x49, 0x01,
0xc0, 0x41, 0x8a, 0x30, 0x40, 0x84, 0xf6, 0x74, 0x10, 0x6b, 0xc9, 0x21,
0x81, 0xe6, 0xdf, 0x00, 0x00, 0x00, 0x49, 0xff, 0xc0, 0x01, 0xf1, 0xeb,
0xe8, 0x81, 0xf9, 0xdb, 0x2f, 0x07, 0xb7, 0x75, 0xcc, 0x48, 0x01, 0xd2,
0x48, 0x01, 0xc2, 0x42, 0x0f, 0xb7, 0x14, 0x12, 0x48, 0x8d, 0x14, 0x90,
0x42, 0x8b, 0x34, 0x0a, 0x48, 0x01, 0xc6, 0xeb, 0x02, 0x31, 0xf6, 0x31,
0xd2, 0x48, 0x01, 0xc3, 0x44, 0x39, 0xda, 0x73, 0x4a, 0x44, 0x8b, 0x04,
0x93, 0xb9, 0x05, 0x15, 0x00, 0x00, 0x49, 0x01, 0xc0, 0x41, 0x8a, 0x38,
0x40, 0x84, 0xff, 0x74, 0x10, 0x6b, 0xc9, 0x21, 0x81, 0xe7, 0xdf, 0x00,
0x00, 0x00, 0x49, 0xff, 0xc0, 0x01, 0xf9, 0xeb, 0xe8, 0x81, 0xf9, 0xbf,
0xc1, 0xcf, 0xde, 0x75, 0x19, 0x48, 0x01, 0xd2, 0x48, 0x01, 0xc2, 0x42,
0x0f, 0xb7, 0x14, 0x12, 0x48, 0x8d, 0x14, 0x90, 0x42, 0x8b, 0x14, 0x0a,
0x48, 0x8d, 0x1c, 0x10, 0xeb, 0x07, 0x48, 0xff, 0xc2, 0xeb, 0xb1, 0x31,
0xdb, 0x48, 0x8d, 0x0d, 0x66, 0x00, 0x00, 0x00, 0xff, 0xd6, 0x48, 0x8d,
0x15, 0x51, 0x00, 0x00, 0x00, 0x48, 0x91, 0xff, 0xd3, 0x6a, 0x40, 0x41,
0x59, 0x4c, 0x8d, 0x05, 0x2a, 0x00, 0x00, 0x00, 0x48, 0x8d, 0x15, 0x15,
0x00, 0x00, 0x00, 0x31, 0xc9, 0x48, 0x83, 0xc4, 0x20, 0x5b, 0x5e, 0x5f,
0xff, 0xe0, 0x8b, 0x04, 0x25, 0x3c, 0x00, 0x00, 0x00, 0x0f, 0x0b, 0x90,
0x28, 0x00, 0x10, 0x23, 0xa0, 0x25, 0x5f, 0x00, 0xa0, 0x25, 0x29, 0x00,
0x00, 0x00, 0x28, 0x00, 0x20, 0x00, 0x22, 0x20, 0x5f, 0x00, 0x22, 0x20,
0x29, 0x00, 0x3e, 0x00, 0x10, 0x23, 0xa0, 0x25, 0x2d, 0x00, 0xa0, 0x25,
0x00, 0x00, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x6f, 0x78,
0x57, 0x00, 0x55, 0x53, 0x45, 0x52, 0x33, 0x32, 0x2e, 0x44, 0x4c, 0x4c,
0x00
};
unsigned int standalone_bin_len = 409;sclauncher can be used for testing
# ./sclauncher64.exe -f=standalone.bin