WiiRd forum

Wii & Gamecube Hacking => Wii Game hacking help => Topic started by: disraelie on June 03, 2010, 02:19:02 AM

Poll
Question: Help to extend code~
Option 1: Help to extend code~ votes: 0
Option 2: Help to extend code~ votes: 0
Option 3: Dont make poll's for questions~ votes: 3
Title: Help to extend code~
Post by: disraelie on June 03, 2010, 02:19:02 AM
Naruto Shippuuden Gekitou Ninja Taisen EX3 [RNEJDA]
Infinite HP [ZiT]
C207F1E8 00000004
8A1C0003 2C10000F
4182000C 907C0028
48000008 90DC0028
60000000 00000000

If Skill Gauge Increase, MAX [ZiT]
C207FB5C 00000004
889E0003 2C04000F
4182000C 907E0044
48000008 90DE0044
60000000 00000000

Help to extend above code~like below code

Naruto Shippuuden Gekitou Ninja Taisen EX 2 (JP) [RNYJDA]
Infinite HP (1P ONLY) [ZiT]
0406DFA8 4BF95258
04003200 89FE0003
04003204 2C0F000F
04003208 41820018
0400320C 807E0020
04003210 4806AD9C
04003220 807E0022
04003224 4806AD88

If Skill Gauge Increase, MAX (1P ONLY) [ZiT]
0406E594 4BF94C9C
04003230 88BE0003
04003234 2C05000F
04003238 41820018
0400323C 83BE0034
04003240 4806B358
04003250 83BE0030
04003254 4806B344
Title: Re: Help to extend code~
Post by: Deathwolf on June 03, 2010, 09:44:02 AM
you can make a string code.

Naruto Shippuuden Gekitou Ninja Taisen EX 2 (JP) [RNYJDA]
Infinite HP (1P ONLY) [ZiT]
0706DFA8 4BF95258
06003200 0000001C
89FE0003 2C0F000F
41820018 807E0020
4806AD9C 807E0022
4806AD88 00000000

If Skill Gauge Increase, MAX (1P ONLY) [ZiT]
0706E594 4BF94C9C
06003230 0000001C
88BE0003 2C05000F
41820018 83BE0034
4806B358 83BE0030
4806B344 00000000

the first is a C2 codestype.

He used breakpoint on the address like this 04003200.
then he made a C2 codetype with the disassembler.

Title: Re: Help to extend code~
Post by: disraelie on June 04, 2010, 01:50:47 AM
Deathwolf ~ thanks a lot
but I mean transfer ex3 type to ex2 type
I use dolphin to emu wii...
ex3 type can't be used on dolphin
Title: Re: Help to extend code~
Post by: Deathwolf on June 04, 2010, 11:15:30 AM
Naruto Shippuuden Gekitou Ninja Taisen EX3 [RNEJDA]
Infinite HP [ZiT]

Naruto Shippuuden Gekitou Ninja Taisen EX 2 (JP) [RNYJDA]
Infinite HP (1P ONLY) [ZiT]

It's not the same game.
So it doesn't work
Title: Re: Help to extend code~
Post by: disraelie on June 04, 2010, 05:28:18 PM
I know : It's not the same game
EX 2 code can be used on dolphin
but...
EX 3 code can't be used on dolphin

dolphin can't support this type of codes
Infinite HP [ZiT]
C207F1E8 00000004
8A1C0003 2C10000F
4182000C 907C0028
48000008 90DC0028
60000000 00000000

I try to transfer...0407F1E8 8A1C0003
Infinite HP works, but 1P+2P both work

sorry~my English is bad !
Title: Re: Help to extend code~
Post by: Deathwolf on June 04, 2010, 05:34:57 PM
hmm maybe dolphin doesn't support C2 codestype.

C207F1E8 00000004
8A1C0003 2C10000F
4182000C 907C0028
48000008 90DC0028
60000000 00000000

I don't know why he don't used only nop 60000000
Title: Re: Help to extend code~
Post by: Thomas83Lin on June 04, 2010, 07:18:49 PM
Quote from: Deathwolf on June 04, 2010, 05:34:57 PM
hmm maybe dolphin doesn't support C2 codestype.

C207F1E8 00000004
8A1C0003 2C10000F
4182000C 907C0028
48000008 90DC0028
60000000 00000000

I don't know why he don't used only nop 60000000
Well it could be because the code effected more than just your health sense it contains cmpwi checks why he didn't just nop it, another method of writing the code would have been to use a 06/07 CST3: String Code and store the code in unused memory and do the branching manually, or you even could just use a 04 type for everything, storing and branching and would get the same effect but the code would be twice as long. which looks like what the other 2 codes posted here were doing Its just really convenient using a C2 considering you dont have to worry about were to store the code, and the branching.  Just acouple quick examples of converting it to a 07 type and a 04, may be off alittle bit sense its been awhile sense i've used either, i'd fill in the blanks if i had the game, If i made any mistakes feel free to correct me

Org code
C207F1E8 00000004
8A1C0003 2C10000F
4182000C 907C0028
48000008 90DC0028
60000000 00000000

CTS3 String Code Method

07xxxxxx 0000001C {X=Were to store the code in unused Memory 07=81 Memory Range 06=80 Memory Range}
8A1C0003 2C10000F
4182000C 907C0028
48000008 90DC0028
xxxxxxxxx 00000000 {x=Branch always one Instruction after 8007F1E8 instruction}
0407F1e8 xxxxxxxx {Overwrite Org Instruction with a Branch to First Asm Instruction in unused Memory}

^^^Something like that if i remember correctly.

CST2: 32bits Write 04 Method
0407F1E8 xxxxxxxx = {Overwrite Org Instruction with a Branch to First Asm Instruction in unused Memory}
04xxxxxx 8A1C0003 {04xxxxxx = Were to store Asm one after another in unused memory}
04xxxxxx 2C10000F
04xxxxxx 4182000C
04xxxxxx 907C0028
04xxxxxx 48000008
04xxxxxx 90DC0028
04xxxxxx xxxxxxxx  {xxxxxxxx = Branch Always one instruction after 8007F1E8}
Title: Re: Help to extend code~
Post by: Deathwolf on June 04, 2010, 07:23:17 PM
but why 07?
07 writes 123456789 -> 0A0B0C0D0E0F

I trought C2 writes 4XXXXXXX codes!?
Title: Re: Help to extend code~
Post by: Thomas83Lin on June 04, 2010, 07:26:55 PM
CST3: String Code
06______ YYYYYYYY : Patch code (ba) d1d2d3d4 d5d6d7d8... writes d1d2d3d4 d5d6d7d8... at ba+address. YYYYYYYY is the number of bytes to write

07 is just writing the patch to 81 memory range instead of 80 which would be 06

Just a harder method, instead of using C2, you'll get the same effect though
Title: Re: Help to extend code~
Post by: Deathwolf on June 04, 2010, 07:28:45 PM
yes I know but why can you use 07 codes on ASM!?

C2 writes 4XXXXXXX

07xxxxxx 0000001C {X=Were to store the code in unused Memory 07=81 Memory Range 06=80 Memory Range}
8A1C0003 2C10000F
4182000C 907C0028
48000008 90DC0028
xxxxxxxxx 00000000 {x=Branch always one Instruction after 8007F1E8 instruction}
0407F1e8 xxxxxxxx {Overwrite Org Instruction with a Branch to First Asm Instruction in unused Memory}

I don't understand this.
Title: Re: Help to extend code~
Post by: Thomas83Lin on June 04, 2010, 07:34:16 PM
Quote from: Deathwolf on June 04, 2010, 07:28:45 PM
yes I know but why can you use 07 codes on ASM!?

C2 writes 4XXXXXXX

07xxxxxx 0000001C {X=Were to store the code in unused Memory 07=81 Memory Range 06=80 Memory Range}
8A1C0003 2C10000F
4182000C 907C0028
48000008 90DC0028
xxxxxxxxx 00000000 {x=Branch always one Instruction after 8007F1E8 instruction}
0407F1e8 xxxxxxxx {Overwrite Org Instruction with a Branch to First Asm Instruction in unused Memory}

I don't understand this.


take alook at some of TNTkryzt's codes to try to get a understanding, I explained it the best i could
Title: Re: Help to extend code~
Post by: Deathwolf on June 04, 2010, 07:37:20 PM
8x4-4=1C

0707F1e8 0000001C
8A1C0003 2C10000F
4182000C 907C0028
48000008 90DC0028
xxxxxxxxx 00000000 <-- next value on the memory viewer?
0407F1e8 xxxxxxxx  <--???

whatever,

thanks
Title: Re: Help to extend code~
Post by: Thomas83Lin on June 04, 2010, 07:46:34 PM
Quote from: Deathwolf on June 04, 2010, 07:37:20 PM
8x4-4=1C

0707F1e8 0000001C
8A1C0003 2C10000F
4182000C 907C0028
48000008 90DC0028
xxxxxxxxx 00000000 XXXXXXXX what do you mean?
0407F1e8 xxxxxxxx  <--???

7x4=1C you dont count 00000000

0707F1e8 0000001C  You'll need to place your routine in a Unused Memory Range 0x80000000 to 0x81800000 06=80 07=81 Mem Range not the original Address
8A1C0003 2C10000F Green = your Routine
4182000C 907C0028
48000008 90DC0028
xxxxxxxxx 00000000 <---??? Here you'll need to add a Asm instruction to Branch one address Past Org Instruction, which would branch to 8007F1ec  
0407F1e8 xxxxxxxx  <--??? Here you'll need to Overwrite the Org Instruction with a branch to the routine you stored in unused memory

Sorry i'm not better at explaining things
Title: Re: Help to extend code~
Post by: Deathwolf on June 04, 2010, 07:51:29 PM
hmm it's too hard for my english.

but thank you thomas83lin
Title: Re: Help to extend code~
Post by: wiiztec on June 04, 2010, 07:56:10 PM
You could also use C6 for the branch instead of 04
Title: Re: Help to extend code~
Post by: dcx2 on June 04, 2010, 07:59:28 PM
A C2 code does three things things.

1) It writes a series of ASM instructions "somewhere"
2) It over-writes the "hook address" of the C2 with a branch to "somewhere"
3) It over-writes the end of the ASM instructions with a branch back to the "hook address"

C207F1E8 00000004
8A1C0003 2C10000F
4182000C 907C0028
48000008 90DC0028
60000000 00000000

The C2 code is convenient because the code handler calculates the branches (steps 2 and 3) for you.  You also do not need to find a home for your ASM (step 1).  However, you can do these steps manually.

0707F1e8 0000001C
8A1C0003 2C10000F
4182000C 907C0028
48000008 90DC0028
xxxxxxxxx 00000000 <-- next value on the memory viewer?
             
The code above is writing ASM instructions.  You need to make sure it is writing the ASM to unused memory, otherwise you overwrite something important.  (that is step 1 of the C2 code)  You also need to make sure the hook address branches to your ASM (step 2) and that the end of your ASM branches back to the hook address (step 3)

It is very difficult to manually hook ASM.  That is why the C2 code was created.
Title: Re: Help to extend code~
Post by: Deathwolf on June 04, 2010, 08:14:53 PM
OH! Hook address is 8107F1E8.

But I don't understand step 3.

xxxxxxxxx ??

set this address? 8107F1E8
Title: Re: Help to extend code~
Post by: Thomas83Lin on June 04, 2010, 08:22:19 PM
Quote from: Deathwolf on June 04, 2010, 08:14:53 PM
OH! Hook address is 8107F1E8.

