v2.3.3-beta
Wasabi v2.3.3-beta
What's New
High-Performance Assembly Engine (Wasabi ASM)
This release introduces a paradigm shift in VBA networking performance. We have successfully offloaded critical byte-processing bottlenecks from the interpreted VBA runtime directly to the CPU via Machine Code Thunks. Wasabi now executes native x86 and x64 instructions for heavy lifting, achieving C-level throughput.
Integrated Low-Level Thunks
ws_mask(Assembly): A complete rewrite of the WebSocket XOR masking logic. By eliminating the high-overhead VBAFor...Nextloops, payloads ranging from kilobytes to several megabytes are now masked in microseconds.mem_zero(Assembly): Implements hardware-level memory zeroing using therep stosbinstruction. This provides a lightning-fast way to clear internal buffers without the overhead of external DLL calls.mem_find(Assembly): An ultra-optimized "Needle in a Haystack" search engine powered by therepe cmpsbinstruction. It allows Wasabi to scan massive TCP streams for delimiters almost instantaneously.
Core Engine Otimizations
- Native Entropy via
RtlGenRandom: Replaced the legacyCryptGenRandom(which required complex CSP context management) with theSystemFunction036(RtlGenRandom) API. This fetches cryptographically secure random bytes for WebSocket masking directly from the Windows Kernel with significantly lower latency. - ASM-Powered
TcpReceiveUntil: The blocking read-until-delimiter logic has been refactored to use themem_findthunk. Searching for patterns like\r\nor custom binary delimiters no longer blocks the Office UI thread during large data transfers. - Proactive Buffer Sanitization: Updated the
CleanupHandleroutine to utilize the newmem_zeroengine. Upon connection teardown, all sensitive buffers (recvBuffer,DecryptBuffer,TcpRecvBuffer) are physically zeroed in RAM to prevent data leakage and improve security.
Internal Architecture & Bug Fixes
- Discord Gateway Fix (Error 4002): Resolved a critical race condition/logic bug where payload data was being XORed in-place over uninitialized memory segments. Introduced a dedicated copy-buffer step before masking to ensure full compatibility with Discord's strict frame validation.
- Zero-Footprint Encapsulation: All assembly-related infrastructure (
LoadThunk,WasabiMemFind,m_ptr*pointers) is now strictlyPrivate. The engine complexity is completely abstracted away, leaving a clean, high-level API for the end user. - Binary Lifecycle Management: Added
InitWasabiThunksandShutdownWasabiThunksprocedures. These manage the safe allocation of executable memory viaVirtualAllocwithPAGE_EXECUTE_READWRITEpermissions and ensure all allocated pages are freed immediately uponWSACleanup. - Dead Code Elimination (JIT Cleanup): Stripped legacy bitwise math functions (
U32Shl1,SHR32,ROTL32,ADD32) and unused thunks likeswap_32. This reduces the module size and minimizes the memory footprint. - Hardened
SafeArrayLen: Improved the pointer-based array length detection. By usingVarPtrArrayandCopyMemoryFromPtrinstead ofOn Errortraps, the module is now significantly more stable when handling uninitialized dynamic arrays.
Validated
Full test suite executed on Windows 10/11 (x86 & x64) across Excel 365, Word, and Access:
| Test Case | Status | Details |
|---|---|---|
| Discord IDENTIFY Masking | ✅ Passed | Resolved 4002 error; handshake stable. |
| Throughput (10MB Payload) | ✅ Passed | Masking overhead is now sub-millisecond. |
| Secure Wipe on Close | ✅ Passed | Verified RAM zeroing via memory dump. |
TcpReceiveUntil Scanner |
✅ Passed | ASM scan found \r\n in 1MB buffer instantly. |
| x64 FastCall Alignment | ✅ Passed | Registers (RCX, RDX, R8, R9) verified stable. |
| x86 Stack Integrity | ✅ Passed | Ret 16 cleanup verified; no stack corruption. |
| Kernel Entropy | ✅ Passed | RtlGenRandom successfully seeding mask keys. |
Tip
Performance Impact: With the Wasabi ASM Engine, processing overhead for the networking layer is now effectively "free" in terms of CPU cycles. This allows your VBA project to dedicate 100% of its execution time to your bot's logic or data processing rather than handling protocol-level math.