Monthly Archives: November 2011

Videogame hacking. Cheat on almost every offline game.

Sometimes we get stuck on a game, and we use cheats, that is ok. But in certain cases there is no cheats or are very limited.

In games like Dead Space 2 it is not possible, I did not find any cheat.

We can use  Cheat Engine.

Brief explanation:

When a game is running, the process is loaded into the RAM. This process reserves some space on the memory for the variables. A variable is like a box, it stores a value which can be integer, string, float, etc. Well, this variables can be for example, our money or ammunition, or even life and can be edited with Cheat Engine 

This is the interface of Cheat Engine. Clicking on the button with green borders, will open a process selector, in which we have to select our game process.

Steps:

1- Open our desired game, in this case Dead Space 2

Ammo before editing

2- Open Cheat Engine and select the correct process.

3- We know we have 9 shoots available, we are going to search that number on the browser. We will see thousands of results, that is not interesting because we do not know what variable is.

Warning: Editing an unknown variable can result in a game crash.

So now we go back to the game and shoot just one time, now our ammo will be 8.  On Cheat Engine, put 8 and click Next scan, to indicate we are still scanning for the same variable with before was 9, but now it is 8. And so on, until we isolate our variable(s) (maybe two or three).

Isolated variable
Isolated variable

4- Once it is isolated, we drag to the underneath field and click with right button to drop the menu and then click on Change Record –> Value.

Changing the value
Changing the value

5- We set up a new value, not to high, we can provoke an overflow and crash the game. I put 999 and it worked fine.Now we go back to the game and see the result. ¡999 ammo!

Final result
Final result

6 – Play!

I have tested it with Counter Strike (offline) modifying money and ammo. Also with Modern Warfare 2, Mass Effect, Crysis, and more games.

In Dead Space 2 I have modified ammo of all weapons, money and node quantity.

It may be a bit thorny, but useful if there is no other way.

 

Short and useful tip: How to make “tail -f” beep on each new line.

Just in case you do not know, tail prints the last ten lines of the indicated file. Like this:

tail /var/log/yum.log

Furthermore, if you want to print more lines you can do it with -n parameter:

tail -n 20 /var/log/yum.log

But I think the most interesting parameter for tail  is -f. This parameter allows tail to “follow” the file. New data is displayed as the file grows.

Now, using sed  we can append to each new line, a bell sound:

tail -f /var/log/yum.log | sed -e $'s/$/\a/'

Notice that ‘$’ escape sequences will only work on bash.

This was tested on Fedora 16.

Change background and font of Grub2 on Fedora 16.

With Fedora 16 Grub2 was introduced.

We have some major changes with grub2, for example, there’s no menu.lst anymore to edit entries.

I do not know the reason, but the default grub2 of Fedora 16 is raw, with black background, in contrast to Fedora 15 with at least had a background picture.

We can customize grub2 in an easy way, just a few steps:

1) Copy your desired wallpaper to /boot 

# cp /home/user/Pictures/wallpaper1.jpg /boot/wall.jpg

2) Edit /etc/default/grub  and add the following lines:

GRUB_GFXMODE=1920x1080x16
GRUB_GFXPAYLOAD_LINUX=keep
GRUB_BACKGROUND=/boot/wall.jpg

You can use whatever resolution is supported by your monitor.

Next step is to convert a .ttf font (if you want to use a different font) to a suitable format, and generate our new grub.cfg

3) Generate font and grub.cfg

# grub2-mkfont --output=/boot/grub2/unicode.pf2 /usr/share/fonts/Sansation/Sansation_Regular.ttf

# grub2-mkconfig -o /boot/grub2/grub.cfg

In my case, I used Sansation font.

Then, all you have to do is reboot brand new GRUB2.

Here’s mine:

My Grub2. Click to zoom.

 

Configuring BIND9 Master / Slave on Ubuntu.

I know it is strange to set up this type of configuration on an Ubuntu Desktop, but we had to do it for Internet Services class, and it gave problems to me and most of my class.

I am going to use two virtual machines, both running Ubuntu Desktop. First step is installing bind9.

# apt -get install bind9

The test domain will be “etg.local”

  • Master dns:
    • IP:  192.168.7.1
    • name: dns1
  • Slave dns:
    • IP: 192.168.7.2
    • name: pc02 (with dns2 CNAME)

Be careful with using underscore on names.

MASTER

We are going to start by editing /etc/bind/named.conf.local, to define our zone. I am going to define just one zone. You may want to define also a reverse zone.

named.conf.local

named.conf.local

Notice that the “type” of this host is master, that is important. We also can see that I used absolute path to the file, because I did not specified any directory on the options.

Allow-transfer, allow-update and also-notify are allowing our slave dns to transfer the zone(s) file(s).

This is my zone file:

Zone file

Zone file

 

We must pay attention to thenames to be fully qualified if they include domain name, and both servers must be declared with NS register.

Finally we configure our DNS, this is my configuration file /etc/resolv.conf

/etc/resolv.con

/etc/resolv.conf

SLAVE

Here comes the tricky part, at least with Ubuntu Desktop.

First, we configure /etc/resolv.conf to be equally as in master. Search parameter must be “etg.local” and nameserver “127.0.0.1″

Now, we declare our zone, pay attention:

Zone declaration on slave

Zone declaration on slave

As you may see, we declared the type of this server as slave, and we set who is its master(s).

Now it should replicate our zone from master server, but it won’t until we do a couple more of steps to avoid errors of writing permission.

We have to edit the file /etc/apparmor.d/usr.sbin.named

Default usr.sbin.named

Default usr.sbin.named

We have to find the line highlighted in red.

r stands for read, read permission. So we can deduce that it does not have permission to write the zone, that is the because it gives us permission errors.

We change that line to this:

Modified usr.sbin.named

Modified usr.sbin.named

And the last step is giving all permissions to the the bind group in the bind folder:

# chmod -R 775 /etc/bind

Now we restart first the bind server of the master and then the slave with:

# /etc/init.d/bind9 restart

Then if we want to check the log file to see if everything went fine (slave):

# tail -f /var/log/syslog
Syslog

Syslog

I highlighted some important messages. It tells us that the zone transfer went fine. Now we finally take a look to our recently replicated zone file.

Note: In the next screenshot you will se that the serial is 2. You can transfer with serial, I just added another register (see www) to show you that it really works

Replicated zone

Replicated zone

 

And that’s all, it should work now.

How to install MySQL 5.1 on Ubuntu

 

# apt-get install mysql-client-5.1 mysql-client-core-5.1 mysql-common mysql-server-5.1 mysql-server-core-5.1 mysql-admin mysql-gui-tools-common mysql-query-browser

With this packages we install mysql client, mysql server and some administration tools.

Packages to install

Packages to install

Later, we will be asked to set up a root password:

Asking for root password

Asking for root password

Be sure to remember that password.

Once it is installed we can run MySQL Administrator to manage our recently installed server.

MySQL Administrator Connection

MySQL Administrator Connection

It’s highly recommended to create other user to work

Creating a new user

Creating a new user

With MySQL Administrator you also can manage backups or check server’s health for example.

And finally, with MySQL Query Browser you can que to your server; create new databases, insert values, sql queries, etc.

Creating a new database with Query Browser

Creating a new database with Query Browser