Ok guys, I need some help: I want to make an ASM code for infinite HP but if I make it also the enemy will be immortal.
I just told to Romaap by PM and he says that I need to check if the HP value is from the player and not from enemy.
Could someone be so kind to explain me how to do? I mean I need an idea in how to make such control because I tried to make the cheat with pointers but it seems that in some cases (and I really cannot figured what and why) some people couldn't make it works (for me works perfectly).
THANKS guys !!! :)
Set a breakpoint on the asm that handles health (the asm you have hijacked) and look at the other registers when you get hit and when an enemy does, hopefully it might have a 0 / 1 scenario where 1 of the other egisters changes based on who is hit so you cna use that as a basis as to whether the damage occurs
Thanks man... I'll give it a try and let you know if I was able to do it !!! ;)
Post Merge: November 21, 2009, 10:34:25 PM
It seems to be more difficult as it sounds !!! :(
I was not able to find a flag that could make a difference between the entity that calls the HP function so my enemyes are always invincible.
Is there any other try I can make?
Can you screengrab a breakpoint of the register when you get hit and when your enemy gets hit please?
Sure, here they are !!!
Sorry for the dimensions and the quality but the upload limit is really low... I hope you can read them.
Thanks for your efforts !!! :)
(Http://gokussjin3.interfree.it/private/apache/enemy%20damaged%201.jpg)
(Http://gokussjin3.interfree.it/private/apache/enemy%20damaged%202.jpg)
(Http://gokussjin3.interfree.it/private/apache/player%20damaged%201.jpg)
(Http://gokussjin3.interfree.it/private/apache/player%20damaged%202.jpg)
Thanks, bit hard to read
Can you use imageshack? A little slow but does the job
http://imageshack.us/
After squinting I noticed r31 is different. Can you test that please? Is it 0 for you being hit but always has a value for an enemey?
Wow !!! I'm really blind !!!
I'll check this when I'll return from work this evening and let you know.
THANKS AGAIN !!! :)
Post Merge: November 26, 2009, 06:57:42 PM
Well it seems that the r31 register is zero only if the function was called by the player so here we are.
My question now is how can I make in assembler something like:
if (r31 != 0) {
... do something to replenish health
} // if
I need to say that I'm able to write the "... do something to replenish health" but I'm a bit confusing in how to translate the if statement.
I tried
cmpwi r31,0
bne return
...the something to replenish health
return:
blr
but it doesn't seems to work.
Make sure you write the command you are replacing when you perform the branch, and that said command executes regardless of how the ASM insert branches out. Provided it's not the command you're trying to change in the first place.
It's sufficient to find the command that writes your "new" health to a RAM location (stw (newhealth, healthlocation)). Branch over the top of that.
cmpwi r31,0
bne +0x8
stw (newhealth, healthlocation)
Then, if it would be writing to the player's health, it won't write at all. If it's writing to a bad guy's health, it will.
I can't see what your screenshot says too well, but it looks like your code should be:
C2041864 00000002
2C1F0000 40820008
907E0008 00000000
That is too simple that I was not able to think it by myself !!! :P
Thanks man !!!! :)
I've tried to follow this thread to make an ASM Infinite HP code, but it just wont work. Any suggestions?
You need to pay attention to all the value you will get in the breakpoint ASM window when the instruction called to decrement the health is called; for sure you will find a value that change if you hit an enemy or an enemy hit you.
It's only matter of patience.
Think that is not only a matter of zero or 1 value they must be also 2 different values or memory regions to check.
hmm, I'll give it another try. If I can't find it, would someone be able to help me if I shared the registers?
I found the changing register, it's r25.
Yeha, I could take a look but you need to post me the screenshots as I do: 2 screenshots for the enemy hitting the player (rxx and fxx values) and 2 screenshots for the player hitting the enemy (rxx and fxx values).
Hitting Me:
(http://img18.imageshack.us/img18/7389/rxxbeinghit.png) (http://img18.imageshack.us/i/rxxbeinghit.png/)
(http://img685.imageshack.us/img685/9544/fxxbeinghit.png) (http://img685.imageshack.us/i/fxxbeinghit.png/)
Them hitting me:
(http://img138.imageshack.us/img138/1650/rxxhitting.png) (http://img138.imageshack.us/i/rxxhitting.png/)
(http://img685.imageshack.us/img685/6803/fxxhitting.png) (http://img685.imageshack.us/i/fxxhitting.png/)
For example the r0 register is different and you can try to check if the player has always that value to zero so if that value is different from zero you don't have to change the ASM code for infinite health.
[EDITED]
As I said nothig: the r0 register is the value to store in memory so it's not your target.
However, the r29 register has something strange: if you hit an enemy it has the same value of the r0 one that's to say the value to store.
I noticed also something strange: when they hit you tha ASM saved the value zero in the memory (ro = 00000000)... are you dead after that blow? However if you're the player the r29 register has not the same value of r0 but it could be because of the last blow.
Another thing: are you sure to have get the screenshot without having no codes applied?
I am 99% sure that I didnt have any codes applied.
Can you print the lines of code above the ones displayed? That is stw r0, 108(r3)?
I don't know what game this is but.
Try going to various different stages and letting enemies hit you. Check if the value of r3 is constant - that is, 80A72B88. If it is a single-player game, it is possible that the place where the player's HP is stored is a constant, and so you can check if it is writing to the player's HP location or "not the player's hp location".
Quote from: Almas on December 12, 2009, 11:35:18 PM
Can you print the lines of code above the ones displayed? That is stw r0, 108(r3)?
I don't know what game this is but.
Try going to various different stages and letting enemies hit you. Check if the value of r3 is constant - that is, 80A72B88. If it is a single-player game, it is possible that the place where the player's HP is stored is a constant, and so you can check if it is writing to the player's HP location or "not the player's hp location".
Do you mean the ASM instructions above stw r0,108(r3)?
The game is Pokemon Rumble.
No, the game name isn't relevant. Well, whatever.
Somewhere on this site there's a guide to performing a primitive pointer search. Find it.
Use it to find the pointer which points to your character or pokeman'z hp or whatever using the simple (tedious) method shown. Then construct a branch over the top of the stw r0,108(r3) command. It will have roughly the form:
lis r18, 0x8034
ori r18, r18, 0x5464 // Load the pointer address
lwz r18, 0(r18) // Follow the pointer tree once
addi r18, r18, 0x320 // Set r18 to where hp is stored -108 (in dec, which is something like -0xBC in hex)
cmpw r3, r18 // Check to see if the HP update would be done to "your" health
beq +0x8 // If it is, skip the next command
stw r0, 108(r3) // Save the HP update
I use r18 as a free register because it is empty, which implies that it is most probably free (but this is not necessarily the case). It would be safer to follow the blr and see if there are any obvious safe registers.
I hope you understand this.