View Single Post
  #5  
Old 26-09-2026, 03:32
Lord.Freddy's Avatar
Lord.Freddy Lord.Freddy is offline
Registered User
 
Join Date: Apr 2022
Location: ...
Posts: 57
Thanks: 237
Thanked 50 Times in 27 Posts
Lord.Freddy is on a distinguished road
MPZ Wrapper v2

Changelog:
Code:
▪︎ Core rewrite — the C++/setjmp-coroutine wrapper was replaced with a portable C89 state-machine design: smaller, allocation-free on the hot path, and far easier to audit and maintain.
▪︎ Reliable DLL handling — MpzSlimmer.dll is loaded by absolute path from the executable's own directory, with PE bounds/signature validation of the patch site and hardened search-path handling (no DLL-hijack surface).
▪︎ Crash-safe codec execution — codec faults and unexpected failures are trapped and reported as clean errors instead of hanging or dying silently.
▪︎ Robust Win32 I/O — rewritten buffering, seeking and partial read/write handling, with uniform support for regular files and stdin/stdout pipes.
▪︎ Large-file (2 GB) protection — streams exceeding the codec's signed 32-bit limit are detected and rejected before any output is written.
▪︎ Configurable I/O buffer — buffer size is now selectable on the command line (clamped to a safe range) to trade throughput against memory use.
▪︎ Progress reporting — file-to-file operations display live progress; suppressed automatically for pipes.
▪︎ Improved CLI — explicit c / d modes, "-" for stdin/stdout, optional buffer size, and -h / --help.
▪︎ Security & build hardening — ASLR/DEP enforced, no RWX/self-modifying memory, and an embedded version resource + application manifest; together these cut antivirus false positives.
▪︎ Dual-toolchain build — compiles warning-clean under both MSVC (cl) and MinGW GCC/Clang from a single Makefile.
▪︎ General robustness — EOF, empty input, same-file in/out, and failure cleanup (incomplete output is removed) are now handled explicitly rather than relying on old coroutine side effects.
In short: v2 is a substantial rewrite focused on reliability, safe error handling, better I/O, and a cleaner, more portable codebase.
Compiled with: clang-14.2.0-mingw-w64msvcrt-12.0.0

Full credit to Eugene Shelwein for the original MPZ wrapper
Attached Files
File Type: zip MPZ_Wrapper_v2.zip (89.8 KB, 4 views)
File Type: zip Source_Code.zip (46.2 KB, 2 views)

Last edited by Lord.Freddy; Yesterday at 23:25.
Reply With Quote
The Following 5 Users Say Thank You to Lord.Freddy For This Useful Post:
DomoVoi_96 (26-09-2026), Dunnowho69 (26-09-2026), ScOOt3r (26-09-2026), Spinneret94 (Today), wrathma (Yesterday)