I recently had the pleasure of re-installing my sons XP gaming machine after he infested it with viruses, worms, rootkits and everything else he could find on the internet. It’s my own fault really, as I let him run with administrator priveleges because I couldn’t be bothered to set up his games to work properly under a limited user account.
So, now that he’s back up and running (with very limited access), a handful of his games don’t quite work properly and still require administrator access. The “RunAs” command in Windows is practically useless because you still need to enter the administrator password – and then the game launches with the administrator profile, including the registry and documents and settings, and not the profile of the logged on user.
What’s really needed is an equivalent to the Linux sudo command, so that the game can be run with admin priveleges, but with the correct user profile. Enter the greatest utility that I’ve found so far this year – surun.
Surun implements privelege elevation in a safe, secure, and trivially easy way. It makes the “RunAs” command look as useless as it really is. And best of all, my sons games all work flawlessly and he can only elevate those applications that, as the system administrator, I specifically add to a list of known programs. This means that he can’t start an elevated command prompt or anything like that and wreak havoc on the system again.
If you need to run programs that require administrator access on a limited user account, do yourself a favor and get this program. It is completely free and it makes Windows security work in a sensible and painless way. Get It!
Categories: Games · Security
Tagged: Security, sudo, sudown, surun, uac
Ok, so this isn’t strictly a language feature and it’s not terribly useful either, but it did cause me to do a double-take when it compiled with no errors.
I had cut and pasted a URL into the block of code I was currently working on, so I could refer to it more easily. However, I accidentally left it there when I compiled the program, and to my dismay it compiled without complaint! Take the following contrived code block for example:
public int Add( int x, int y )
{
int result = x + y;
http://windowscheerleader.com/
return result;
}
The URL just dumped into the middle of a block of code should certainly have caused some kind of compiler error, right? Or should it…?
In C# (and C++), everything after the “//” is treated as a comment and is therefore ignored. So the compiler will never see ”windowscheerleader.com/”. But that still leaves us with “http:” in the middle of the code.
However, it turns out that the compiler thinks the “http:” is a label – the destination for a goto command! In other words, we could write another silly function like the one below, and the compiler would be perfectly happy with it!
public int GetSmallerValue( int x, int y )
{
if ( x < y )
goto http;
return y;
http://windowscheerleader.com/
return x;
}
As far as the compiler is concerned, we have a label followed by a comment, which is perfectly valid. As I said earlier, this isn’t terribly useful (unless you want to embed uncommented URL’s into your code for some reason), but I did find it interesting. One word of warning though – since the “http:” is a label, you can only use this “technique” once in each scoped block or the complier will get upset with you!
Categories: .NET · Programming
Tagged: C#, goto, label, url
StreamRipper is an excellent open-source plugin for Winamp that allows you to record streaming mp3 directly to your hard drive. It’s very similar to recording songs off the radio onto audio cassette tapes, which is a technology that some younger readers my be unfamiliar with, but it worked well enough at the time.
StreamRipper has a very nice feature where it creates a “relay stream” that you can listen to. Instead of creating two separate streams (one for Winamp for you to listen to, and another for StreamRipper to record from), you can have StreamRipper create a “relay Stream”, which his cuts down on the required bandwidth and allows you to listen to the same stream that you are recording.
I’ve always had a problem getting StreamRipper to create the relay stream properly on Vista, and like everyone else, I was all too keen to blame Vista for Winamp’s inability to connect to the relay stream. However, it turns out that everything is working exactly as it should, and there is a very easy way to get a working relay stream in Vista…
Instead of connecting Winamp to http://localhost:8000, which is the default host and port for the relay, you have to use the local loopback IP address of your local machine instead. In other words, connect Winamp to http://127.0.0.1:8000 and it will work perfectly!
The reason for this, is that localhost under Vista resolves to an IPv6 address and not IPv4 address that previous versions of Windows used. StreamRipper only understands IPv4, and Winamp is apparently trying to connect to it using IPv6. By specifiying the local loopback IP address of your machine explicity, rather than referring to it by name, you are forcing the use of IPv4, which means everything works as it should.
Happy ripping!
Categories: MP3 · Vista · Winamp
Tagged: ipv4, ipv6, localhost, stream relay, streamripper, Vista, Winamp
Yesterday I was unzipping a large (1.7Gb) file on my computer, when the following message box appeared:

Apart from the fact that the responses don’t actually make any sense with regard to the question, I wasn’t even using Internet Explorer to copy the files! I had IE open, but the zip file was being extracted from Windows Explorer…
Anyway, the archive was extracted just fine and everything seems to be working normally again, so I guess there’s nothing really to see here. I just thought it was curious.
Categories: Internet Explorer · Vista
Tagged: explorer, ie, Internet Explorer, windows
Just a quick note to let Electronic Arts know that I won’t be buying Spore - at least until they remove the draconian DRM from it. I’m not paying $50 for a game I can only install 3 times, even if I uninstall it after each new install. What happens when the activation servers go offline in a few years?
Anyway, enough people have written about this, including bombing the Amazon reviews for the game, that I don’t really have much to add. Other than the fact that I won’t be pirating it either. Downloading and playing a cracked version will only enforce EA’s view that the game didn’t sell due to piracy – and not becaue of the ridiculous restrictions placed upon it.
So I bought my son Star Wars: The Force Unleashed for his birthday instead. It’s not a very deep or challenging game, but until you’ve seen a seven year old jumping up and down on the couch while cutting down clone troopers with a Wii remote, using his force powers to blow everything up – well, you just haven’t lived!
Categories: DRM · Games · Sucks · Wii
Tagged: DRM, force unleashed, spore, star wars, Wii