Assembly instruction to alter for spaceship movement (DEC to MOV)

Viewed 59

I have permission to modify this executable.

A game called Emperor of the Fading Suns has spaceships in it. When you launch into orbit with a specific ship, said ship lose one movement point. Game\OllyDB DEC BYTE PTR DS:[EAX+2F] reduces movement points by one

I want to alter this so that you have 0 movement points left.

I have tried a lot of stuff, but the reality is that I simply don't have enough experience to understand what I need to overwrite (assemble) in order to achieve 0 movement point per takeoff. Changing out DEC with INC works.

My beginning strategy went to this: MOV BYTE PTR DS:[EAX+2F], 0
(I am a novice at assembly)

Longer list of code for context:
Longer assembly image

Thanks for the tip, I'm really excited about making this a function so I don't have words to describe how happy I am for anyone to tell me how to do this. If there is additional info required then I'll post a longer version and link to it.

1 Answers

The trick is to observe that the instruction at 457dd0 and 457dd6 are the same and can be combined.

457dce  8b45e4    mov eax, [ebp-1c]
457dd1  7506      jnz 457dd9
457dd3  c6402f00  mov byte ptr [eax+2f], 0
457dd7  6690      nop
457dd9  ...

You should ensure that there are no jumps to 457dd0 or 457dd6.

Related