But I don't understand step 3.

xxxxxxxxx ??

set this address? 8107F1E8

The Hook address is 8007f1e8

0707F1e8 0000001C=  See that value is wrong, this line is were you would store your routine in Unused Memory, which could be any address but not the Org Hook
8A1C0003 2C10000F
4182000C 907C0028
48000008 90DC0028
xxxxxxxxx 00000000 Here is were you are adding a branch to your routine to branch one address after your hook address, so the routine can carry on
0407F1e8 xxxxxxxx This is were you're overwriting the Original Hook address to branch to the first line in your routine  

Quote from: dcx2 on June 04, 2010, 07:59:28 PM
It is very difficult to manually hook ASM.  That is why the C2 code was created.
Thats why i also prefer C2 over manually hooking, takes to long, plus it just seems safer
Title: Re: Help to extend code~
Post by: Deathwolf on June 04, 2010, 08:28:10 PM
what the hell is a branch? :-\
Title: Re: Help to extend code~
Post by: dcx2 on June 04, 2010, 08:40:13 PM
Have you ever seen ASM instructions bl, ble, beq, bne, bge, bgt, blt, or b?  Those are branches.

Normally, after the CPU executes an instruction, it reads the next instruction (current instruction + 4).  However, for a branch, the CPU "jumps" to a different instruction (NOT the next) and starts executing code there.
Title: Re: Help to extend code~
Post by: Thomas83Lin on June 04, 2010, 08:41:22 PM
Quote from: Deathwolf on June 04, 2010, 08:28:10 PM
what the hell is a branch? :-\
Like a goto\Jump statement.

edit: Beat to it  :P
Title: Re: Help to extend code~
Post by: Deathwolf on June 04, 2010, 10:08:42 PM
Quote from: dcx2 on June 04, 2010, 08:40:13 PM
Have you ever seen ASM instructions bl, ble, beq, bne, bge, bgt, blt, or b?  Those are branches.

Normally, after the CPU executes an instruction, it reads the next instruction (current instruction + 4).  However, for a branch, the CPU "jumps" to a different instruction (NOT the next) and starts executing code there.

No, I'm new to ASM...

@thomas83lin

jump to a next hook/value?
Title: Re: Help to extend code~
Post by: wiiztec on June 05, 2010, 12:43:16 AM
C6 calculates the branch for you
Title: Re: Help to extend code~
Post by: Thomas83Lin on June 05, 2010, 01:48:32 AM
Quote from: wiiztec on June 05, 2010, 12:43:16 AM
C6 calculates the branch for you

I'm unfamiliar with that codetype,  would it look something like this I guessed a Unused Memory Range so dont expect this to work.btw

 C607F1E8 80003200 {Overwrite Org Instruction with a Branch to First Asm Instruction in unused Memory}
 06003200 0000001C =06 String Routine
 8A1C0003 2C10000F
 4182000C 907C0028
 48000008 90DC0028
 60000000 00000000
 C600321C 8007F1EC Branch from 8000321C End of routine to 8007F1EC

or
 C607F1E8 80003200 {Overwrite Org Instruction with a Branch to First Asm Instruction in unused Memory}
 06003200 0000001C
 8A1C0003 2C10000F
 4182000C 907C0028
 48000008 90DC0028
 4807BFD4 00000000 Branch from end of Routine to 8007F1EC

or with 04

C607F1E8 80003200 = {Overwrite Org Instruction with a Branch to First Asm Instruction in unused Memory}
04003200 8A1C0003
04003204 2C10000F
04003208 4182000C
0400320C 907C0028
04003210 48000008
04003214 90DC0028
C6003218 8007f1EC = Branch from 80003218 to 8007F1EC
Title: Re: Help to extend code~
Post by: wiiztec on June 05, 2010, 02:23:28 AM
those will all work, except 80003200 isn't unused memory
Title: Re: Help to extend code~
Post by: Thomas83Lin on June 05, 2010, 02:27:08 AM
Quote from: wiiztec on June 05, 2010, 02:23:28 AM
those will all work, except 3200 isn't unused memory
I figured that, don't have the game so i just plugged something in,  its cool to learn something different though
Title: Re: Help to extend code~
Post by: Deathwolf on June 05, 2010, 10:17:40 AM
CST3 : Create a branch

