Post: PPC Compiler
07-27-2013, 02:06 AM #1
Choco
Respect my authoritah!!
(adsbygoogle = window.adsbygoogle || []).push({}); Hey NGU,

This is a tool I created for compiling PowerPC instructions into OpCodes. This is EXTREMELY useful for PS3 modding, as all PS3 .elfs are PowerPC. This is a PPU compiler, so it will compile opcodes that will work for any PS3 game application (or xbox .xex files).

Screenshot:

You must login or register to view this content.



How to use

1. Enter your instructions in the box on the left.
2. Enter the address that you will be injecting the opcodes at in the Start Address box (note, this is the address from IDA/Memory, not the HxD address).
3. Click the compile button.
4. Copy the opcodes from the rightmost box and paste them into your elf at the appropriate address.

To designate a register, put a "%" symbol in front of it. For example:

    li r3, 0    <--this will not work.
li %r3, 0 <--this will work.


For bl instructions, just do:

    bl (address to bl to)


For example:

    bl 0x248FA4


For conditional branching instructions, just do the instruction followed by the distance to branch. For example:

    bdnz -0x14
beq 0x14
bne 0x2C




Download

Download the tool here: You must login or register to view this content.
View a virus scan here: You must login or register to view this content.

(Sorry about the false positives, the app has been protected to prevent reverse engineering Choco)

Credits:
-BuC-Shotz for some help and some code
-The makers of MinGW
-xSonoro for packing
-iMCSx for some C# help


Enjoy guys, hopefully this will be useful to some of you!
Last edited by Choco ; 07-27-2013 at 02:29 AM.

The following 69 users say thank you to Choco for this useful post:

-JM-, {H} | Exception, |RichModder|, AlexNGU, B777x, BadChoicesZ, BaSs_HaXoR, BLiNDzZ, BrinkerzHD, Bucko, Chxii, Cyb3r, Dan Dactyl, DH63, ErasedDev, esc0rtd3w, Father Luckeyy, FBML, flynhigh09, Gabberhard, Gendjisan, GongasPT, Hunter926, ImAzazel, ImPiffHD, ImSooCool, Insult, Island Time, ItsLollo1000, jdmalex, Je Modz, JLM, JOniiX85, klambo, LBK, M-alShammary, Mango_Knife, milky4444, Mr_Snake_-, Mr. Mask, mrdarkblue, Norway-_-1999, Notorious, O-H, GandalfsBish, Pewp, primetime43, Pseudo_Soldier, ryu_hayabusa80, ICS Vortex, SC58, Shark, Smoky420, SnaY, Soldier., Source Code, Sticky, Swaqq, Taylor, TheUnexpected, Ciri, TotalModzHD, Vicodin10, Winter, xFlavez, xRevolutions
07-27-2013, 11:54 AM #11
Originally posted by therifboy View Post
You just went full retard. Drack


:carling:
07-27-2013, 12:23 PM #12
Originally posted by Choco View Post
Hey NGU,

This is a tool I created for compiling PowerPC instructions into OpCodes. This is EXTREMELY useful for PS3 modding, as all PS3 .elfs are PowerPC. This is a PPU compiler, so it will compile opcodes that will work for any PS3 game application (or xbox .xex files).

Screenshot:

You must login or register to view this content.



How to use

1. Enter your instructions in the box on the left.
2. Enter the address that you will be injecting the opcodes at in the Start Address box (note, this is the address from IDA/Memory, not the HxD address).
3. Click the compile button.
4. Copy the opcodes from the rightmost box and paste them into your elf at the appropriate address.

To designate a register, put a "%" symbol in front of it. For example:

    li r3, 0    <--this will not work.
li %r3, 0 <--this will work.


For bl instructions, just do:

    bl (address to bl to)


For example:

    bl 0x248FA4


For conditional branching instructions, just do the instruction followed by the distance to branch. For example:

    bdnz -0x14
beq 0x14
bne 0x2C




Download

Download the tool here: You must login or register to view this content.
View a virus scan here: You must login or register to view this content.

(Sorry about the false positives, the app has been protected to prevent reverse engineering Choco)

Credits:
-BuC-Shotz for some help and some code
-The makers of MinGW
-xSonoro for packing
-iMCSx for some C# help


Enjoy guys, hopefully this will be useful to some of you!



wait so will it make full programs?

for example:

    func:
mflr %r0 // set up the stack frame
stw %r0, 8(r1)
stwu %r1, -16(r1)
addi %r3, %r3, 3 // add 3 to the argument and return it
addi %r1, %r1, 16 // destroy the stack frame
lwz %r0, 8(r1)
mtlr %r0
blr // return

.globl _main
_main:
mflr %r0 // set up the stack frame
stw %r0, 8(r1)
stwu %r1, -16(r1)
lis %r3, hi16(847318093) // load big number into r3
ori %r3, %r3, lo16(847318092)
bl func // call stuff
addi %r1, %r1, 16 // destroy the stack frame
lwz %r0, 8(r1)
mtlr %r0
blr // return


just simple math shit?
Last edited by Jakes625 ; 07-27-2013 at 12:26 PM.
07-27-2013, 12:58 PM #13
ϟ c0rruption ϟ
Certified Ethical Hacker
Nice tool Awesome face
07-27-2013, 04:43 PM #14
Chxii
Do a barrel roll!
Thanks Choco you always helpful
07-27-2013, 05:49 PM #15
Choco
Respect my authoritah!!
Originally posted by Jakes
wait so will it make full programs?

for example:

    func:
mflr %r0 // set up the stack frame
stw %r0, 8(r1)
stwu %r1, -16(r1)
addi %r3, %r3, 3 // add 3 to the argument and return it
addi %r1, %r1, 16 // destroy the stack frame
lwz %r0, 8(r1)
mtlr %r0
blr // return

.globl _main
_main:
mflr %r0 // set up the stack frame
stw %r0, 8(r1)
stwu %r1, -16(r1)
lis %r3, hi16(847318093) // load big number into r3
ori %r3, %r3, lo16(847318092)
bl func // call stuff
addi %r1, %r1, 16 // destroy the stack frame
lwz %r0, 8(r1)
mtlr %r0
blr // return


just simple math shit?


Yep, you could compile that. You'd probably have to get rid of the hi16, lo16 stuff.
07-27-2013, 06:18 PM #16
Originally posted by Soldier. View Post
So for that reason it shouldn't be released? I'm sure you was a noob at some point too...


O yeah bro I was a big noob at this stuff I started learning about all this stuff around 2011 and 2012 I knew all most all the stuff and now I know alot of things I thouth I would never learn everyone becomes a noob at some point bro but in the future It makes alot more sense so yeah lol.
07-27-2013, 06:20 PM #17
Originally posted by therifboy View Post
You just went full retard. Drack


LOL right.
07-27-2013, 11:12 PM #18
Which instructions have been implemented? Did you use a library to assemble the assembly?

You should definitely add support for labels. Otherwise good job.
07-28-2013, 02:59 AM #19
Choco
Respect my authoritah!!
Originally posted by dnawrkshp View Post
Which instructions have been implemented? Did you use a library to assemble the assembly?

You should definitely add support for labels. Otherwise good job.


All instructions should work. It uses the MinGW compiler.

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo