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!
(adsbygoogle = window.adsbygoogle || []).push({});

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, 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, Hash847, xFlavez, xRevolutions
08-31-2013, 01:50 AM #20
Originally posted by Choco View Post
All instructions should work. It uses the MinGW compiler.


dword_? unk_ ?

edit: nevermind, got it to work.
09-07-2013, 12:07 PM #21
If only I knew PPC
10-06-2013, 03:37 PM #22
Strike Venom
Top Down Siad Barre
Originally posted by Choco View Post
It uses the MinGW compiler.


It uses the SCE compiler/stripper from SDK 3.40 :vince:
04-09-2014, 08:42 AM #23
Cyb3r
NextGenUpdate Elite
bl structure don't work so well,
tried to compile "bl 0x17DE7E0" it's giving me wrong address after i decompile it!
it does not add +1 the first byte..
PPC compiled it as = 487DE7E1
The correct compile is = 497DE7E1
Some one correct me if i'm wrong!

The following user groaned Cyb3r for this awful post:

GongasPT
04-10-2014, 08:30 PM #24
Choco
Respect my authoritah!!
Originally posted by Cyb3r View Post
bl structure don't work so well,
tried to compile "bl 0x17DE7E0" it's giving me wrong address after i decompile it!
it does not add +1 the first byte..
PPC compiled it as = 487DE7E1
The correct compile is = 497DE7E1
Some one correct me if i'm wrong!


Make sure you set the right start address.
04-10-2014, 11:39 PM #25
Cyb3r
NextGenUpdate Elite
Originally posted by Choco View Post
Make sure you set the right start address.


I'm sure bud check the image below:

You must login or register to view this content.
04-12-2014, 01:46 AM #26
Choco
Respect my authoritah!!
Originally posted by Cyb3r View Post
I'm sure bud check the image below:

You must login or register to view this content.


The image you posted has a correctly generated branch instruction.
04-12-2014, 09:47 PM #27
Cyb3r
NextGenUpdate Elite
Originally posted by Choco View Post
The image you posted has a correctly generated branch instruction.


So i was wrong using Asmwiird method to compile,

Let's try PPC compiler method.. in farcry 3 i want to jump from 0x0097FD30 to 0x0215E510 to make my subroutine, See what's the compile result:

You must login or register to view this content.

Changed in debugger gives me the wrong address:

You must login or register to view this content.

I hope that's cleared out.
04-13-2014, 03:36 AM #28
Choco
Respect my authoritah!!
Originally posted by Cyb3r View Post
So i was wrong using Asmwiird method to compile,

Let's try PPC compiler method.. in farcry 3 i want to jump from 0x0097FD30 to 0x0215E510 to make my subroutine, See what's the compile result:

You must login or register to view this content.

Changed in debugger gives me the wrong address:

You must login or register to view this content.

I hope that's cleared out.


Hmm, interesting. I think this is because the function I wrote for generating the bl's only supports shorter length branches (when I wrote this, I had primarily COD games in mind, which don't have large elfs). The branch you have is longer so it's causing an error.

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo