[PPC] How to revers...
 
Notifications
Clear all

[PPC] How to reverse GSCr Functions for use in C#!

Page 1 / 4

Posts: 0
Topic starter
(@01cedric)
New Member
Joined: 9 years ago

Welcome to this Tutorial!

I´ve learned all of this mostly by myself, while discovering the CoD PDBs and compared the Functions within PseudoCode and Graph-View! Anyway lets start off...

Things required:
- A PDB (Server File) of your choice ( I recommend Ghosts PDB for IW Games and BO1/BO2 PDB for Treyarch Games)
- An Elf of the Games you want (I will be using MW3 1.24 defulat_Mp.elf)
- IDA Pro 6.1 (Recommended is 6.6)
- Low Requirements in PPC
- A Brain

Open both up and let them load completely until it tells you "idle" in IDA:

[hide][/hide]

Next up, go to the PDB File and search for a Function you want. I will use for this Tutorial PrecacheShader, as of its quite easy to reverse in my opinion. Go to the Function window (usually on the left site), click on it and go on the Top to Search -> Search and type your Function you want to search. In my case I search for -> PrecacheMaterial <- and you´ll find it (Treyarch Games are different to this one, try search for precacheshader, if you wont find it with the above one!) Doubleclick in the Function Window on the Function you want and it will pop up like this:

[hide][/hide]

In Most cases, its easier to use the Graph, but in this Case, we will use Textview. To get the Text-View, right-click on the Function and you´ll see "Text-View" (or something like this). Click on it.
Next Step is, to Locate the Functions, which are calling this one. These are most likely somewhere at the Bottom of the Function. In This we´re gonna scroll a little bit down and we will find this function!

[hide][/hide]

As of we know, that it needs to be a Material/Shader, we know that its this functionwe need. So lets get and search it for MW3.
Here is a good Pastebin from Shark, where he dumped most likely all GSC Functions for almost every CoD (incl. BO3):

[hide]sharkbait263[/hide]

What we are gonna do, is open up our ELF (from 1.24 MW3) and going to the Offset of the PrecacheShader, which we´ve found in the Dump.

It will look very similiar to the one we´ve saw in the PDB.
So we scroll down in the precacheShader function and we´ll see the G_MaterialIndex over there.

[hide][/hide]

Thats the Function we need to use for calling the GSC Function within C#, the only thing you´ll need to find (its in the Precacheshader function aswell) is level_local_t for precaching. I won´t give you the whole Code, but I will give you some "Basic-Riddle-Code" for you to complete! (Please don´t post in on here, keep it for yourself, as of you would destroy others fun)

Sorry for my bad english, I´m from Switzerland :p

NOTE: Not every GSCr Function can be used within C#, as of not every Function getting called from another Function 🙂 Most of them are, but some aren´t!

Peace out
- 01cedricv2

-Riddle-

[hide]
[code=CSS]public static int PrecacheShader(string Material)
{
PS3.Extension.WriteByte(0x00000000, 1); // The levels_local_t check
int MaterialIndex = RPC.Call(0x1BE744, Material);
PS3.Extension.WriteByte(0x00000000, 0); // The levels_local_t check
return MaterialIndex;
}

[/hide]

Who can find these Checks (Keep in it private for others to try)

Reply
15 Replies
KranK
Posts: 336
(@KranK)
Reputable Member
Joined: 9 years ago

Amazing tutorial and well writen

Good job on that find 😛

Reply
Posts: 0
Topic starter
(@01cedric)
New Member
Joined: 9 years ago

Amazing tutorial and well writen

Good job on that find :p

Thanks you very much 🙂 I tryed my best to make it as simple as possible! When you need something, hit me up! You know where to find me 🙂

Reply
Cyb3r
Posts: 1598
(@cyb3r)
Noble Member
Joined: 10 years ago

It's good to keep learning, I will get a cup coffee before reading this. 😀

Reply
Posts: 0
Topic starter
(@01cedric)
New Member
Joined: 9 years ago

It's good to keep learning, I will get a cup coffee before reading this. 😀

huehuehue, Yes! Thats what I mean! Everyone can just copy & paste, but if you really want to mod Games, then you need to learn! 🙂 Thats why I implemented a riddle.

Reply
Page 1 / 4