Help to extend code~

Started by disraelie, June 03, 2010, 02:19:02 AM

Previous topic - Next topic

Help to extend code~

Help to extend code~
0 (0%)
Help to extend code~
0 (0%)
Dont make poll's for questions~
3 (100%)

Total Members Voted: 3

dcx2

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.

Deathwolf

OH! Hook address is 8107F1E8.

But I don't understand step 3.

xxxxxxxxx ??

set this address? 8107F1E8
lolz

Thomas83Lin

#17
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

Deathwolf

what the hell is a branch? :-\
lolz

dcx2

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.

Thomas83Lin

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

Deathwolf

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?
lolz

wiiztec

C6 calculates the branch for you
If there's any code at all that you want to be button activated, or even able to toggle on & off, and I have the game, just PM me and I'll make it happen

Thomas83Lin

#23
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

wiiztec

those will all work, except 80003200 isn't unused memory
If there's any code at all that you want to be button activated, or even able to toggle on & off, and I have the game, just PM me and I'll make it happen

Thomas83Lin

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

Deathwolf

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?




lolz

Thomas83Lin

#27
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

disraelie

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


Thomas83Lin

Read reply 6, i used 05 instead of 04 though sense i stored the code in 81mem