Detecting DOSBox from Within the Box
atan2
65 points
15 comments
April 17, 2026
Related Discussions
Found 5 related stories in 50.5ms across 4,861 title embeddings via pgvector HNSW
- The Official DR DOS Website Tomte · 46 pts · March 15, 2026 · 50% similar
- Box of Secrets: Discreetly modding an apartment intercom with Matter swq115 · 41 pts · March 24, 2026 · 45% similar
- Breaking the console: a brief history of video game security sprado · 90 pts · April 07, 2026 · 44% similar
- Direct Win32 API, weird-shaped windows, and why they mostly disappeared birdculture · 178 pts · April 15, 2026 · 43% similar
- DirectX: Bringing Console-Level Developer Tools to Windows haunter · 13 pts · March 12, 2026 · 43% similar
Discussion Highlights (3 comments)
tombert
It never really occurred to me that you'd want to be able to detect if something is running in DOSBox, since I figured that the point was to be as compatible as possible with MS-DOS. I guess it makes sense to try it anyway. Now I'm wondering how I'd be able to detect something like Concurrent DOS or REAL/32 or REAL/NG.
Dwedit
The other way to detect DosBox is a one line Qbasic program PRINT VAL("5"). If it's a 64-bit build made using Visual Studio, you get 4.99999999999. Visual Studio doesn't support legacy 80-bit floating point math for that target. Visual Studio also does not support inline assembly to let you make use of the legacy 80-bit floating point instructions. But if you set the CPU core to "Dynamic", then you get the proper value of "5". Or if you use the MingW builds, those also support 80-bit floating point math and give the correct value of "5". It is quite embarrassing to ship a CPU emulator with broken floating point math as the default.
bananaboy
Neat! I’ve detected it with a simple (less reliable) way in the past for a demo (I forget why I needed to do that). It didn’t occur to me to inspect something like a built in command!