Enjoy Newsletter #126.

2. Portable Executables

This article is the second chapter in an introductory series on modern malware development for red teams, focusing on the Portable Executable (PE) format—the shared structure behind executables, dynamic-link libraries, and drivers on Windows. The author walks through the DOS Header, DOS Stub, PE Header, Optional Header, section table, and familiar sections such as .text, .data, .rdata, .rsrc, and .reloc. The core point is that a PE simultaneously describes how the file is laid out on disk and how the Windows Loader maps it into memory: header fields specify the architecture, entry point, alignment, image size, and locations of key data directories, while each section’s attributes determine its contents and its read, write, or execute permissions at runtime.

The second half shifts to the perspective of security products performing static analysis—evaluating a file before it is executed. Common indicators examined include hashes, digital signatures, data entropy, unusual entry point locations, sections marked RWX, large discrepancies between on-disk and in-memory sizes, unfamiliar section names, sparse import tables, and suspicious API combinations. For newcomers, the article illustrates why a solid understanding of the PE structure is foundational both for analyzing malware and for building detection mechanisms against packed or obfuscated binaries.

How 4 bytes of padding make array clearing 49% faster

Part of the “Optimization catalog” series, this post analyzes a memory alignment phenomenon in Go: when a uint32 array sits at a 4-byte offset from an 8-byte boundary, clearing the array slows down dramatically. On the benchmarked Intel processor, adding just 4 bytes of padding to align the array to 8 bytes increases throughput by roughly 49%; on AMD the improvement is only around 9%, and ARM machines are virtually unaffected. Inspecting the assembly reveals that the entire clear is handled by a single REP STOSQ instruction. Based on performance counters, the author hypothesizes that Intel’s fast-string path writes full cache lines directly without reading them first; when the array is misaligned by 4 bytes, an 8-byte store straddles every 64-byte cache-line boundary, so no cache line is ever completely overwritten in one go and the fast path cannot kick in.

Follow-up benchmarks show that SIMD—whether via Go’s experimental intrinsics or handwritten assembly—does not outperform STOSQ. A non-temporal store variant is occasionally faster, but its results fluctuate wildly depending on whether the OS kernel allocates contiguous or fragmented physical pages. The article also considers tagging elements with generation numbers to avoid actually zeroing memory, though generation tags enlarge the array and can push working data out of cache. The takeaway is that low-level optimizations depend heavily on the CPU microarchitecture, machine instructions, and data size, so you always need to measure on real hardware.

Engineering High-Performance Parsers with Data-Oriented Design

This article shares the design principles behind Yuku, a JavaScript and TypeScript parser written in Zig, centered on one thesis: once the grammar is right, parser performance is dictated almost entirely by how the syntax tree is represented in memory rather than the parsing algorithm itself. Instead of individually heap-allocated nodes linked by pointers—which cause tens of thousands of allocations and unpredictable memory accesses—Yuku stores nodes in a flat array and uses u32 indices as references. An index takes half the space of a 64-bit pointer, the entire tree is freed in a single operation, and the recursive-descent parsing logic remains familiar.

The author applies the same data-oriented mindset across the parser: splitting node payloads and source locations into separate parallel arrays so each traversal pass touches only the data it needs; storing variable-length child lists as offset-and-length pairs into an extra buffer; reusing scratch buffers across recursive calls; representing strings as byte spans into the original source; packing operator metadata directly into tag bits; and compressing Unicode lookup tables by deduplicating identical blocks. Size and layout invariants are verified at compile time to prevent accidental regressions. Because the tree consists purely of indices and offsets, its in-memory representation doubles as its wire format, allowing the AST to be handed over to JavaScript as a single contiguous buffer rather than serialized through JSON.

How To Learn Go Fast: A Practical Roadmap For Senior Backend Developers

This article lays out a Go learning roadmap for experienced backend developers, particularly those coming from PHP, Laravel, or Symfony. The author argues that you don’t need to relearn backend fundamentals like APIs, databases, or queues; instead, leverage that foundation and focus on how Go structures programs: explicit code, errors as values, small implicitly satisfied interfaces, explicit dependency wiring, and a preference for the standard library over monolithic frameworks.

