Skip to content

Commit

Permalink
Remove unused hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
tjone270 committed Jun 16, 2024
1 parent bcebdca commit 68db595
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 35 deletions.
9 changes: 0 additions & 9 deletions dllmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ SV_DropClient_ptr SV_DropClient;
Sys_SetModuleOffset_ptr Sys_SetModuleOffset;
SV_SpawnServer_ptr SV_SpawnServer;
Cmd_ExecuteString_ptr Cmd_ExecuteString;
SV_BotAllocateClient_ptr SV_BotAllocateClient;
SV_BotFreeClient_ptr SV_BotFreeClient;
SV_Frame_ptr SV_Frame;

// VM functions
G_RunFrame_ptr G_RunFrame;
Expand All @@ -74,7 +71,6 @@ LaunchItem_ptr LaunchItem;
Drop_Item_ptr Drop_Item;
G_StartKamikaze_ptr G_StartKamikaze;
G_FreeEntity_ptr G_FreeEntity;
SetTeam_ptr SetTeam;

// VM global variables.
gentity_t* g_entities;
Expand Down Expand Up @@ -139,9 +135,6 @@ static void SearchFunctions(void) {
STATIC_SEARCH(Sys_SetModuleOffset, PTRN_SYS_SETMODULEOFFSET, MASK_SYS_SETMODULEOFFSET);
STATIC_SEARCH(SV_SpawnServer, PTRN_SV_SPAWNSERVER, MASK_SV_SPAWNSERVER);
STATIC_SEARCH(Cmd_ExecuteString, PTRN_CMD_EXECUTESTRING, MASK_CMD_EXECUTESTRING);
STATIC_SEARCH(SV_BotAllocateClient, PTRN_SV_BOTALLOCATECLIENT, MASK_SV_BOTALLOCATECLIENT);
STATIC_SEARCH(SV_BotFreeClient, PTRN_SV_BOTFREECLIENT, MASK_SV_BOTFREECLIENT);
STATIC_SEARCH(SV_Frame, PTRN_SV_FRAME, MASK_SV_FRAME);

// Cmd_Argc is really small, making it hard to search for, so we use a reference to it instead.
if (SV_Map_f != NULL) {
Expand Down Expand Up @@ -175,8 +168,6 @@ void SearchVmFunctions(void) {
VM_SEARCH(Drop_Item, PTRN_DROP_ITEM, MASK_DROP_ITEM);
VM_SEARCH(G_StartKamikaze, PTRN_G_STARTKAMIKAZE, MASK_G_STARTKAMIKAZE);
VM_SEARCH(G_FreeEntity, PTRN_G_FREEENTITY, MASK_G_FREEENTITY);
VM_SEARCH(SetTeam, PTRN_SETTEAM, MASK_SETTEAM);
VM_SEARCH(ClientEndFrame, PTRN_CLIENTENDFRAME, MASK_CLIENTENDFRAME);

if (failed) {
DebugPrint("Exiting.\n");
Expand Down
26 changes: 0 additions & 26 deletions patterns.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,6 @@
#define PTRN_CMD_EXECUTESTRING "\x41\x54\x49\x89\xfc\x55\x53\xe8\x00\x00\x00\x00\x44\x8b\x0d\x00\x00\x00\x00\x45\x85\xc9\x0f\x84\x00\x00\x00\x00\x48\x8b\x1d\x00\x00\x00\x00\xbd\x00\x00\x00\x00\x48\x85\xdb\x75\x00\xeb\x00\x90"
#define MASK_CMD_EXECUTESTRING "XXXXXXXX----XXX----XXXXX----XXX----X----XXXX-X-X"

// Manually grabbed with IDA
#define PTRN_SV_BOTALLOCATECLIENT "\x55\x53\x48\x83\xEC\x08\x48\x8B\x05\xCB\xFE\x13"
#define MASK_SV_BOTALLOCATECLIENT "XXXXXXXXXXXX"
#define PTRN_SV_BOTFREECLIENT "\x85\xFF\x53\x89\xFB\x78\x49\x48\x8B\x05\x1A\xFE\x13"
#define MASK_SV_BOTFREECLIENT "XXXXXXXXXXXX"
#define PTRN_SV_FRAME "\x55\x53\x48\x83\xEC\x18\x48\x8B\x05\xF3\x82\x13"
#define MASK_SV_FRAME "XXXXXXXXXXXX"

// Generated by minfuncfind64. qagame functions.
#define PTRN_G_RUNFRAME "\x8b\x05\x00\x00\x00\x00\x85\xc0\x74\x00\xf3\xc3"
#define MASK_G_RUNFRAME "XX----XXX-XX"
Expand Down Expand Up @@ -94,24 +86,6 @@
#define MASK_G_STARTKAMIKAZE "XXXXXXXXXXXXXX-X----XXX----XXX----XXXXXX-XXX----"
#define PTRN_G_FREEENTITY "\x48\x8b\x05\x00\x00\x00\x00\x53\x48\x89\xfb\x48\x8b\x00\xff\x90\x00\x00\x00\x00\x8b\x83\x00\x00\x00\x00\x85\xc0\x74\x00\x5b\xc3"
#define MASK_G_FREEENTITY "XXX----XXXXXXXXX----XX----XXX-XX"
#define PTRN_SETTEAM "\x41\x57\x41\x56\x41\x55\x41\x54\x49\x89"
#define MASK_SETTEAM "XXXXXXXXXX"
// SetTeam has been split into 2 functions? This gets called from the above.
// #define PTRN_SETTEAM "\x41\x57\x48\xB8\xE1\x83\x0F\x3E\xF8\xE0\x83"
// #define MASK_SETTEAM "XXXXXXXXXXX"
#define PTRN_CLIENTENDFRAME "\x41\x55\x41\x54\x55\x53\x48\x89\xFB\x48\x83\xEC"
#define MASK_CLIENTENDFRAME "XXXXXXXXXXXX"

// em92's flag and respawn
#define PTRN_RESPAWNITEM "\x55\x48\x89\xfd\x53\x48\x83\xec\x00\x48\x83\xbf\xd0\x03\x00\x00\x00\x0f\x84\x00\x00\x00\x00\x48\x8b\x9f\x00\x00\x00\x00\x48\x85\xdb\x0f\x84\x00\x00\x00\x00\x48\x89\xd8\x31\xed\x0f\x1f\x40\x00"
#define MASK_RESPAWNITEM "XXXXXXXX-XXXXX-XXXX----XXX----XXXXX----XXXXXXXX-"
#define PTRN_TEAM_DROPPEDFLAGTHINK "\x48\x8b\x05\x00\x00\x00\x00\x83\x78\x0c\x00\x74\x00\x53\x48\x8b\x87\x00\x00\x00\x00\xbb\x00\x00\x00\x00\x8b\x40\x00\x83\xf8\x00\x74\x00\x31\xdb\x83\xf8\x00\x0f\x94\xc3\x01\xdb\x89\xdf"
#define MASK_TEAM_DROPPEDFLAGTHINK "XXX----XXX-X-XXXX----X----XX-XX-X-XXXX-XXXXXXX"
#define PTRN_TEAM_TOUCHENEMYFLAG "\x41\x57\x41\x56\x41\x55\x41\x54\x55\x53\x48\x89\xf3\x48\x83\xec\x00\x48\x8b\x2d\x00\x00\x00\x00\x4c\x8b\xae\x00\x00\x00\x00\x8b\x85\x00\x00\x00\x00\x85\xc0\x0f\x85\x00\x00\x00\x00"
#define MASK_TEAM_TOUCHENEMYFLAG "XXXXXXXXXXXXXXXX-XXX----XXX----XX----XXXX----"
#define PTRN_TEAM_TOUCHOURFLAG "\x41\x57\x41\x56\x41\x55\x41\x54\x55\x53\x48\x89\xf3\x48\x83\xec\x00\x48\x8b\x2d\x00\x00\x00\x00\x4c\x8b\xa6\x00\x00\x00\x00\x44\x8b\x8d\x00\x00\x00\x00\x4c\x8b\x55\x00\x45\x85\xc9"
#define MASK_TEAM_TOUCHOURFLAG "XXXXXXXXXXXXXXXX-XXX----XXX----XXX----XXX-XXX"


// Functions without patterns.
#define OFFSET_RELP_CMD_ARGC ((pint)SV_Map_f + 0x81)
Expand Down

0 comments on commit 68db595

Please sign in to comment.