Showing archive results for 2004

Jan 23, 2004
Post comments count0
Post likes count0

German, the language of love?

Raymond Chen
Raymond Chen

Love lures French kids to German: Come and learn German - a language of love! Hundreds of advertisements in France this week will promote the unusual message to try to woo teenagers to a language they often consider difficult and ugly. "Language is the key to understand a partner, his culture, working manners and lifestyle," [Frenc...

Non-Computer
Jan 23, 2004
Post comments count0
Post likes count0

The white flash

Raymond Chen
Raymond Chen

If you had a program that didn't process messages for a while, but it needed to be painted for whatever reason (say, somebody uncovered it), Windows would eventually lose patience with you and paint your window white. Or at least, that's what people would claim. Actually, Windows is painting your window with your class background brush. Since most...

History
Jan 21, 2004
Post comments count0
Post likes count0

Fixing security holes in other programs

Raymond Chen
Raymond Chen

Any crash report that involves a buffer overrun quickly escalates in priority. The last few that came my way were actually bugs in other programs that were detected by Windows. For example, there were a few programs that responded to the LVN_GETDISPINFO notification by overflowing the LVITEM.pszText buffer, writing more than LVITEM.cchTextMax char...

Other
Jan 21, 2004
Post comments count0
Post likes count0

What tools should I assume everybody has?

Raymond Chen
Raymond Chen

My code samples assume you are using the latest header files from the Platform SDK (free download), the one that includes support for Win64. If you have an older SDK then you won't have various new data types like UINT_PTR and INT_PTR and should just use UINT and INT. I write code that is Win64-compliant as a matter of course since all code in Wi...

Other
Jan 20, 2004
Post comments count0
Post likes count1

ia64 – misdeclaring near and far data

Raymond Chen
Raymond Chen

As I mentioned yesterday, the ia64 is a very demanding architecture. Today I'll discuss another way that lying to the compiler will come back and bite you. The ia64 does not have an absolute addressing mode. Instead, you access your global variables through the r1 register, nicknamed "gp" (global pointer). This register always points to your globa...

Code
Jan 16, 2004
Post comments count0
Post likes count0

Aw, poor guy, he's so depressed

Raymond Chen
Raymond Chen

I suspect Tanzi isn't going to get much sympathy from, well, anybody. Parmalat's Tanzi is "Depressed" Lawyers for Calisto Tanzi, the jailed head of now-bankrupt European food and dairy group Parmalat, claim that he is "depressed" in prison, constantly asking about his family. The lawyers have suggested that Tanzi be released from prison and plac...

Non-Computer
Jan 16, 2004
Post comments count0
Post likes count1

How can a program survive a corrupted stack?

Raymond Chen
Raymond Chen

Continuing from yesterday: The x86 architecture traditionally uses the EBP register to establish a stack frame. A typical function prologue goes like this: This establishes a stack frame that looks like this, for, say, a __stdcall function that takes two parameters. Parameters can be accessed with positive offsets from EBP; for example, par...

Code