I Need Help On ASM

Started by Crapulecorp, December 09, 2011, 02:30:00 PM

Previous topic - Next topic

dcx2

Go to BP tab.  Enable Step Log.  Execute BP 800F46B4.  Get hit by an enemy.  Then press Step Into 10 times.  Post the log.

Crapulecorp

Quote from: dcx2 on December 17, 2011, 05:24:50 PM
Go to BP tab.  Enable Step Log.  Execute BP 800F46B4.  Get hit by an enemy.  Then press Step Into 10 times.  Post the log.

Here is the log :

[spoiler]800F46B4:  FC02082E   fsel   f0,f2,f0,f1   f0 = 307   f2 = 307   f0 = 307   f1 = 0
800F46B8:  D01F0008   stfs   f0,8(r31)   f0 = 307   r31 = 8156A9E8   [8156A9F0] = 43AA0000
800F46BC:  41820024   beq-   0x800f46e0
   ...   ...   ...   ...
800F46E0:  C01F0008   lfs   f0,8(r31)   f0 = 307   r31 = 8156A9E8   [8156A9F0] = 43998000
800F46E4:  EC20F828   fsubs   f1,f0,f31   f1 = 0   f0 = 307   f31 = 340
800F46E8:  80010044   lwz   r0,68(r1)   r0 = 00000000   r1 = 8069F1A0   [8069F1E4] = 802B7800
800F46EC:  E3E10038   psq_l   f31,56(r1),0,0   f31 = 340   r1 = 8069F1A0   [8069F1D8] = 426C0000
800F46F0:  CBE10030   lfd   f31,48(r1)   f31 = 59   r1 = 8069F1A0   [8069F1D0] = 404D800000000000
800F46F4:  E3C10028   psq_l   f30,40(r1),0,0   f30 = 307   r1 = 8069F1A0   [8069F1C8] = 42040000
800F46F8:  CBC10020   lfd   f30,32(r1)   f30 = 33   r1 = 8069F1A0   [8069F1C0] = 4040800000000000
800F46FC:  83E1001C   lwz   r31,28(r1)   r31 = 8156A9E8   r1 = 8069F1A0   [8069F1BC] = 8156A960[/spoiler]

dcx2

Your code did not take.  Did you forget to apply the cheat?

800F46B8:  D01F0008   stfs   f0,8(r31)

If you applied a C2 code, this would be a branch.

This is Bully's code as a C2

Inf health, one hit kills [Bully@Wiiplaza]
C20F46B8 00000004
2C000000 40820010
39800000 919F0008
4800000C 3D804550
919F0008 00000000

Crapulecorp

Quote from: dcx2 on December 17, 2011, 06:49:20 PM
Your code did not take.  Did you forget to apply the cheat?

800F46B8:  D01F0008   stfs   f0,8(r31)

If you applied a C2 code, this would be a branch.

This is Bully's code as a C2

Inf health, one hit kills [Bully@Wiiplaza]
C20F46B8 00000004
2C000000 40820010
39800000 919F0008
4800000C 3D804550
919F0008 00000000


Hi dcx2.

Sorry my bad i forget to apply the code. LOL  :) :) :)


- I applied the code from Bully@Wiiplaza (last time a made a typo) so it's a one hit kill for the player and the enemy.


- "Go to BP tab.  Enable Step Log.  Execute BP 800F46B4.  Get hit by an enemy.  Then press Step Into 10 times.  Post the log."

[spoiler]800F46B4:  FC02082E   fsel   f0,f2,f0,f1   f0 = 2843,75   f2 = 2843,75   f0 = 2843,75   f1 = 0
800F46B8:  4BF0E210   b   0x800028c8
   ...   ...   ...   ...
800028C8:  2C000000   cmpwi   r0,0       r0 = 00000000
800028CC:  40820010   bne-   0x800028dc
800028D0:  39800000   li   r12,0      r12 = 800671BC
800028D4:  919F0008   stw   r12,8(r31)   r12 = 00000000   r31 = 81559DC8   [81559DD0] = 453B8000
800028D8:  4800000C   b   0x800028e4
   ...   ...   ...   ...
