惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 叶小钗
O
OpenAI News
V
V2EX
大猫的无限游戏
大猫的无限游戏
博客园 - 聂微东
S
Schneier on Security
C
CXSECURITY Database RSS Feed - CXSecurity.com
小众软件
小众软件
L
LINUX DO - 热门话题
C
Cybersecurity and Infrastructure Security Agency CISA
博客园 - Franky
Security Latest
Security Latest
S
SegmentFault 最新的问题
Project Zero
Project Zero
Spread Privacy
Spread Privacy
K
Kaspersky official blog
J
Java Code Geeks
V
Vulnerabilities – Threatpost
C
Cisco Blogs
C
CERT Recently Published Vulnerability Notes
月光博客
月光博客
T
The Exploit Database - CXSecurity.com
L
Lohrmann on Cybersecurity
人人都是产品经理
人人都是产品经理
博客园 - 三生石上(FineUI控件)
Scott Helme
Scott Helme
WordPress大学
WordPress大学
量子位
T
Threat Research - Cisco Blogs
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
宝玉的分享
宝玉的分享
Hugging Face - Blog
Hugging Face - Blog
AWS News Blog
AWS News Blog
Help Net Security
Help Net Security
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Simon Willison's Weblog
Simon Willison's Weblog
S
Secure Thoughts
博客园 - 【当耐特】
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
V
Visual Studio Blog
Last Week in AI
Last Week in AI
T
Tailwind CSS Blog
腾讯CDC
Cyberwarzone
Cyberwarzone
IT之家
IT之家
GbyAI
GbyAI
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
云风的 BLOG
云风的 BLOG
T
Troy Hunt's Blog
D
Docker

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
I parsed Steam's binary shortcuts.vdf with zero dependencies
Wes Ellis · 2026-06-28 · via DEV Community

I have a Steam Deck and a pile of self-contained Linux games — Godot exports, LÖVE builds, the odd plain ELF — that aren't on Steam. Getting one of them to show up in Game Mode as a proper library tile, with box art, controller-ready, is more fiddly than it should be. So I wrote a small tool to do the boring parts for me, and the most interesting part of building it turned out to be the file format Steam uses to track non-Steam games.

This is a writeup of that part: reading and rewriting shortcuts.vdf, why I did it with nothing but the Python standard library, and a couple of gotchas that cost me time so they don't cost you any.

Quick honesty note up front, because it shapes everything below: this is a side project. The format parsing is tested for clean round-trips, but I have not confirmed the full pipeline end to end on real Deck hardware yet. Treat the code as "interesting and worth poking at," not "battle-tested." Repo is at the bottom.

The actual problem

When you "Add a Non-Steam Game," Steam doesn't write a config file you can comfortably hand-edit. It records the entry in shortcuts.vdf, a binary file in Valve's KeyValues format, sitting in your userdata directory. If you want a game to appear without clicking through the UI, you have to write a valid entry into that binary file yourself.

And there are three smaller problems hiding behind that one:

  1. The game's executable bit gets stripped the moment you copy it over SFTP or SMB. A Linux game with no +x silently refuses to launch, and it's the single most common reason a copied-over game looks broken.
  2. The artwork (capsule, hero, logo) has to be named after an app ID that Steam computes internally — so you can't just drop in cover.jpg and hope.
  3. SteamOS's root filesystem is immutable, which quietly rules out a whole category of "just pip install it" solutions.

That third one is what makes the design fun.

Why zero dependencies

The obvious move is to grab an existing VDF library off PyPI and move on. But the script's home is the Deck itself, and SteamOS mounts its root read-only. Installing pip packages onto it is a fight you don't want to have on a device that wipes changes outside /home on every system update.

So the constraint became a feature: the thing that runs on the Deck imports nothing outside the standard library. No vdf, no requests, no pillow. struct, zlib, os, shutil — that's the toolbox. The upside is a single file you copy over and run with python3, with nothing to install and nothing to break after an OS update.

To keep that honest as the code grew, the importer lives as a normal package during development and a build script flattens it into one file, with CI checking two things: that the flat file stays in sync with the package, and that it imports nothing outside stdlib. If someone adds import requests to the Deck-side code, the build fails.

Reading the binary KeyValues format

shortcuts.vdf is Valve's binary KeyValues. Once you've stared at a hex dump for a while it's actually a tidy little format. Every value is introduced by a one-byte type tag:

  • 0x00 — start of a nested object (a map). A null-terminated key name follows, then the object's contents.
  • 0x01 — a string. Null-terminated key, then a null-terminated UTF-8 value.
  • 0x02 — a 32-bit little-endian integer. Null-terminated key, then four bytes.
  • 0x08 — end of the current object.

The whole file is one top-level map named shortcuts, whose children are "0", "1", "2", … — one numbered object per game. Each game object is a flat bag of fields: appid (an int), AppName, Exe, StartDir, LaunchOptions (strings), and a nested tags map for collections.

