Hacker News new | comments | ask | show | jobs | submit login
Windows Executable Walkthrough Graphic (corkami.com)
209 points by philthom on July 19, 2012 | hide | past | web | favorite | 34 comments

One of the things that's held back Windows and made it so complex, according to an MS engineer I recently spoke with who's been with the company since the 80's, is that it contains thousands of pieces of code to fix bugs in third-party software.

In other words, there's code in Windows 7 that prevents crashing due to a rare bug in Where In The World Is Carmen Sandiego v1.3 (hypothetical example). And so on.

Relevant Old New Thing post: "The real cost of compatibility is not in the hacks; the hacks are small potatoes"

(The Old New Thing is a blog by veteran Microsoft shell team developer Raymond Chen, and it's a must-read for all developers.)


"a must read" for all Windows developers.

Actually, I think it's a good read for all developers, irrespective of platform. The underlying message of the post above is relevant to anyone writing something that interfaces with third-party code. Not to mention, it's a good look into how one of the larger software companies approaches compatibility.

If you find yourself doing a platform, you're going to run into these issues.

The biggest problem seems universal: You were an idiot and cut a corner three years ago, and you have to break something to move forward. Now what?

The Mac has some classic and poignant examples of this that have actually been trapping people for 50 years. Such as: Use of the high byte of a pointer to have non-pointer meaning (some 1980s ear Mac callbacks set flags in the "unused" high bits of a pointer, and the IBM 360 team made the same mistake in some of their OS data structures). In both cases, fixing this issue was pretty nasty.

Study history or repeat it, your choice. :-)

Not just Windows developers.

Microsoft Office for Mac v.X was released on November 19, 2001. It ran without incident for a decade on the latest and best Macs that money could buy through July 20, 2011. This was not by happenstance.

Other operating systems have similar issues as well.

I'll go one further and say all software has similar issues.

To give you a more concrete examples a game project I work on has many characters with skills. There is a lot of shared code across the skills, which is a good thing. A handful of skills are of the "charge" type. Press a button and lunge forward, each with it's own variation. Knockback targets, grapple targets, throw, throw backwards, apply buff to charger, apply debuff to victim, leave acid trail of damage, etc.

The whole setup has been built up over years and is tragically fragile today. Adding in a new charge variant requires being very careful you don't break any of the pre-existing skills. It may seem safe, and even appropriate, to make minor changes in the sequence of events but there's a good change it will break one skill in one particular case where multiple, infrequent combination of factors are in play.

This is obviously off topic, but do you happen to work on a MOBA?

Real example I heard on internship interview at MS:

Printers lie. Printers have embedded fonts and when you can use them instead rendering the text in software, the results end up better. But printers lie about which fonts they have and which characters are represented in them, so Word has (or used to have) this very big lookup table that basically tells "if you're printing on printer X from vendor Y, don't trust what it says about fonts and just send rendered text to it".

> One of the things that's held back Windows

It's also one of the things that's kept Windows strong.

Windows 95 contains special memory management code for the original Sim City, but I suppose that probably got removed with all the other 16-bit supporting files in x64 versions of Windows, at least. Perhaps it's still hanging around in 32-bit Windows 7, though?

Imagine legacy stuff and standards on the web after 32 years!


In the reddit thread the original author said: "I will also do a linux (ELF) version, but not in the near future."

For a Mac OS X version he would need a Mac (which he don't has.)

Nice one. I'd love to see a walkthrough for .NET executables[1].

[1] http://en.wikipedia.org/wiki/Portable_Executable#.NET.2C_met...

You can always start investigating yourself first! :)

For any new reverse engineers in Hacker Newsland, another win32 PE classic is Ero Carrera's diagram from 2005: https://www.openrce.org/reference_library/files/reference/PE...

Ero is actually planning to release his other 2 commercial diagrams, that you can see http://blog.dkbza.org/2007/10/openrceorg-goodies.html in preview He's just lacking motivation ATM, so contact him if you're interested.

"made entirely under Inkscape" +1

- The PDF takes forever to render in Adobe PDF Reader 9.

- The Content-Type of the SVG is text/plain so Firefox doesn't render it.

- The JPG has a Content-Disposition of "attachment" so Firefox forces me to download it locally.

Not a pleasant experience.

I don't control any of these sadly. the image is easily viewable at http://imgur.com/a/t33Rr though.

This is great but why is English the only version that is in jpg rather than png?

No big difference: unlike what I initially thought, the JPG didn't look much better or worse than the PNG, with a similar filesize.

because you do not deserve better if your browser supports neither PDF nor SVG?

I was browsing on the original iPad. For some reason, certain PDFs seem to stress it out when rendering and it really lags. It also did not correctly display the SVG link.

So all I was left with was the JPG link which was unfortunate because of the lossy compression which makes the finer details slightly blurred.

A PNG would have been perfect and I noticed that all other languages had a link to a PNG but english.

I was browsing on an iPad 2 in Chrome and had similar problems. SVG displayed as text, PDF and JPG were blurry and wouldn't zoom correctly. Once I got on my laptop the SVG still displayed as text but the PDF and JPG were perfectly clear. Still not sure why the others are PNGs and the english version is JPG; clearly PNG is better suited.

This is awesome. I would love to see versions of this for Linux and OS X.

This is awesome :)

Or sad. Depending on your outlook ;)

Is Mach-O on OS X or ELF on Linux any more or less sad?

Don't know about Mach-O, but ELF is actually a rather nice and clean design.

Much of the hate PE gets is because of the silly overloading with .NET assemblies.

Oh yeah, and now also WinRT metadeta.

It annoys me mildly that .NET requires you to have a little native stub in assemblies, but the Windows loader does not actually execute it.

It annoys me more than just mildly to see .exe and .dll on linux. And that silly native stub!

Applications are open for YC Summer 2019

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact