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)