Help with code effect

Started by Anarion, July 12, 2010, 04:00:24 AM

Previous topic - Next topic

Anarion

Hello. I am creating a few hacks for a game. Anyhow, I have found the address I want to use in my code after setting a write breakpoint. I nop'd the command and I am able to do just what I want, however, if it remains nop'd, it interferes with one other thing.
Restoring the original asm command through means of button activators won't do any good because I'd like for the effect to remain permanent.

this is the scenario.
i press (my character's) back on the nunchuck and A on the wiimote and it does an action. it lasts two seconds.
nop'ing the original stw command makes so that this action lasts until I let go of "back-A"


[spoiler]after first breakpoint.
8006A62C:  48107BB5 bl 0x801721e0
8006A630:  907F0044 stw r3,68(r31) . .1st break
8006A634:  38800001 li r4,1
8006A638:  807F0040 lwz r3,64(r31)
8006A63C:  801F0044 lwz r0,68(r31)
8006A640:  7C001800 cmpw r0,r3
8006A644:  41820008 beq- 0x8006a64c
8006A648:  38800000 li r4,0
8006A64C:  7C03F000 cmpw r3,r30
8006A650:  41810008 bgt- 0x8006a658
8006A654:  38800000 li r4,0
8006A658:  807F0000 lwz r3,0(r31)
8006A65C:  54600294 rlwinm r0,r3,0,10,10
8006A660:  2C000000 cmpwi r0,0
8006A664:  41820008 beq- 0x8006a66c
8006A668:  38800000 li r4,0
8006A66C:  54600108 rlwinm r0,r3,0,4,4



8006A440:  48107DA1 bl 0x801721e0
8006A444:  907E0044 stw r3,68(r30) . .2nd break. this is what i want to nop without causing interferance
8006A448:  38800001 li r4,1
8006A44C:  807E0040 lwz r3,64(r30)
8006A450:  801E0044 lwz r0,68(r30)
8006A454:  7C001800 cmpw r0,r3
8006A458:  41820008 beq- 0x8006a460
8006A45C:  38800000 li r4,0
8006A460:  7C03E800 cmpw r3,r29
8006A464:  41810008 bgt- 0x8006a46c
8006A468:  38800000 li r4,0
8006A46C:  807E0000 lwz r3,0(r30)
8006A470:  54600294 rlwinm r0,r3,0,10,10
8006A474:  2C000000 cmpwi r0,0
8006A478:  41820014 beq- 0x8006a48c
8006A47C:  54600108 rlwinm r0,r3,0,4,4
8006A480:  2C000000 cmpwi r0,0
[/spoiler]
I'm not here much. If you have a problem with any of my codes, let me know through my youtube account and I'll help you.
¦}

shadowofchaos

http://wiird.l0nk.org/forum/index.php?topic=1454.0

That will probably help you...

From what I read, you're trying to say that as long as you hold the button, the effect will last?

Then the method shown there will probably work... That basically means you need that, or a similar method, to compare if you're holding the button activator or not...

dcx2

8006A440:  48107DA1   bl   0x801721e0

That bl is answering a question.  The answer is put into r3.  Sometimes, you want to ignore the answer (i.e. when you want to nop the stw).  At other times, you don't want to ignore the answer, because noping the stw makes the effect end prematurely.

Try setting an execute breakpoint on 8006A444.  Do stuff.  See what comes and goes into r3.  Instead of noping the stw altogether, there may be a particular value of r3 that you want to ignore instead.  If that is the case, you can either dig into the bl, or you could try writing a C2 hook that tests r3 and skips the stw if it matches the value you want to ignore.

Anarion

#3
Ahh. Much obliged :cool:



btw. shadowofchaos, such a coincidence that you'd post that here when i found that thread by searching for a way of making an ASM moon jump code. i'll send you a pm with the one question i have as of now. :]
edit: oops. i guess i'll be sending the pm to Black Wolf.
I'm not here much. If you have a problem with any of my codes, let me know through my youtube account and I'll help you.
¦}