Cheating the hacker way

A couple of days ago I found this cute little game for OS X called »Chopper«. I played it several times but I couldn’t make it to the last level although I played it on »easy«. Since it is open source I thought I could compile it with more lives but unfortunetly it didn’t compile because the file libfmodUniversal.a was missing for some reason. Good to have hackers around though – with the help of one of them I used »gdb« to get the job done. This is what I did (with Chopper Version 1.04):

First download Chopper and its Source from majicjungle.com. Then I navigated to the source folder for chopper and started gdb in that directory with the executable path

$> cd /Volumes/Data/Downloads/Chopper_104_src/Source
/Volumes/Data/Downloads/Chopper_104_src/Source $> gdb /Volumes/Data/Downloads/Chopper\ 1.0.4/Chopper.app/Contents/MacOS/Chopper

Then I set a breakpoint in playerStats.m on line 33. This is where the initial lives are set.

(gdb) break playerStats.m:33
Breakpoint 1 at 0x23ede: file /Users/davidframpton/Documents/Code/Old Projects/Chopper_104/Source/playerStats.m, line 33.

Then run the app:

(gdb) run
Starting program: /Volumes/Data/Downloads/Chopper 1.0.4/Chopper.app/Contents/MacOS/Chopper
Reading symbols for shared libraries ............................................................................ done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries .. done
Reading symbols for shared libraries . done
Reading symbols for shared libraries .. done
Reading symbols for shared libraries . done
Reading symbols for shared libraries .. done
Reading symbols for shared libraries ... done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries .. done
Reading symbols for shared libraries .. done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done

Now click »new game« with whatever difficulty you prefer. Now press escape to switch to windowed mode so you can see the terminal output. As you can see gdb stopped at the breakpoint we set before:

Breakpoint 1, -[playerStats init] (self=0x17198290, _cmd=0x90a64924) at /Users/davidframpton/Documents/Code/Old Projects/Chopper_104/Source/playerStats.m:33
warning: Source file is more recent than executable.
33 lives = startLives;
(gdb)

Now press »n« to step into

(gdb) n
34 nextExtraLife = 2000;

If you now enter the following you see the original number of lives to start with:

(gdb) print lives
$1 = 4

Now set your preferred number of initial lives

(gdb) print lives=1000
$2 = 1000

Now enter »c« to continue

(gdb) c
Continuing.

Now switch back to Chopper and have endless fun! Cool huh?

Chopper with 1000 lives

Continue reading

Berlin – Brennende Autos und so

Wusstet ihr eigentlich, dass zur Zeit fast jede Nacht in Berlin Autos brennen? Kann man sich hier von überzeugen: http://www.berlin.de/polizei/presse-fahndung/presse.html
Es gibt auch einen RSS Feed

Im Kreuzberg formiert sich außerdem gerade Widerstand gegen eine geplante McDonalds Filiale. In der Zwischenzeit veranstaltet die Polizei Bundesweit Razzien bei potenziellen G8 Gipfels Störern und der Spiegel stellt überdies hinaus fest das die Republik nach links (link) rückt.

Zur Krönung verspricht unsere Kanzlerin, Frau Merkel, noch folgendes:

»Im Zusammenhang mit dem G8-Gipfel in Heiligendamm wird es sehr, sehr große Demonstrationen geben von Tausenden und Abertausenden friedlichen Demonstranten. Es gibt überhaupt nicht die geringste Besorgnis, dass diese Demonstrationen nicht auch abgehalten werden können und auch sehr stark unterstützt werden zum Teil von Popsängern und anderen mehr.«

(link)

Man könnte meinen es dauert nicht mehr lang bis nicht nur Autos brennen …

Hihi

Apple Wahlcomputer

Schon etwas älter aber dennoch lustig. Hier gibts noch mehr.

How to bind WEBrick to any IP address

I found several and somewhat complex solutions for this particular problem but actually it’s a no-brainer once you know. Simply type:

hukl$ script/server -h
=> Booting Mongrel (use 'script/server webrick' to force WEBrick)
Usage: server [options]
    -p, --port=port                  Runs Rails on the specified port.
                                     Default: 3000
    -b, --binding=ip                 Binds Rails to the specified ip.
                                     Default: 0.0.0.0
    -d, --daemon                     Make server run as a Daemon.
    -e, --environment=name           Specifies the environment to run
                                     this server under
                                     (test/development/production).
                                     Default: development

    -h, --help                       Show this help message.

The magic trick is to use sudo to start WEBrick, else the bind might not work and the webserver is unreachable for virtual machines or other hosts.

sudo script/server -b 10.0.2.1 -p 80

Yippeeh! Now I can test my Ruby on Rails projects, which are running on OS X, from my WinXP Paralles virtual machine using IE6 and IE7.

Continue reading

Sonntag Morgen

… nach dem gemeinsamen Frühstück bereitete ich frischen Orangensaft zu. Danach saßen wir beide vor unseren Computern. Sie las de.wikipedia.org/wiki/Werbung während ich mich mit de.wikipedia.org/wiki/Pyramiden beschäftigte. Dazu tranken wir den Orangensaft und sie sagte, aus dem Fenster schauend: »Schönes Wetter heute« …

Continue reading