C6XXXXXX YYYYYYYY : branch from XXXXXX+ba to YYYYYYYY It writes, at XXXXXXXX+ba, a "b YYYYYYYY" instruction.

D6XXXXXX YYYYYYYY : branch from XXXXXX+po to YYYYYYYY It writes, at XXXXXXXX+po, a "b YYYYYYYY" instruction.

  C607F1E8 80003200 you used any memory range?
  06003200 0000001C
  8A1C0003 2C10000F
  4182000C 907C0028
  48000008 90DC0028
  60000000 00000000
  C600321C 8007F1EC Branch from 8000321C End of routine to 8007F1EC

and how to use D6 with pointer?




Title: Re: Help to extend code~
Post by: Thomas83Lin on June 05, 2010, 07:48:09 PM
Quote from: disraelie on June 03, 2010, 02:19:02 AM
Naruto Shippuuden Gekitou Ninja Taisen EX3 [RNEJDA]
Infinite HP [ZiT]
C207F1E8 00000004
8A1C0003 2C10000F
4182000C 907C0028
48000008 90DC0028
60000000 00000000

If Skill Gauge Increase, MAX [ZiT]
C207FB5C 00000004
889E0003 2C04000F
4182000C 907E0044
48000008 90DE0044
60000000 00000000

Help to extend above code~like below code

Naruto Shippuuden Gekitou Ninja Taisen EX 2 (JP) [RNYJDA]
Infinite HP (1P ONLY) [ZiT]
0406DFA8 4BF95258
04003200 89FE0003
04003204 2C0F000F
04003208 41820018
0400320C 807E0020
04003210 4806AD9C
04003220 807E0022
04003224 4806AD88

If Skill Gauge Increase, MAX (1P ONLY) [ZiT]
0406E594 4BF94C9C
04003230 88BE0003
04003234 2C05000F
04003238 41820018
0400323C 83BE0034
04003240 4806B358
04003250 83BE0030
04003254 4806B344

Sense your thread got hijacked sorted of, heres the codes converted for ya These should work fine i've tested them

Naruto Shippuuden Gekitou Ninja Taisen EX3 [RNEJDA]

Infinite HP [ZiT]
0407F1E8 49480E18
05500000 8A1C0003
05500004 2C10000F
05500008 4182000C
0550000C 907C0028
05500010 48000008
05500014 90DC0028
05500018 4AB7F1D4

If Skill Gauge Increase, MAX [ZiT]
0407FB5C 494804C0
0550001C 889E0003
05500020 2C04000F
05500024 4182000C
05500028 907E0044
0550002C 48000008
05500030 90DE0044
05500034 4AB7FB2C
Title: Re: Help to extend code~
Post by: disraelie on June 06, 2010, 02:57:59 AM
wow~It works on dolphin
I love you "thomas83lin "
you are my sunshine~

Great ! Bravo !

How it comes~about the red part...
Infinite HP [ZiT]
0407F1E8 49480E18
05500000 8A1C0003
05500004 2C10000F
05500008 4182000C
0550000C 907C0028
05500010 48000008
05500014 90DC0028
05500018 4AB7F1D4

If Skill Gauge Increase, MAX [ZiT]
0407FB5C 494804C0
0550001C 889E0003
05500020 2C04000F
05500024 4182000C
05500028 907E0044
0550002C 48000008
05500030 90DE0044
05500034 4AB7FB2C

Title: Re: Help to extend code~
Post by: Thomas83Lin on June 06, 2010, 03:06:59 AM
Read reply 6, i used 05 instead of 04 though sense i stored the code in 81mem