How to use RtlUnwindEx

Disclaimer:  I’ve never actually written an unwind personality routine, so take what’s here with a grain of salt. A few days back, I spent 30 minutes defending the C++ runtime’s exception handling personality routine to the guy that has the less than enviable job of supporting the .Net Framework’s exception handling personality routine.  The eventual…

1

Bug in x86 inline assembly to watch out for

Imagine this very lame code:int main() {} void BugAsm() { __asm { MOV [ESP+12],OFFSET main } } void(*BugAsmPt)()=&BugAsm; // this is just to make sure the function is not removed by /OPT:REF Now imagine your significantly less lame code doing something similar.Now imagine that the compiler crashes with a bizzare message about “x86\code.c” something or…

2

ML64 bug to watch out for

If you’re porting your application to x64, and you use much in the way of __asm in your x86 code, you’re likely to start looking at ml64 – the 64 bit version of Masm.  The reason you’re likely to do this is that the x64 compiler doesn’t support __asm blocks in C code.  So you…