3 ms·
I know what this code is supposed to do. I wrote it myself expecting to see "General Protection Fault". IIRC, it indeed faulted when executed from main() in a
by mich41 14y ago
I know what this code is supposed to do. I wrote it myself expecting to see "General Protection Fault".
IIRC, it indeed faulted when executed from main() in a C application, but somehow it hanged Windows 95/98 when inserted immediately at the _start label of a simple 32-bit assembly code. So either executables had some "run in ring3" flag which my assembler didn't set, or the pre-main() initialization code was handled in some special way (executed in supervisor mode or with broken exception handling resulting in a lockup).
- daeken 14y agoAhh, misunderstood your original statement, sorry! And yeah, it should fault; I don't see why they'd run init code in ring0, but win9x did some very strange stuff. There was some malware that I'm trying to recall that would rewrite the IDT and then trigger an interrupt, immediately running itself in ring0 -- anyone know which that was? I used to have the assembly sitting around, since it was a fun little virus to analyze.