Question

This is perhaps an unusual question, but I will appreciate any help.

First of all, I am not a programmer and never studied programming, but I have some amateur knowledge of Visual Basic and Java.

I have been trying to mod an old video game called "Tomb Raider III."

This is a 3d game in which a woman called Lara fights against some creatures. You can see the game in this video clip (scroll to minute 5:00 to see how she fights with the tiger as an example).

What I want to do is to mod the game so that the enemy creatures can do more damage to Lara's health when they hit her.

The file that runs the game is called "tomb3.exe". I opened this file with the disassembler OllyDbg. I was very lucky to find a command line that is apparently responsible for making damage to Lara's health when she is hit by enemies. When I replaced this line by "NOP'S" (i.e, deleted it), Lara became invincible. She was no longer hurt by enemy strikes. The tiger (for example) would keep hitting her but her health would not be affected.

This image shows the line I am talking about. It is located at 004205EC.

The code between 004205BD and 004205CF is responsible for making the enemies strike Lara. When I deleted this code, the tiger would run towards Lara as if it is attacking her, but it would not bite or scratch her.

The lines that seem to be responsible for damage caused by the enemy attacks are those:

CMP WORD PTR DS:[ESI+12],AX

MOV WORD PTR DS:[ESI+E],AX

I tried (in many ways) to edit these lines, but I could not make them work after editing them. I just don't know enough to do it.

What I want is to increase the damage caused by enemy attacks (say double it, or triple it). I thought that AX might contain the value of the damage (or perhaps the value of Lara's health?). I tried to change the value of AX by using commands such as "imul AX, 2", but that only caused the game to crash at the moment an enemy appeared to Lara.

I know that this is a weird question, but any suggestion would be appreciated.

Thanks in advance.

Update: I want to explain something. The code that I referred to in this question is responsible for the different animations that a terrestrial enemy can do when attacking Lara. The specific line that I highlighted is responsible for the terminal action that a terrestrial enemy does when attacking Lara. For men with guns this action is represented by the movement of the bullets out of the guns towards Lara's body. Thus, disabling this line will disable the bullets animation, and Lara will not get hurt. This code is about the animations of the terrestrial enemies when they are in the attack mode. I don't think that it is responsible for Lara's health or the strength of the enemy attacks. I have yet to discover the code that is responsible for those things.

Was it helpful?

Solution

It looks as if the code is using a lookup table telling it how much damage each type of enemy causes. You could try to change that table. It is accessed in the preceding line, the mov ax, word ptr ds:[eax+6]. At that point eax seems to contain a pointer to the enemy struct, in which the damage value is a word at offset 6. Stop execution on that line, then you should see what eax+6 is, and edit the value in memory at that address.

Update If you have space elsewhere, then overwrite the CMP and the MOV with a JMP elsewhere and at elsewhere you can double AX by doing

ADD AX, AX
CMP WORD PTR DS:[ESI+12],AX
MOV WORD PTR DS:[ESI+E],AX
JMP 004205F0
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top