Look- I believe there’s a bigger problem with the x64 reports (can’t believe it took so long for it to sink in). Two x64 OS versions have shipped. BOTH are not supposed to have this bug.
I’m on my way to do a repro with an SP1 RTM build shortly.
Less important and probably not entirely constructive blathering…
The tables are described in the Platform SDK and probably any good article discussing the PE format. They are not strings (strings are variable length, how can you do such a search directly?)- they are conceptually pointers to strings (more precisely they are offsets from the point in memory at which the image is loaded (image base) to the string, which the linker also has to place int he memory image).
So, yes, the first bad value is 0x7FFFFFFF- but that’s an index to an array of ULONGS. To translate that to an effective address, you shift it left 2 bits (because they are 4 bytes in size) meaning you look at base + 0xFFFFFFFC
in the above posted disassembly, it occurs HERE:
MOV ESI, DWORD PTR DS:[EDX+ECX*4]
EDX is the start of the table, and ECX is the index. When you multiply ECX by 4 (surely you see it by now, this time isn’t getting me my repro).
That’s the same offset as you would get for ECX =-1, as I said, so it’s still an entry in the binary’s memory image.
The next time you are not so fortunate if you’re falling off the botom- the index for 3FFFFFFF is 7FFFFFFC, which on an x86 machine (kernel usually sits far enough above 0x80000000 that in adding THAT offset you will wrap far enough, just use your debugger to verify) is going to be an address normally used by a user process. Which is why I’m so sure the mechanism I described is the most likely (except that that first offset just has to point to one valid byte smaller than the first character you are looking for SOMEHWERE in a valid address- I used the binary’s image as an example because it is much less likely to chang eon you, and I was thinking primarily of “code as data” at that point) way to ever get a NULL (once things break).
If you want to be purely theoretcial, then fine, you could always fall off the bottom and manage to hit without page faulting the 30 some addresses this loop will then try, scattered all across the machine’s address space and never changing, and they could never later go invalid and those offsets either never change or always manage themselves to still point to valid data that again somehow never changes or always change to a value [remember one of these comparands is a constant) that would still force middle down and you could just loop forever and never return.
But I’d bet it’s never actually happened to anyone. If it did, they might want meteor insurance!