Abusing c_variadic in Rust
The article discusses the use of the c_variadic feature in Rust for handling variadic functions through C/C++ FFI interop. It details the challenges faced while implementing function calling and hooking in a cheat framework for a video game. The author shares insights on how they overcame these challenges using c_variadic, despite its limitations.
- ▪c_variadic is a recently stabilized feature in Rust that allows sending variadics through C/C++ FFI interop.
- ▪The author faced challenges in implementing function calling and hooking in a cheat framework for a video game.
- ▪Using c_variadic, the author was able to call functions with varying numbers of parameters, although it comes with risks.
Opening excerpt (first ~120 words) tap to expand
try { if(localStorage) { let currentUser = localStorage.getItem('current_user'); if (currentUser) { currentUser = JSON.parse(currentUser); if (currentUser.id === 3959339) { document.getElementById('article-show-container').classList.add('current-user-is-article-author'); } } } } catch (e) { console.error(e); } Tim Posted on May 30 Abusing c_variadic in Rust #rust #ffi #systems #software What is c_variadic? c_variadic is a recently stabilized feature in Rust that lets you send variadics through C/C++ FFI interop. The best example is with int printf(const char* format, ...): The ... are your variadics and allows you to pass any number of parameters.
…
Excerpt limited to ~120 words for fair-use compliance. The full article is at DEV.to (Top).