Originally posted by PlanetJulgran
Hi! So I need some help with reversing the RefDef struct. I've looked at the Quake Source to find where its being used but ive had no luck in finding it. Can someone help? Is there a string or a known function I can use to find it?
Find a function that uses it as a parameter as that will make it easier to find. Also, it can be accessed through the cg_t struct and that is how most functions use it.
Here's an example, CL_RenderScene takes RefDef_t as a parameter so you want to go to a function that calls CL_RenderScene in BO2 that is CG_DrawActive. So once you find those two functions you will be able to find the location of RefDef_t in cg_t by looking at where CL_RenderScene is called in CG_DrawActive as if you look in IDA you can see the the parameters that are being given to call CL_RenderScene.
If you have some PPC knowledge you should be able to know how it is doing cg_t + 0x????? for refdef_t, I won't go into much detail but it will be like this - lis r#, 0x? then ori r#, r#, 0x????. That;s how you get the location of RefDef_t in cg_t, there is other ways to, but can't really recall any.
Note: There is a leaked pdb for BO2 so you are better off using that rather than Quake Source, same for most newer cods, it's better to use one of the leaked PDBs.