Friday, October 1, 2010

Miniclip lumberjack games hack with Autoit

I haven't wrote for a long time, even tho I made some great progress in hacking, with attack types of XSRF and Email Injection, maybe I'll write about those later, maybe not, but now I need to publish my newest creation: hacking lame games, which only requires you to destroy your keyboard.

I'm talking about the games like the newest game at miniclip.com, the Lumberjack Games. I used my hack on that, so I'll make that the example, even tho it can be used on many other simple games.

The hack is written in AutoIt and does one simple task: it presses the "x" button, which in our case is the chopping trees in most cases.

The simplest way to do that is:
While 1
Send("x")
WEnd

But you don't want to use it in every game, which are switching pretty fast, and this script can hardly be closed (only from task manager), so I decided to make a GUI for it. A tiny simple one:



This GUI is described by the following code:
$mainwindow = GUICreate("X-Spammer", 170, 50)
$spam = GUICtrlCreateButton("Spam", 30, 15, 60)
$stop = GUICtrlCreateButton("Stop", 100, 15, 60)

GUISetState(@SW_SHOW)

But with this code we can't do much, it will simply start and finish, so we need to add some event handlers. First we tell that we would like to work in event mode:
Opt("GUIOnEventMode", 1)

Then we add some events with functions. The idea here is that we'll have a controller variable which has a value of 0 on startup, change it's value with the corresponding button pressed (set value of 1 when start and 0 when stop is pressed) and modify our loop, so that will spam the button "x" only when our controller, in this case $doit has a value of 1.

The complete code:
#include <guiconstantsex.au3>

$doit = 0;

Opt("GUIOnEventMode", 1)
$mainwindow = GUICreate("X-Spammer", 170, 50)
GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked")
$spam = GUICtrlCreateButton("Spam", 30, 15, 60)
GUICtrlSetOnEvent($spam, "spam")
$stop = GUICtrlCreateButton("Stop", 100, 15, 60)
GUICtrlSetOnEvent($stop, "stop")

GUISetState(@SW_SHOW)

While 1
Sleep(10)
If $doit Then
Send("x")
EndIf
WEnd

Func CLOSEClicked()
Exit
EndFunc

Func spam()
$doit = 1;
EndFunc

Func stop()
$doit = 0;
EndFunc

It works really good. I played the game only twice. First without this hack, and scored around 12000, then with this little thing and...:



with a score of:


You can't use this tool in some levels but you can still win enough to become first. Hope you enjoyed and have fun learning.

Bye