is there a way to branch to another addess without loading into a new address?
example:
hook address:
80389400
should branch to 80389404
so I want to overwrite the instruction at 80389400 and then overwrite the instruction at 80389404.
80389400 to stw
branch
80389404 to cmpwi
but how should I branch this? no 2xC2 codes. all in one would be great.
and there even shouldn't a lis and ori to fill out.
thanks a lot
Use a C6 then a C2
C6389400 80389404
I think that's how you use C6 though it might be C6389400 00000004
oh C6 :eek:
can you give me please a example?
this would be great.
btw thanks for your answer
Create a branch
C6______ YYYYYYYY
Writes, at ______+ba, a "b YYYYYYYY" instruction.
To use po instead of ba, change the codetype from C6 to D6.
For values of ______ >= 0x01000000, add one to the codetype.
or you could just nop the instruction at 80389400 and make a C2 code for 80389404
ok thanks.
so
first the C2 code and then the C6389400 80389404 ?
but the C6 code doesn't know how many lines I want to write.
C6 only writes 1 line
yeah that's right. write a nop instruction at 80389400 is also another way, but I was asking about a full C2 code (only one C2, all in one)
so is C6 only for branching? can I write ONE value with it?
Yes it's only for branching
ok but then there is another problem.
what about the value at 80389404? this instruction should be a cmpwi.
Use a 04 or C2 code for that
if I can use 04, then why I need the C6 code?
04389400 XXXXXXXX
04389404 XXXXXXXX
and it's done... but the question was:
combinate C2389400 and C2389404 to ONE C2 code.
stw <--- first C2
lis r12,0x8038 <-- second C2
ori r12,r12,0x9404
lis r14,0xXXXX
ori r14,r14,0xXXXX
stw r14,0(r12)
again done. 2xC2 to 1xC2
but it's again with "loading into address"....
Why does it have to be 1 C2 code?
I just want to learn to combinate C2 with branches.