800028E4:  480F1DD8   b   0x800f46bc
   ...   ...   ...   ...
800F46BC:  41820024   beq-   0x800f46e0
   ...   ...   ...   ...
800F46E0:  C01F0008   lfs   f0,8(r31)   f0 = Non Numérique   r31 = 81559DC8   [81559DD0] = 00000000
800F46E4:  EC20F828   fsubs   f1,f0,f31   f1 = 0   f0 = 0   f31 = 3000[/spoiler]

- I made too when the enemy is hit :

[spoiler]800F46B4:  FC02082E   fsel   f0,f2,f0,f1   f0 = 967   f2 = 967   f0 = 967   f1 = 0

800F46B4:  FC02082E   fsel   f0,f2,f0,f1   f0 = 967   f2 = 967   f0 = 967   f1 = 0

800F46B4:  FC02082E   fsel   f0,f2,f0,f1   f0 = 775   f2 = 775   f0 = 775   f1 = 0
800F46B8:  4BF0E210   b   0x800028c8
   ...   ...   ...   ...
800028C8:  2C000000   cmpwi   r0,0       r0 = 00000000
800028CC:  40820010   bne-   0x800028dc
800028D0:  39800000   li   r12,0      r12 = 800671BC
800028D4:  919F0008   stw   r12,8(r31)   r12 = 00000000   r31 = 81558BE8   [81558BF0] = 44480000
800028D8:  4800000C   b   0x800028e4
   ...   ...   ...   ...
800028E4:  480F1DD8   b   0x800f46bc
   ...   ...   ...   ...
800F46BC:  41820024   beq-   0x800f46e0
   ...   ...   ...   ...
800F46E0:  C01F0008   lfs   f0,8(r31)   f0 = Non Numérique   r31 = 81558BE8   [81558BF0] = 00000000
800F46E4:  EC20F828   fsubs   f1,f0,f31   f1 = 0   f0 = 0   f31 = 800[/spoiler]

Sorry again. :) :) :)

dcx2

hi Carpulecorp

Did the code work as intended?

The log appears to show two enemies being hit.  It has this line both times


800028C8:  2C000000   cmpwi   r0,0       r0 = 00000000


However, the breakpoints you posted here all show r0 = 00000001 when the player is hit.

Crapulecorp

The code from Bully@Wiiplaza is not good because its a 1 hit kill for everyone ( Player and enemy).

The 1 hit kill is good just exclude the player and it would be awesome. :) :) :)

dcx2

Very strange.

Set Bully's code again.  Have player get 1-hit killed.  Post registers.

Crapulecorp

I Set Bully's code. Set BP 800F46B8, and here are the registers :

- Player get 1-hit killed

[spoiler]  CR:24202488  XER:00000000  CTR:800671BC DSIS:02400000
DAR:800F46B8 SRR0:800F46B8 SRR1:0000B032   LR:800F4680
  r0:00000000   r1:8069EDB0   r2:80662DC0   r3:00000BB8
  r4:80A09DB0   r5:0000001F   r6:00000003   r7:00000001
  r8:00000000   r9:9054EF84  r10:805A6B7C  r11:8069EE00
r12:800671BC  r13:80659220  r14:8069F1C8  r15:81557FB8
r16:81559D40  r17:81557980  r18:00000001  r19:8069EE18
r20:8069F190  r21:8069F180  r22:81557980  r23:00000000
r24:00000001  r25:8069F190  r26:00000002  r27:00000000
r28:00000000  r29:00000000  r30:00000000  r31:81559DC8

  f0:452FC800   f1:00000000   f2:452FC800   f3:00000000
  f4:3E4CCCCD   f5:3E4CCCCD   f6:3D638E39   f7:C03AA9A8
  f8:43950898   f9:428B8658  f10:C48EB8E2  f11:3FD0591E
