Windows: What's Really Happening Under the Hood? | Shop Talk #82

Dave and Glen explore what’s really happening under the hood of modern computers. From memory allocation and malloc to page faults, caches, printf, BitLocker, networking APIs, and software complexity, this episode digs into the systems most people use every day but rarely understand. Along the way, they answer viewer questions about low-level programming, operating systems, security, engineering tradeoffs, and why software often behaves in unexpected ways. Topics include: When to write your own memory allocator Why malloc isn't magic Freeing memory twice Page faults vs cache misses Practical uses of printf BitLocker and security Network programming with select() Operating system internals Engineering lessons from earlier computing eras Shop Talk is driven by viewer questions and comments from Dave's Garage and Shop Talk. Leave your questions below for a chance to be featured in a future episode. #ShopTalk #Programming #SoftwareEngineering #ComputerScience #Windows 00:00 - Hey I'm Dave 00:27 - At what point do you decide to write your own allocator or memory manager over just using malloc and free? 02:42 - Who is Malloc and what gives him power over memories? 03:23 - I always wondered why trying to free something twice was bad. 04:15 - So does task manager use malloc to tell how much ram is being used? 05:21 - Why doesn’t MS make a version of windows that is NOT backwards compatible? 06:56 - What do you say to users who also reply to ever windows issue by claiming installing Linux fixes windows issues? 07:32 - How does the Windows API efficiently manage Ansi and Unicode versions of the same API method? 08:32 - A deep dive into open/fopen with the append flag would be of value. 09:15 - So you Pronounce GUID as GWID ? So how do you pronounce GUI? GWI instead of GOOY? 09:33 - So all of that logic is built into the binary of my program, by my compiler? 10:58 - How does this exploit make the TPM module release the decryption key without a valid password? 12:30 - I don’t know of any applications where user data is being stored in the Registry? 13:35 - How can you trust a system when there is no need to input password to decypt the key? 14:17 - I get why the path length was limited in early Windows, but why does it persist to this day? 16:46 - can you explain why, when exiting from a program written in assembly it takes like 3 seconds for the function to actually finish 17:48 - I always appreciated about Windows is Microsoft’s quite successful attempt, or commitment if you would like, to preserve backward compatibility. 18:32 - Why did MS API’s use the Pascal calling convention, back in the day? 19:24 - Where do handles fit into all of this? 21:53 - What this demonstrates is that bitlocker can never be secure. 22:51 - What books would you recommend for learning bitwise math stuff? I recall hacker’s delight was interesting and mildly impractical 23:37 - Printf does only what it is told too do and doesn’t double-check or tries to guess your intentions, quite liberating, isn’t it? 24:43 - Was printf() the fist function to implement a dynamic number of arguments in a function call? 25:26 - Ironically, saying nibble takes as long to say half-byte or four bits, so why bother even using the word? 26:07 - If you free something and it just gives it back to the mem allocator, why is it so dangerous to touch the address you just free’d? 27:32 - If malloc isn’t magic then why does it stand for Magic Allocation? 27:49 - But what allocates the memory for the memory allocator? 28:39 - Could you do more of these tech stuff, delivered bite size? 29:13 - Can anyone recommend other books or websites that’ll help reinforce low level memory? 29:55 - Dave, you said unrolling the GUID loop could expand the code to the point where it causes a page fault. Are you sure you didn’t mean instruction cache miss? 30:28 - What’s the most mission critical use of printf in modern IT? 31:31 - Registry of Things? RoT? Really? I am LMAO over that one. 31:42 - Autorun was a TERRIBLE idea! 33:06 - Dave, how often (hypothetically) were you approached by NSA to plant backdoors? 34:01 - Is bitlocker something you only have if you know you have it, or is it something everybody has whether I know it or not? 34:32 - How does select() know to wake up when something drops in the bucket? 36:16 - Bens Code 404ed. Did he take it offline? Can you possibly share it with me? 36:33 - D you think programmers should experiment on purposely limiting their machine resources through some virtual environment to try to learn those forgotten skills that value thinking about those limitations? 37:08 - Do you not know who Dave is? 37:34 - Guilty! I passed out some CT money when I was in Brazil, Argentina, India, and maybe in Bahrain. 38:54 - What is the difference between mean time and in between time? 40:14 - Glenn - Be Afraid, be VERY Afraid. 41:56 - Bourbon? Are Canadians allowed to drink Bourbon? 45:59 - Outtakes and shenanigans