Back To Schedule

Personal Log

Where No Init Has Gone Before

11:00 - 12:30 Thursday 11th May 2023 MT Bethe Hall
Intermediate
Advanced
Tooling/Utilities

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, without any external pre-processing step! 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.

This talk is not just about logging! The vanishing logs are the use case for which I developed DO_ON_INIT, which is in itself a general-use utility allowing you to run custom code at the beginning of time. And unlike other log obfuscation mechanisms I've seen, the mechanism outlined in this talk uses no external tooling or preprocessing script - what happens in C++ stays in C++.

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?

View Slides

Andrei Zissu

Windows Software Developer Tech LeadMorphisec

Andrei Zissu is a veteran 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. His current main focus in WG21 is on finally getting reflection into C++ (fingers crossed).

Andrei is currently Windows Software Developer Tech Lead at Morphisec, an Israeli defensive cyber company developing revolutionary Automatic Moving Target Defense. The feature presented in this talk was developed by him while working at Binah.ai, an Israeli remote health monitoring startup. The feature was being gradually staged into production code in Binah.ai's C++17 codebase.

Andrei is a big fan of the Eurovision Song Contest, and this will be the first time he's missing it in several decades. He'll also be celebrating his birthday on the same day as his talk at CppNow.