seksea / gamesneeze

CS:GO cheat for linux with a basic gdb injector
http://i-am.sekc.me
MIT License
209 stars 51 forks source link

improvment minor for hooks #149

Closed s-b-repo closed 1 year ago

s-b-repo commented 1 year ago

The use of the sleep function with a hardcoded value of 10 could potentially cause problems if the sleep duration is not sufficient. It would be better to use a more robust method of waiting for the hook initialization and unloading process to complete.

include "../../includes.hpp"

include "hooks.hpp"

include "vmt.hpp"

include

include

include

include

static Hooks::Events::EventListener* eventListener = nullptr;

/ Create hooks / bool Hooks::init() { Log::log(LOG, "Initialising hooks..."); if (!SDL::initSDL()) { Log::log(ERR, " Failed to initialise SDL hooks!"); return false; }

Log::log(LOG, " Hooking CreateMove...");
CreateMove::original = (CreateMove::func)VMT::hook(Interfaces::clientMode, (void*)CreateMove::hook, 25);

Log::log(LOG, " Hooking Paint...");
Paint::original = (Paint::func)VMT::hook(Interfaces::engineVgui, (void*)Paint::hook, 15);

Log::log(LOG, " Hooking DrawModelExecute...");
DrawModelExecute::original = (DrawModelExecute::func)VMT::hook(Interfaces::modelRender, (void*)DrawModelExecute::hook, 21);

Log::log(LOG, " Hooking FrameStageNotify...");
FrameStageNotify::original = (FrameStageNotify::func)VMT::hook(Interfaces::client, (void*)FrameStageNotify::hook, 37);

Log::log(LOG, " Hooking EmitSound...");
EmitSound::original = (EmitSound::func)VMT::hook(Interfaces::sound, (void*)EmitSound::hook, 6);

Log::log(LOG, " Hooking IsHLTV...");
IsHLTV::original = (IsHLTV::func)VMT::hook(Interfaces::engine, (void*)IsHLTV::hook, 93);

Log::log(LOG, " Hooking ClientCmd...");
ClientCmd::original = (ClientCmd::func)VMT::hook(Interfaces::engine, (void*)ClientCmd::hook, 7);

Log::log(LOG, " Hooking OverrideView...");
OverrideView::original = (OverrideView::func)VMT::hook(Interfaces::clientMode, (void*)OverrideView::hook, 19);

Log::log(LOG, " Hooking GetViewmodelFOV... ");
GetViewmodelFOV::original = (GetViewmodelFOV::func)VMT::hook(Interfaces::clientMode, (void*)GetViewmodelFOV::hook, 36);

eventListener = new Events::EventListener;

Log::log(LOG, "Initialised hooks!");
return true;

}

/ Unload hooks / bool Hooks::unload() { Log::log(LOG, "Unloading hooks...");

if (!SDL::unloadSDL()) {
    Log::log(ERR, "Failed to unload SDL hooks!");
    return false;
}

/* hook with original to do bigbrain unhooking */
Log::log(LOG

/* hook with original to do bigbrain unhooking */
Log::log(LOG, " Unhooking CreateMove...");
VMT::hook(Interfaces::clientMode, (void*)CreateMove::original, 25);

Log::log(LOG, " Unhooking Paint...");
VMT::hook(Interfaces::engineVgui, (void*)Paint::original, 15);

Log::log(LOG, " Unhooking DME...");
VMT::hook(Interfaces::modelRender, (void*)DrawModelExecute::original, 21);

Log::log(LOG, " Unhooking FSN...");
VMT::hook(Interfaces::client, (void*)FrameStageNotify::original, 37);

Log::log(LOG, " Unhooking EmitSound...");
VMT::hook(Interfaces::sound, (void*)EmitSound::original, 6);

Log::log(LOG, " Unhooking IsHLTV...");
VMT::hook(Interfaces::engine, (void*)IsHLTV::original, 93);

Log::log(LOG, " Unhooking ClientCmd...");
VMT::hook(Interfaces::engine, (void*)ClientCmd::original, 7);

Log::log(LOG, " Unhooking OverrideView...");
VMT::hook(Interfaces::clientMode, (void*)OverrideView::original, 19);

Log::log(LOG, " Unhooking GetViewmodelFOV... ");
VMT::hook(Interfaces::clientMode, (void*)GetViewmodelFOV::original, 36);

delete eventListener;
eventListener = nullptr;

Log::log(LOG, "Unloaded hooks!");
return true;

}

seksea commented 1 year ago

just slapping some shit into chatgpt doesnt make it better unfortunately

s-b-repo commented 1 year ago

the ai can code better than a human

Jovvik commented 1 year ago

the ai can code better than a human

better than you, not an actual programmer

s-b-repo commented 1 year ago

nah it can code better than most pros cause it was made by a whole team of pros unlike a wanna be pro

seksea commented 1 year ago

nah it can code better than most pros cause it was made by a whole team of pros unlike a wanna be pro

Simply not true, the changes listed in this issue would only make the cheat more likely to crash on unload as all hooks won't get enough time to finish running before the cheat is unloaded. This issue is completely useless other than to flex how "clever" chatgpt is even though it's making a change that would only hinder the project, please just learn how to code and what all this shit does before saying this I beg of you. ChatGPT very clearly is not a "pro coder", yes it's a helpful tool.. but not when used blindly like this, grow some common sense 🙏

s-b-repo commented 1 year ago

says the freelancer (if you're going to attempt to offend him, at least spell properly. - @dweee)

hellidox commented 1 year ago

stop dickriding chatgpt it wont spare you when the singularity comes

seksea commented 1 year ago

https://github.com/coolst3r/ada-flood/issues/1 AI issue bro

s-b-repo commented 1 year ago

still stale no updates

s-b-repo commented 1 year ago

coolst3r/ada-flood#1 AI issue bro

i added white space my issue not ai

s-b-repo commented 1 year ago

stop dickriding chatgpt it wont spare you when the singularity comes

im not i dont care about stuff like that