Decoding invalid base64 with state machines
summary
Implements a Go-based finite state machine that decodes malformed or mixed-variant base64 by parsing characters into states (start, alphabet, URL/standard variants, end), peeking ahead to peeks the next characters and recovering when invalid input appears. The decoder replaces invalid sequences with a default character and resumes decoding, lives in the Wapty decode package, needs only a new state to add a variant, and trades raw speed for robustness, debuggability and easy unit testing.
AI-written summary · about
chapters (5)
related talks
26mAccepting complex inputs with simple code
34mDeciphering Your Way to the World of Golang
47mReverse Engineering Go Malware: From Manual to AI-Powered Analysis
18mShattered Mirror: An Introduction to Reflect and Unsafe
30mUnraveling Go Anti-Patterns
22m"Pac Man from Scratch"
38mStruct Embedding, Instrumentation and Code Generation
27mA Deep Dive into Go Malware: Using Metadata to Empower the Analyst
