Posts tagged “games”.

The Game of Life

I broke down a few weeks ago and bought games for my kids computer. I picked up the “Game of Life, Path to Success”, “Monopoly, Here and Now”, and “Scrabble” all for the Machintosh in a “Board Game Trio II” pack. They came to about $8 a title after shipping, which is my price point for trivial software. I thought it was a great deal. But it got even better when the software didn’t behave as expected. So now I didn’t just have great cheap games. I had great cheap games that “non-privledged users” couldn’t save their progress on. I called support, and they were very polite and helpful, but I was going to have to wait for the guy who actually programmed the games to get back into the office for the solution to my specific issue. It might be a day or so.

Anyone who knows me, knows I’m not one for waiting. And, I figured it was a challenge. Could I figure it out before the programmer emailed me with the answer? The clock was running. I had myself a hacking opportunity!

So, I first started up the game as a privileged user and created a character with a name of “Rumplestiltzkin”. I then searched for \*umplestiltzkin\* with the UNIX command find, hoping that the character’s name was used in the save file on disk. No luck. Without knowing the filename, and not having the character’s name in the filename, I was at a big loss.

Then I said to myself, “Self, there aught to be a program that tells you what files are being accessed on your system.” To which I replied, “Well, self, if such a program exists, I bet google knows about it!”

I searched Google for a few minutes and came up with a shareware/nag-ware program called fseventer which allowed me to see what files were being accessed real time. The only file that looked promising was /Applications/Game\ of\ Life\ -\ Path\ to\ Success.app/Contents/Resources/Source/gol.txt. I opened gol.txt up in Textedit, scrolled to the bottom, and there in clear text was Rumplestiltzkin! I had found the save file!

Now when I did a directory listing with the command “ls -al” it listed gol.txt as -rw-rw—- which means that the owner and group may read and write to the file, but everyone else has no access. This is easily fixed with a quick terminal command run in the directory where gol.txt exists: “chmod 666 gol.txt”. What that does is sets the file to “-rw-rw-rw” permissions, which allows everyone on the system to read and write to the file.

666 may seem a bit satanic, but trust me, it’s not. The permissions are binary, and the values for each group are READ which equals 4, WRITE which equals 2, and EXECUTE which equals 1. These three bits in binary, if they were all on would be 111, or 7 in decimal. For read and write permissions only it would be 110 in binary or 6 in decimal. For read only permissions it would be 100 in binary or 4 in decimal. And for read and execute permissions it would be 101 in binary and 5 in decimal. For more information about unix permissions… read a book, google unix permissions, or take a look at this cool unix permission calculator!

I figured it out before I read the email reply from the support department, however, I didn’t fix it before the email arrived. Can I claim a tie?