Case studies
#powershell#debugging#windows#electron#docker#pterodactyl#python#csharp#wpf#bash#security#cpp#git#performance#ci#nodejs#pyside6#react-native
80 posts
·5 min read

DiskDesk · Story
My right-click menu came up empty: pywin32 has no IContextMenu3
To show Explorer's real context menu from Python, I had to call IContextMenu2 and 3, which pywin32 does not expose. Raw vtable slots and a hidden window filled the empty submenus.
In short
- pywin32 exposes IContextMenu but not IContextMenu2 or IContextMenu3, and without those the shell leaves its dynamic submenus empty.
- shellmenu.py calls the COM methods through raw vtable slots with ctypes.
- A hidden window owns the popup and forwards menu messages to IContextMenu3, falling back to IContextMenu2.
#python#com#ctypes#windows
·5 min read

domain_hunter · Story
When a 404 does not mean the domain is free
rdap.org answers 404 for both a free name and a TLD with no RDAP server. DomainHunter only trusts the 404 if the request was redirected to a registry host.
In short
- rdap.org returns a plain 404 for extensions with no RDAP server at all, such as .io and .gg.
- The code counts a 404 as "free" only when the final URL is a registry host, not rdap.org itself.
- Otherwise the result is unknown, and the check falls through to WHOIS.
#python#rdap#domains#http#debugging
·5 min read

domain_hunter · Story
Two traps in a domain checker: a blank WHOIS line and a fake TLD
A regex that crossed a newline would read the next field as a WHOIS host, and a typo extension returns NXDOMAIN, which looks free. Both fixes are a few lines in availability.py.
In short
- WHOIS host discovery uses [^\S\r\n] instead of \s, so a blank whois: line (such as .ga) cannot swallow the next line.
- A name under a non-existent extension gets NXDOMAIN, so the DNS check first looks the extension up in the IANA root zone.
- The repository has one commit, so I tell both stories from the code and its comments.
#python#whois#dns#regex#domains
·6 min read

Light Browser · Story
One parser branch took 215 sites offline in my browser
Cosmetic filter rules I did not support fell through to the hosts-file branch and became blocked domains. chatgpt.com, bing.com and instagram.com stopped loading. Here is the line that did it.
In short
- Filter lines I did not understand were not skipped. They fell into the last branch of the parser and were read as hostnames.
- The fix is an explicit skip for four cosmetic syntaxes, plus a stricter rule for what counts as a trailing comment.
- The same commit made $third-party rules fire only on cross-site requests.
#cpp#adblock#debugging#parsing
·6 min read

Light Browser · Story
Why my browser signed everyone out: the host exited first
Chromium writes its cookie store while it shuts down, and my Win32 shell quit before it finished. The fix was a shutdown barrier that waits for the engine process to exit.
In short
- Chromium saves the cookie database, site storage and an encryption key during engine shutdown. My shell closed its window and quit first.
- The fix is TeardownEngine: close every WebView, drop the environment, then wait on the engine's process handle.
- The same barrier now covers Windows sign-out, the updater restart, deep sleep and engine crashes.
#cpp#webview2#windows#debugging#shutdown
·6 min read

Light Browser · Story
My browser's import feature looked exactly like an info-stealer
Reading other browsers' saved logins is what credential stealers do, so antivirus flagged it. I moved the code into a separate on-demand exe and made the installer per-user.
In short
- Profile-reading and DPAPI code moved out of LightBrowser.exe into a separate lbimport.exe, downloaded only when someone clicks import.
- The tracked main build went from 2,345,984 to 1,323,008 bytes.
- A second commit made the installer per-user, so no UAC "unknown publisher" prompt appears on install or update.
#cpp#windows#security#antivirus#installer
·8 min read

Teaching CodeT5 to read renamed Python: a deobfuscator experiment
I fine-tuned CodeT5 to undo variable renaming in Python. The first run promised 23 hours on CPU, and my own obfuscator turned out to break the syntax it was meant to preserve.
In short
- My obfuscator replaced every word that was not on a 13-item keyword list, so in, not, as and None became variables and the "obfuscated" input was often not valid Python.
- The same training job looked like a 23 hour 41 minute job on CPU (5,625 steps at 15.19 s/it) and a roughly 30 minute job on the GPU (1,405 steps at 1.17 s/it).
- The evaluation log has 740 scored examples with mean BLEU 0.250, ROUGE-1 0.344 and ROUGE-L 0.309. Only 51 of them reach ROUGE-L 0.5.
#python#machine-learning#codet5#code-analysis
·5 min read

Light Browser · Story
The memory saver that made Figma run out of memory
I added Chromium's low-end mode to cut my browser's RAM, and about seven hours later removed it. It halves V8 heap limits, so heavy apps died with out-of-memory exits.
In short
- --enable-low-end-device-mode cut idle RAM, but it halves V8 heap limits, which heavy apps like Figma and Google Docs cannot live with.
- The fix removed the flag, raised the renderer cap from 4 to 16, and throttled my own RAM cascade so it stops squeezing the last open page.
- The crash page now says why a tab died, including "out of memory" and the exit code.
#cpp#webview2#chromium#memory#debugging