Parsing it is a small state machine: read a type byte, read a null-terminated key, then dispatch on the type to read a string, an int, or recurse into a nested map, until you hit 0x08. Writing it back is the same walk in reverse. Nothing exotic — but it is unforgiving, because one misplaced byte and Steam treats the file as corrupt.

The rule that kept me sane: byte-identical round-trips

The scariest thing about rewriting a file Steam owns is clobbering shortcuts the user already has. So before adding a single feature, I made the parser pass one test: read a real shortcuts.vdf and write it back out byte-for-byte identically. If I can't reproduce the input exactly, I don't understand the format well enough to be editing it.

That round-trip test is the backbone of the whole thing. Adding a new entry then becomes "parse the existing structure, append one object, serialize" — and because serialization is proven faithful, the existing entries come out untouched. The tool also backs the file up before writing, but the real safety is that the write path is boring and verified rather than clever.

Detecting the game binary

A dropped game folder is a mess of files: the executable, shared objects, data packs, maybe a readme. Picking the right binary to launch is a small heuristic:

  • Read the first bytes and check for the ELF magic (\x7fELF). No magic, not a candidate.
  • Skip shared objects (.so), because a library is not a game.
  • Score what's left. A Godot *.x86_64 export wins easily. Failing that, prefer a bare-named ELF, or one whose name resembles the folder, or — last resort — the largest executable, on the theory that the game is usually the biggest binary in the box.

Then chmod 0755 it, because of that stripped execute bit from earlier. This one line fixes the most common "why won't my game start" complaint before it happens.

The neat trick: one ID names everything

Here's the detail that makes the two halves of the tool — a PC side that fetches artwork, a Deck side that registers the game — work without having to coordinate.

Steam keys both a non-Steam shortcut and its artwork off a single app ID. So if you can compute that ID deterministically, you can name the art files correctly before Steam ever sees them. The ID is derived from the executable path and the game name:

import zlib

def shortcut_appid(exe: str, name: str) -> int:
    return zlib.crc32((exe + name).encode("utf-8")) | 0x80000000

That | 0x80000000 sets the high bit, landing the number in the range Steam reserves for non-Steam shortcuts. Because it's deterministic, the same integer that goes into shortcuts.vdf also names the grid art:

shortcuts.vdf  appid = 3580912219
config/grid/   3580912219p.jpg      (portrait capsule)
               3580912219.jpg       (landscape grid)
               3580912219_hero.jpg  (hero banner)
               3580912219_logo.png  (logo)

So the PC side never needs to know the Deck's file paths or the final ID. It ships generically named art (cover, hero, logo), and the Deck computes the ID once and renames everything to match. This deterministic-ID approach isn't something I invented — it's the same pattern Steam ROM Manager and SteamTinkerLaunch rely on, which is exactly why Steam honors a hand-written app ID and matches the artwork to it.

Gotchas that cost me time

A few things that are not in any obvious place and that I'd want a past version of myself to know:

  • Steam must be closed when you write the file. Steam holds shortcuts.vdf in memory and rewrites it on exit, so any edit you make while it's running gets silently wiped on shutdown. The tool refuses to run if Steam is up. Restart Steam afterward to pick up both the new shortcut and the new art.
  • You can't precompute steam://rungameid/<id> anymore. Valve randomized the Big Picture launch ID per-add, so the old trick of building a launch URL ahead of time is dead. The way around it is to not need it: you launch by tapping the tile in Game Mode, not via a URL.
  • SteamOS updates wipe everything outside /home. Enabling SSH and setting a password live on the immutable root and can be reverted by an update. Your games, your shortcuts.vdf, and your grid art all live in /home and survive — but you may have to re-enable SSH once after a big update.
  • Removing a game leaves orphans. Steam doesn't clean up a removed shortcut's shortcuts.vdf entry, its compat-tool mapping, or its grid art. Cleanup is on me, not on Steam.

What I deliberately didn't build

The tool's lane is native Linux games, where it's genuinely lightweight. For Windows games I stopped short on purpose. Recreating a Windows environment — Wine/Proton prefixes, DirectX and Visual C++ redistributables, per-game fixes — is an enormous, already-well-solved problem owned by Lutris and Bottles. Reimplementing that badly would help no one. At most the tool writes the Proton compatibility-tool mapping and defers the hard part to the tools that do it well.

Knowing where to not extend a side project is, I think, underrated.

Takeaways

The thing I keep coming back to is that the immutable-filesystem constraint, which felt like an obstacle, produced the cleanest design decision in the project: no dependencies, one file, verified-faithful serialization. The interesting work wasn't a framework — it was understanding a binary format well enough to reproduce it exactly, and finding the one deterministic ID that let two separate halves agree without talking to each other.

If you want to look at the code, pick holes in the VDF handling, or — especially — try it on an actual Deck and tell me what breaks, the repo is here:

https://github.com/wesellis/deckport

And the recipe book / project site:

https://wesellis.github.io/deckport/

Feedback and corrections welcome. It's a hobby project and it improves fastest when someone who knows this corner of Steam better than I do points out what I got wrong.