CabConModding
Facebook
Twitter
youtube
Discord
Contact us
RSS
Menu
CabConModding
Home
New
Top
Premium
Rules
FAQ - Frequently Asked Questions
Games
Fornite
Call of Duty: Black Ops 3
Clash of Clans
Grand Theft Auto 5
Apex Legends
Assassin’s Creed Origins
Forums
Premium
Latest posts
What's new
Latest posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Log in
Register
What's new
Premium
Latest posts
Menu
Log in
Register
Navigation
Install the app
Install
More options
Dark Theme
Contact us
Close Menu
Forums
Gaming
Call of Duty Classics
Tutorial Section
How to Call Raw GSC Functions Via SPRX
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Gentle" data-source="post: 9907"><p><strong>NOT MINE I C+P'D THIS KINDA LIKE FROSTYLOBBYS TOOL!!!</strong></p><p></p><p></p><p>Sup guys, if you don't know me, good. I'm from xbox xD. My alias is Maybe Ethernet. I'll be showing you how to call raw gsc functions in your dll/sprx.</p><p></p><p>Ok so first we want to get our basic functions</p><p></p><p>[code]int Scr_SetParameters(unsigned int Num){</p><p> return *(int*)(0x13C3140 + 0x2038) = Num;</p><p>}[/code]//This will set the parameter number</p><p></p><p>[code]struct opd_s{</p><p> uint Sub;</p><p> uint Toc;</p><p>};[/code]</p><p></p><p>[code]opd_s ParseAddr(int Address){</p><p> opd_s GLS = { Address, 0x724C38 };</p><p> return GLS;</p><p>}[/code]//TOC</p><p></p><p>Next we want to get all the Scr_Add functions together</p><p>[code]#define Scr_AddInt(Value) ((void(*)(int))&ParseAddr(0x20C608))(Value)</p><p>#define Scr_AddFloat(Value) ((void(*)(float))&ParseAddr(0x20C5C0))(Value)</p><p>#define Scr_AddString(String) ((void(*)(const char*))&ParseAddr(0x20C428))(String)</p><p>#define Scr_AddEntity(Entity) ((void(*)(int))&ParseAddr(0x1B7700))(Entity)</p><p>#define Scr_AddVector(Vec) ((void(*)(const float*))&ParseAddr(0x20C330))(Vec)[/code]</p><p></p><p>Now to explain how to actually use these, we're going to use GScr_Earthquake as an example which is located at 0x1A80E8.</p><p></p><p>Here's how we do this.</p><p></p><p>First: [code]#define Scr_ClearOutParams() ((void(*)(void))&ParseAddr(0x20C198))()[/code]</p><p></p><p>[code]void GScr_Earthquake(float scale, float duration, float* source, float radius){</p><p> Scr_AddFloat(radius);</p><p> Scr_AddVector(source);</p><p> Scr_AddFloat(duration);</p><p> Scr_AddFloat(scale);</p><p> Scr_SetParameters(4); //See how I set the parameter number after I finish calling the Scr_Adds?</p><p> ((void(*)())&ParseAddr(0x1A80E8))(); //Call the actual function</p><p> //((void(*)(int))&ParseAddr(0x1A80E8))(ClientID << 16); //Only call this one if the one above doesn't work.</p><p> Scr_ClearOutParams();</p><p>}[/code]</p><p></p><p>See how I called the Scr_Adds from the last parameter to the 1st one? Well you have to do that, idk why really.</p><p></p><p>Now on to the hook. You need somewhere to call these right? Well your answer is: VM_Resume - 0x2E69C4.</p><p></p><p>Method to hook: hookFunctionStart - Credit to Xx jAmes t xX for porting this <img src="/styles/default/xenforo/smilies.emoji/people/smile.emoji.svg" class="smilie" loading="lazy" alt=":grinning:" title="Grinning :grinning:" data-shortname=":grinning:" /></p><p></p><p>[code]void PatchInJump(int Address, int Destination){</p><p> int FuncBytes[4];</p><p> Destination = *(int*)Destination;</p><p> FuncBytes[0] = 0x3D600000 + ((Destination >> 16) & 0xFFFF);</p><p> if(Destination & 0x8000) FuncBytes[0] += 1;</p><p> FuncBytes[1] = 0x396B0000 + (Destination & 0xFFFF);</p><p> FuncBytes[2] = 0x7D6903A6;</p><p> FuncBytes[3] = 0x4E800420;</p><p> Memcpy((void*)Address, FuncBytes, 4*4);</p><p>}[/code]</p><p></p><p>[code]void hookFunctionStart(int Address, int saveStub, int Destination){ //Works on every game</p><p> saveStub = *(int*)saveStub;</p><p> int BranchtoAddress = Address + (4*4);</p><p> int StubData[8];</p><p> StubData[0] = 0x3D600000 + ((BranchtoAddress >> 16) & 0xFFFF);</p><p> if(BranchtoAddress & 0x8000) StubData[0] += 1;</p><p> StubData[1] = 0x396B0000 + (BranchtoAddress & 0xFFFF);</p><p> StubData[2] = 0x7D6903A6;</p><p> Memcpy(&StubData[3], (void*)Address, 4*4);</p><p> StubData[7] = 0x4E800420;</p><p> Memcpy((void*)saveStub, StubData, 8*4);</p><p> PatchInJump(Address, Destination);</p><p>}[/code]</p><p></p><p>Now our function hook</p><p></p><p>[code]void VM_ResumeStub(int TimeId){</p><p> __asm("li %r3, 0x3");</p><p>}[/code]</p><p></p><p>[code]void VM_ResumeHook(int TimeId){ // If this doesn't work, hook int VM_Execute() - 0x20CC08 with hookFunctionStart</p><p> //You would call GScr_Earthquake here. Obv not in the loop. Make sure you implement a check in here to make it // get called once</p><p> VM_ResumeStub(TimeId);</p><p>}[/code]</p><p></p><p>To call our hook we do [code]hookFunctionStart(0x210A48, (int)VM_ResumeStub, (int)VM_ResumeHook);[/code]</p><p>Make sure you call that about 2 seconds after your thread is executed.</p><p></p><p></p><p>Now that's it. <img src="/styles/default/xenforo/smilies.emoji/people/smile.emoji.svg" class="smilie" loading="lazy" alt=":grinning:" title="Grinning :grinning:" data-shortname=":grinning:" /> Also, you can call other things like:</p><p></p><p>PlayerCmd_ClonePlayer</p><p>PlayerCmd_Suicide</p><p>Player_Die</p><p>G_RadiusDamage</p><p>GScr_NotifyOnPlayerCommand //Someone find this for me on ghosts pls ;-;</p><p>G_Damage</p><p>and many more!</p><p></p><p>Now on to waitill. Pretty easy tbh.</p><p></p><p>First [code]#define SL_ConvertToString(StringValue) ((const char*(*)(unsigned short))ParseAddr(0x200280))(StringValue)[/code]</p><p></p><p>[code]hookFunctionStart(0x20B7C8, (int)VM_NotifyStub, (int)VM_NotifyHook);[/code]</p><p></p><p>[code]void VM_NotifyStub(unsigned int self, short Stringvalue, unsigned int Paramcount){</p><p> __asm("li %r3, 0x4");</p><p>}[/code]</p><p></p><p>[code]void VM_NotifyHook(unsigned int self, short Stringvalue, unsigned int Paramcount){</p><p> //Now if we wanted to monitor onPlayerSpawned we do</p><p> int ClientID = ((int(*)(int))&ParseAddr(0x201F90))(self); //Scr_GetSelf</p><p> const char* Notify = SL_ConvertToString(Stringvalue);</p><p> if(!strcmp(Notify, "spawned_player")){</p><p> //Executed on spawn. This monitors for ANY CLIENT THAT SPAWNS!</p><p> GScr_Earthquake(0.6f, 2, (float*)(Playerstate() + 0x1C), 800); //Yes you can call this in V</p><p> }</p><p> VM_NotifyStub(self, Stringvalue, Paramcount);</p><p>}[/code]</p><p></p><p>That's pretty much it <img src="/styles/default/xenforo/smilies.emoji/people/stuck_out_tongue_winking_eye.emoji.svg" class="smilie" loading="lazy" alt=":tonguewink:" title="Tongue Wink :tonguewink:" data-shortname=":tonguewink:" /> This works for all cods the same way as it works for this. Just update the offsets.</p></blockquote><p></p>
[QUOTE="Gentle, post: 9907"] [B]NOT MINE I C+P'D THIS KINDA LIKE FROSTYLOBBYS TOOL!!![/B] Sup guys, if you don't know me, good. I'm from xbox xD. My alias is Maybe Ethernet. I'll be showing you how to call raw gsc functions in your dll/sprx. Ok so first we want to get our basic functions [code]int Scr_SetParameters(unsigned int Num){ return *(int*)(0x13C3140 + 0x2038) = Num; }[/code]//This will set the parameter number [code]struct opd_s{ uint Sub; uint Toc; };[/code] [code]opd_s ParseAddr(int Address){ opd_s GLS = { Address, 0x724C38 }; return GLS; }[/code]//TOC Next we want to get all the Scr_Add functions together [code]#define Scr_AddInt(Value) ((void(*)(int))&ParseAddr(0x20C608))(Value) #define Scr_AddFloat(Value) ((void(*)(float))&ParseAddr(0x20C5C0))(Value) #define Scr_AddString(String) ((void(*)(const char*))&ParseAddr(0x20C428))(String) #define Scr_AddEntity(Entity) ((void(*)(int))&ParseAddr(0x1B7700))(Entity) #define Scr_AddVector(Vec) ((void(*)(const float*))&ParseAddr(0x20C330))(Vec)[/code] Now to explain how to actually use these, we're going to use GScr_Earthquake as an example which is located at 0x1A80E8. Here's how we do this. First: [code]#define Scr_ClearOutParams() ((void(*)(void))&ParseAddr(0x20C198))()[/code] [code]void GScr_Earthquake(float scale, float duration, float* source, float radius){ Scr_AddFloat(radius); Scr_AddVector(source); Scr_AddFloat(duration); Scr_AddFloat(scale); Scr_SetParameters(4); //See how I set the parameter number after I finish calling the Scr_Adds? ((void(*)())&ParseAddr(0x1A80E8))(); //Call the actual function //((void(*)(int))&ParseAddr(0x1A80E8))(ClientID << 16); //Only call this one if the one above doesn't work. Scr_ClearOutParams(); }[/code] See how I called the Scr_Adds from the last parameter to the 1st one? Well you have to do that, idk why really. Now on to the hook. You need somewhere to call these right? Well your answer is: VM_Resume - 0x2E69C4. Method to hook: hookFunctionStart - Credit to Xx jAmes t xX for porting this :grinning: [code]void PatchInJump(int Address, int Destination){ int FuncBytes[4]; Destination = *(int*)Destination; FuncBytes[0] = 0x3D600000 + ((Destination >> 16) & 0xFFFF); if(Destination & 0x8000) FuncBytes[0] += 1; FuncBytes[1] = 0x396B0000 + (Destination & 0xFFFF); FuncBytes[2] = 0x7D6903A6; FuncBytes[3] = 0x4E800420; Memcpy((void*)Address, FuncBytes, 4*4); }[/code] [code]void hookFunctionStart(int Address, int saveStub, int Destination){ //Works on every game saveStub = *(int*)saveStub; int BranchtoAddress = Address + (4*4); int StubData[8]; StubData[0] = 0x3D600000 + ((BranchtoAddress >> 16) & 0xFFFF); if(BranchtoAddress & 0x8000) StubData[0] += 1; StubData[1] = 0x396B0000 + (BranchtoAddress & 0xFFFF); StubData[2] = 0x7D6903A6; Memcpy(&StubData[3], (void*)Address, 4*4); StubData[7] = 0x4E800420; Memcpy((void*)saveStub, StubData, 8*4); PatchInJump(Address, Destination); }[/code] Now our function hook [code]void VM_ResumeStub(int TimeId){ __asm("li %r3, 0x3"); }[/code] [code]void VM_ResumeHook(int TimeId){ // If this doesn't work, hook int VM_Execute() - 0x20CC08 with hookFunctionStart //You would call GScr_Earthquake here. Obv not in the loop. Make sure you implement a check in here to make it // get called once VM_ResumeStub(TimeId); }[/code] To call our hook we do [code]hookFunctionStart(0x210A48, (int)VM_ResumeStub, (int)VM_ResumeHook);[/code] Make sure you call that about 2 seconds after your thread is executed. Now that's it. :grinning: Also, you can call other things like: PlayerCmd_ClonePlayer PlayerCmd_Suicide Player_Die G_RadiusDamage GScr_NotifyOnPlayerCommand //Someone find this for me on ghosts pls ;-; G_Damage and many more! Now on to waitill. Pretty easy tbh. First [code]#define SL_ConvertToString(StringValue) ((const char*(*)(unsigned short))ParseAddr(0x200280))(StringValue)[/code] [code]hookFunctionStart(0x20B7C8, (int)VM_NotifyStub, (int)VM_NotifyHook);[/code] [code]void VM_NotifyStub(unsigned int self, short Stringvalue, unsigned int Paramcount){ __asm("li %r3, 0x4"); }[/code] [code]void VM_NotifyHook(unsigned int self, short Stringvalue, unsigned int Paramcount){ //Now if we wanted to monitor onPlayerSpawned we do int ClientID = ((int(*)(int))&ParseAddr(0x201F90))(self); //Scr_GetSelf const char* Notify = SL_ConvertToString(Stringvalue); if(!strcmp(Notify, "spawned_player")){ //Executed on spawn. This monitors for ANY CLIENT THAT SPAWNS! GScr_Earthquake(0.6f, 2, (float*)(Playerstate() + 0x1C), 800); //Yes you can call this in V } VM_NotifyStub(self, Stringvalue, Paramcount); }[/code] That's pretty much it :tonguewink: This works for all cods the same way as it works for this. Just update the offsets. [/QUOTE]
Verification
Post reply
Forums
Gaming
Call of Duty Classics
Tutorial Section
How to Call Raw GSC Functions Via SPRX
CabConModding is now on facebook! Check the latest Updates, the Site Status and much more now!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…
Top