https://cppcon.digital-medium.co.uk/tag/cppcon/">cppcon.org/
---
Personal Log - Where No Init Has Gone Before in C++ - Andrei Zissu - CppCon 2022
https://github.com/CppCon/CppCon2022
Can your code have logging entries whose sensitive messages don't show up in the shipped binaries? And can the following code snippet ever work?
static bool initially_false = false;
void no_one_calls_me() { DO_ON_INIT(initially_false = true); }
int main() {assert(initially_false == true); return 0;}
Well yes, this is actual working C++17 code! And yes, we can use this tool to produce a logger with vanishing strings!
As part of this talk we will go behind the scenes of the DO_ON_INIT utility, the process involved in developing the idea and its surprisingly simple implementation details (under 20 lines of C++17 code, and even less in C++20).
We shall also see how this utility is instrumental in making possible the no-strings-attached logger and its associated automatically-generated decoding facility. We will implement a simple obfuscation technique which replaces logged strings with hashes at compile-time, to avoid shipping binaries containing sensitive textual giveaways. To decode such logs (in a separate decoder utility) we shall use DO_ON_INIT to automatically collect and register all the logged strings system-wide, along with their hashes, without requiring any additional tool (such as an in-house pre-processor).
This is yet another example of emergent behavior in C++, consisting of unrelated language features being put to use together in a novel and unexpected way. Could your idea be next?
---
Andrei Zissu
Andrei Zissu is an experienced cross-industry C++ developer, notably having worked on low-level reverse engineering systems employing API hooking, DLL injection and other advanced techniques. In early 2022 he joined the WG21 standards committee as a member of the Israeli NB, and is planning to explore the exciting realm of reflection.
Andrei is currently employed at Binah.ai, an Israeli startup developing ground breaking AI-based remote health monitoring technology. The feature presented in this talk has been developed by him in recent months for the Binah.ai C++17 codebase, and is being gradually staged into production code.
Andrei loves the occasional opportunity to explore the rough edges of C++. The latest such opportunity along with its discoveries will be presented in this talk.
---
Videos Filmed & Edited by Bash Films: http://www.BashFilms.com
YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk
#cppcon.digital-medium.co.uk/tag/cppcon/">cppcon #cppcon.digital-medium.co.uk/tag/programming/">programming #cpp