The roadmap starts with syntax, types, packages, and error handling before quickly moving into building CLI tools, HTTP services, and concurrent worker systems, since building small projects early teaches the language faster than reading syntax tutorials alone. A 12-week plan progresses from core fundamentals to PostgreSQL, integration testing, race detection, cancellation contexts, profiling, observability, and a portfolio-ready capstone project—treating testing, error handling, and operations as parallel tracks rather than afterthoughts. The post also includes a condensed multi-day track for developers jumping into an existing Go codebase immediately, while still emphasizing production habits like setting timeouts on network calls, implementing graceful shutdown, reading real-world source code, and profiling before optimizing. Ultimately, senior-level Go proficiency shows in your ability to build, deploy, diagnose, and maintain real systems.

How To Prepare For A Golang Interview: A Practical Guide For Mid & Senior Engineers

This article serves as a comprehensive study map for mid- and senior-level Go interviews, emphasizing that interviewers evaluate reasoning and system design rather than mere syntax recall. It covers zero values, packages, slices, maps, pointers, interfaces, error handling, defer, panic, and common memory pitfalls. Topics frequently used to separate candidates are explained in depth—such as shared backing arrays across slices, non-nil interfaces holding nil pointers, channel closing rules, and choosing between mutexes and channels—because these are also frequent sources of production bugs.

The senior section expands into the G-M-P scheduler, the memory model, escape analysis, garbage collection, goroutine leaks, context cancellation, race detection, and profiling with pprof. It also covers testing, databases, HTTP, graceful shutdown, system design, and operational concerns beyond the language itself. According to the author, a strong interview answer articulates choices, trade-offs, and how to verify behavior through tests or benchmarks. The guide concludes with a list of common mistakes, time-boxed coding exercises like worker pools, rate limiters, and retry mechanisms, and a self-assessment checklist for writing correct, production-grade Go.

Shard your locks: benchmarking 6 Go cache designs

This post benchmarks six ways to build a concurrent string → string cache using only the Go standard library: an unlocked map (as a baseline), a single Mutex, a single RWMutex, sync.Map, a 256-shard map, and copy-on-write. Benchmarks run across varying read/write ratios and from one to eight CPU cores. The results show that a single lock does not scale: at eight cores, even a read-only workload with a Mutex is slower than on a single core. RWMutex, the reflexive choice for read-heavy contention, scales only to about 2x before plateauing because its atomic reader counter becomes the new contention bottleneck—and under write-heavy workloads, it performs even worse than a plain Mutex.

The sharded design, where each shard has its own map and lock, is the only approach that consistently ranks near the top across all workloads—outperforming a single lock by up to 8x because operations on different shards proceed in parallel. Copy-on-write leads on pure read workloads but collapses toward zero throughput as soon as writes appear, since every write clones the entire map, making it suitable only for rarely updated data. The author also notes that skewed key distributions can actually speed up reads thanks to CPU cache locality, while concentrating write contention onto a few hot shards. Using 256 shards is a sweet spot for this benchmark rather than a universal constant; before picking a concurrency primitive, always benchmark with your actual key distribution, hardware, and workload.

The .join() That Should Be a Bug

This post explains how Kronotop serves thousands of concurrent connections when nearly every command has to wait on network calls to FoundationDB or filesystem I/O. The author contrasts two familiar architectures: Redis uses a single thread for all connections, holding massive connection counts at the cost of forbidding any blocking command; PostgreSQL uses one process per connection, allowing straightforward sequential blocking code but consuming heavy OS resources as connections scale. Kronotop takes a third path, decoupling connection holding from blocking work to combine the strengths of both models.

A small pool of Netty event-loop threads accepts data, parses commands, and sends responses without ever blocking. Disk I/O and network calls are offloaded to Java virtual threads, where a .join() call—normally considered an anti-pattern or bug in asynchronous code—can block sequentially without pinning the underlying OS carrier thread. Once the result is ready, writing the response is always dispatched back to the exact Netty event loop that owns the connection, keeping concurrency invariants clean and predictable. Each connection also acts as a session holding authentication state, namespace, and open transaction state; when a connection closes or resets, its associated transactions and resources are safely aborted and cleaned up.


This post was rewritten by Claude Code with Opus 5.5 on 27/09/2026.