f12:4381BD4F  f13:00000000  f14:00000000  f15:00000000
f16:00000000  f17:00000000  f18:00000000  f19:00000000
f20:00000000  f21:00000000  f22:00000000  f23:0229C4AB
f24:358637BD  f25:3F800000  f26:BF060A96  f27:3F060A96
f28:43160000  f29:3F800000  f30:452FC800  f31:453B8000[/spoiler]

- Enemy get 1-hit killed

[spoiler]  CR:24202488  XER:00000000  CTR:800671BC DSIS:02400000
DAR:800F46B8 SRR0:800F46B8 SRR1:0000B032   LR:800F4680
  r0:00000000   r1:8069EDC0   r2:80662DC0   r3:00000320
  r4:00000000   r5:00000000   r6:00000001   r7:0000000E
  r8:00000000   r9:9054EF84  r10:805A6B7C  r11:8069EE10
r12:800671BC  r13:80659220  r14:8069F1D8  r15:8155A378
r16:81557980  r17:81559D40  r18:0000000D  r19:8069EE28
r20:8069F1A0  r21:8069F190  r22:81559D40  r23:00000000
r24:0000000D  r25:8069F1A0  r26:00000002  r27:00000000
r28:00000000  r29:00000000  r30:00000000  r31:81557A08

  f0:44098000   f1:00000000   f2:44098000   f3:00000000
  f4:3F000000   f5:3F7FFFFF   f6:BE3F4AD2   f7:4034E929
  f8:4394313D   f9:4393E9A1  f10:4396DE2F  f11:40356146
f12:C3BDF0CE  f13:00000000  f14:00000000  f15:00000000
f16:00000000  f17:00000000  f18:00000000  f19:00000000
f20:00000000  f21:00000000  f22:00000000  f23:0229C4AB
f24:358637BD  f25:3F800000  f26:BFC90FD8  f27:401C61AA
f28:437A0000  f29:3F800000  f30:44098000  f31:44480000[/spoiler]

dcx2

#23
It looks like r0 is a bad test.  Use r24 = 0x1 when hitting player.  I have a funny feeling there will be more than just 0xD types of enemies or something like that.

Try this obviously modified version of Bully's code

C20F46B8 00000004
2C180001 41820010
39800000 919F0008
4800000C 3D804550
919F0008 00000000

cmpwi r24,0x1 # are we affecting Player?
beq- _PLAYER # if not...
li r12, 0 # load 00000000
stw r12, 8 (r31) # One Hit Kill Enemies
b _KILLED # if enemy got killed, end code
_PLAYER: # if we deal with player...
lis r12, 0x4550 # load max health
stw r12, 8 (r31) # store it...
_KILLED: # end

EDIT:

This was initially posted with bne, but it's supposed to be beq

Crapulecorp

Very nice thanks a lot for your help dcx2.

The code is working but you were right "I have a funny feeling there will be more than just 0xD types of enemies or something like that"

Some enemies are invincible like the player. And the player can sometimes be one hit killed.

And the worst thing the code make a lot of glitch in the game like i can't examine something or breaking items.

So i can't get to the next level.

I tried to BP 800F46B4 when a invicible enemy is hit but geckdotnet BP instatanetly so i can't BP when someone is hit.

So for me the best thing to do is to stop trying to hack this game.

Tanks everyone (matt123337, Bully@Wiiplaza, dcx2 and Jay) for the help i appreciate a lot. :) :) :) :)

Anarion

giving up on making further hacks, eh? Well that's too bad. I stopped because it switches from using mem80 one moment to mem90 the next which makes for a terrible time searching for addresses.
at least you tried. the game is not even all that interesting to hack anyways. =P
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.
¦}

dcx2

There is one last trick, although it is not as elegant.  It requires two C2 codes.

Find a good hook address which gives you access to only the player pointer.  This can be *anything*, it doesn't have to be related to health, it can literally be anything which provides the player pointer and no other pointers.  Make a first C2 which stores the player pointer in a gecko register, or some other unused memory.

Then, in your second C2 (the one we have been trying to make), instead of checking r24 or r0 or etc, you will load the pointer from the first C2 and compare it with the current pointer.  If they match, give full health to player.  If they differ, remove all health from enemy.