Raised This Month: $51 Target: $400
 12% 

Solved Calling constructors from server binary?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
nosoop
Veteran Member
Join Date: Aug 2014
Old 03-21-2018 , 09:53   Calling constructors from server binary?
Reply With Quote #1

Hey there.
I'm trying to experiment with hooking some NextBot-related function calls in TF2 (and figuring out C++ in the process).

Right now I have a hook on a function CTFBotScenarioMonitor::DesiredScenarioAndClassAction, which expects a return type Action<CTFBot>. I'd like to return an instance of one of the other actions present in the game.

Is there a way to manually get the size of a class, or to instantiate an instance of that class without an explicit size declaration? I'm able to allocate memory and call the ctor of something like CTFBotSeekAndDestroy, but so far I'm manually inputting the amount to allocate based on existing references. Was wondering if there were any other approaches (or something available to extensions that I didn't find).

Thanks!
__________________
I do TF2, TF2 servers, and TF2 plugins.
I don't do DMs over Discord -- PM me on the forums regarding inquiries.
AlliedModders Releases / Github / TF2 Server / Donate (BTC / BCH / coffee)

Last edited by nosoop; 03-22-2018 at 22:37. Reason: added a question mark to the title
nosoop is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:18.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode