• Welcome to Valhalla Legends Archive.
 

Country abbreviation

Started by Camel, September 19, 2003, 04:40 PM

Previous topic - Next topic

Camel

In battle.snp, Starcraft appears to get LOCALE_SABBREVCTRYNAME, and then chop it off after three bytes, load its value into eax, and put it back in the buffer. I would have assumed, having not looked at it, that the country abbreviation is intereperated by battle.net as a null terminated string. Should I be treating it as a dword instead, and if so does it actually have to end with a null byte?

iago

Yes, it's treated as a dword, at least on client side, and it's stored in a register at one point.  I'm not too sure how it's stored remotely, though, so it's probably safest to leave it null-terminated.
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


Camel

Is it safe to assume that LOCALE_SABBREVCTRYNAME will always yield 3 bytes + null? MSDN is spazzing out on me so I can't check.

iago

I think I remember seeing that Country[3] was set to NULL before being put into a register and sent..
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*