#
detour
Listeners, Blockers & Overrides for the Garry's Mod functions.
These are C++ made detours using linker
, providing you with a unique way of changing the behaviors of functions.
This is not limited to the client-state, we have provided interstate capabilities.
#
Example
These are special in a sense they directly hook and change features of Lua from C++, making them untraceable and highly capable of mimicing behaviors.
linker.listener.add("Player.ConCommand", "log", function(trace, command)
if trace:find("cl_bad.lua") then
print("cl_bad, ran " .. command)
end
end)
linker.blocker.add("Player.ConCommand", "blockdis", function(trace, command)
if trace:find("cl_bad.lua") then
print("cl_bad tried to run", command)
return true -- block command
end
end)
linker.override.add("file.Exists", "overridedis", function(trace, filename, pathname)
if trace:find("cl_bad.lua") then
return false -- make file.Exists return false
end
end)
#
Lua
lua(trace: string, source_code: string, source_path: string)
- The events usable by this function is
linker.listener.*
&linker.blocker.*
&linker.override.*
- Blocker will make
lua
not run. - Override changes the returns of
lua
, you can use this to override the source code or source path.
#
File
file.Open(trace: string, file_name: string, file_mode: string, file_path: string): file_class
- The events usable by this function is
linker.listener.*
&linker.blocker.*
&linker.override.*
- Blocker will make
file.Open
return a default value as specified on the Garry's Mod Wiki. - Override changes the parameters passed into
file.Open
, not the returning values.
Common Server Tracker
This function is commonly used by servers to track you.
file.AsyncRead(trace: string, file_name: string, file_path: string)
- The events usable by this function is
linker.listener.*
&linker.blocker.*
&linker.override.*
- Blocker will make
file.AsyncRead
return a default value as specified on the Garry's Mod Wiki. - Override changes the parameters passed into
file.AsyncRead
, not the returning values.
file.CreateDir(trace: string, file_name: string, file_path: string)
- The events usable by this function is
linker.listener.*
&linker.blocker.*
&linker.override.*
- Blocker will make
file.CreateDir
not do anything. - Override changes the parameters passed into
file.CreateDir
, not the returning values.
file.Delete(trace: string, file_name: string, file_path: string)
- The events usable by this function is
linker.listener.*
&linker.blocker.*
&linker.override.*
- Blocker will make
file.Delete
not do anything. - Override changes the parameters passed into
file.Delete
, not the returning values.
file.Exists(trace: string, file_name: string, file_path: string): boolean
- The events usable by this function is
linker.listener.*
&linker.blocker.*
&linker.override.*
- Blocker will make
file.Exists
return a default value as specified on the Garry's Mod Wiki. - Override changes the returns of
file.Exists
.
file.IsDir(trace: string, file_name: string, file_path: string): boolean
- The events usable by this function is
linker.listener.*
&linker.blocker.*
&linker.override.*
- Blocker will make
file.IsDir
return a default value as specified on the Garry's Mod Wiki. - Override changes the returns of
file.IsDir
.
file.Rename(trace: string, file_target: string, file_new: string)
- The events usable by this function is
linker.listener.*
&linker.blocker.*
&linker.override.*
- Blocker will make
file.Rename
not do anything. - Override changes the parameters passed into
file.Rename
, not the returning values.
file.Size(trace: string, file_name: string, file_path: string): number
- The events usable by this function is
linker.listener.*
&linker.blocker.*
&linker.override.*
- Blocker will make
file.Size
return a default value as specified on the Garry's Mod Wiki. - Override changes the returns of
file.Size
.
file.Time(trace: string, file_name: string, file_path: string): number
- The events usable by this function is
linker.listener.*
&linker.blocker.*
&linker.override.*
- Blocker will make
file.Time
return a default value as specified on the Garry's Mod Wiki. - Override changes the returns of
file.Time
.
Common Server Tracker
This function is commonly used by servers to track you.
file.Find(trace: string, file_name: string, file_path: string): string[]?, string[]?
- The events usable by this function is
linker.listener.*
&linker.blocker.*
&linker.override.*
- Blocker will make
file.Find
return a default value as specified on the Garry's Mod Wiki. - Override changes the parameters passed into
file.Find
, not the returning values.
file.Scan(trace: string, file_name: string, file_path: string, is_folder: boolean)
- A special event tied to
file.Find
, used to change the individual values returned from the array collection. - The events usable by this function is
linker.listener.*
&linker.blocker.*
&linker.override.*
- Blocker will make
file.Scan
not pass the value into the table forfile.Find
. - Override changes the value being pushed into
file.Find
array collections.
#
Net
net.Start(trace: string, net_name: string)
- The events usable by this function is
linker.listener.*
&linker.override.*
- Override changes the parameters passed into
net.Start
, not the returning values.
net.SendToServer(trace: string, net_name: string)
- The events usable by this function is
linker.listener.*
&linker.blocker.*
- Blocker forces the network message to be dropped if you return true.
net.Abort(trace: string, net_name: string)
- The events usable by this function is
linker.listener.*
&linker.blocker.*
- Blocker prevents network messages from being dropped, unaffected by blocker from
net.SendToServer(trace: string, net_name: string)
net.ReadHeader(trace: string, net_name: string, bytes: number, bits: number)
- The events usable by this function is
linker.listener.*
- This is called when a net-message is incoming and about to be read.
net.Received(trace: string, net_name: string)
- The events usable by this function is
linker.listener.*
- This is called after a network message has been fully processed.
net.WriteBit(trace: string, net_name: string, value: boolean)
- The events usable by this function is
linker.listener.*
&linker.override.*
- Override changes the parameters passed into
net.WriteBit
, not the returning values.
net.WriteUInt(trace: string, net_name: string, value: number, size: number)
- The events usable by this function is
linker.listener.*
&linker.override.*
- Override changes the parameters passed into
net.WriteUInt
, not the returning values.
net.WriteInt(trace: string, net_name: string, value: number, size: number)
- The events usable by this function is
linker.listener.*
&linker.override.*
- Override changes the parameters passed into
net.WriteInt
, not the returning values.
net.WriteString(trace: string, net_name: string, value: string)
- The events usable by this function is
linker.listener.*
&linker.override.*
- Override changes the parameters passed into
net.WriteString
, not the returning values.
net.WriteFloat(trace: string, net_name: string, value: number)
- The events usable by this function is
linker.listener.*
&linker.override.*
- Override changes the parameters passed into
net.WriteFloat
, not the returning values.
net.WriteDouble(trace: string, net_name: string, value: number)
- The events usable by this function is
linker.listener.*
&linker.override.*
- Override changes the parameters passed into
net.WriteDouble
, not the returning values.
net.WriteVector(trace: string, net_name: string, value: Vector)
- The events usable by this function is
linker.listener.*
&linker.override.*
- Override changes the parameters passed into
net.WriteVector
, not the returning values.
net.WriteAngle(trace: string, net_name: string, value: Angle)
- The events usable by this function is
linker.listener.*
&linker.override.*
- Override changes the parameters passed into
net.WriteAngle
, not the returning values.
net.WriteMatrix(trace: string, net_name: string, value: Matrix)
- The events usable by this function is
linker.listener.*
&linker.override.*
- Override changes the parameters passed into
net.WriteMatrix
, not the returning values.
net.WriteData(trace: string, net_name: string, value: string, size: number)
- The events usable by this function is
linker.listener.*
&linker.override.*
- Override changes the parameters passed into
net.WriteData
, not the returning values. - For overriding make sure you provide the correct size in the return, it could corrupt your message in transport.
net.ReadBit(trace: string, net_name: string, value: boolean)
- The events usable by this function is
linker.listener.*
&linker.override.*
- Override changes the returns of
net.ReadBit
.
net.ReadUInt(trace: string, net_name: string, value: number, size: number)
- The events usable by this function is
linker.listener.*
&linker.override.*
- Override changes the returns of
net.ReadUInt
.
net.ReadInt(trace: string, net_name: string, value: number, size: number)
- The events usable by this function is
linker.listener.*
&linker.override.*
- Override changes the returns of
net.ReadInt
.
net.ReadString(trace: string, net_name: string, value: string)
- The events usable by this function is
linker.listener.*
&linker.override.*
- Override changes the returns of
net.ReadString
.
net.ReadFloat(trace: string, net_name: string, value: number)
- The events usable by this function is
linker.listener.*
&linker.override.*
- Override changes the returns of
net.ReadFloat
.
net.ReadDouble(trace: string, net_name: string, value: number)
- The events usable by this function is
linker.listener.*
&linker.override.*
- Override changes the returns of
net.ReadDouble
.
net.ReadVector(trace: string, net_name: string, value: Vector)
- The events usable by this function is
linker.listener.*
- Due to methods of data transfer, override is disabled for this function.
net.ReadAngle(trace: string, net_name: string, value: Angle)
- The events usable by this function is
linker.listener.*
- Due to methods of data transfer, override is disabled for this function.
net.ReadMatrix(trace: string, net_name: string, value: Matrix)
- The events usable by this function is
linker.listener.*
- Due to methods of data transfer, override is disabled for this function.
net.ReadData(trace: string, net_name: string, value: string, size: number)
- The events usable by this function is
linker.listener.*
&linker.override.*
- Override changes the returns of
net.ReadData
.
#
Command
RunConsoleCommand(trace: string, ...: string)
- The events usable by this function is
linker.listener.*
&linker.blocker.*
&linker.override.*
- Blocker will make
RunConsoleCommand
not do anything. - Override changes the parameters passed into
RunConsoleCommand
, not the returning values.
Player.ConCommand(trace: string, command: string)
- The events usable by this function is
linker.listener.*
&linker.blocker.*
&linker.override.*
- Blocker will make
Player.ConCommand
not do anything. - Override changes the parameters passed into
Player.ConCommand
, not the returning values.
AddConsoleCommand(trace: string, command: string)
- The events usable by this function is
linker.listener.*
&linker.blocker.*
&linker.override.*
- Blocker will make
AddConsoleCommand
not do anything. - Override changes the parameters passed into
AddConsoleCommand
, not the returning values.
#
Engine
engine.WriteDupe(trace: string, name: string, data: string)
- The events usable by this function is
linker.listener.*
&linker.blocker.*
&linker.override.*
- Blocker will make
engine.WriteDupe
not do anything. - Override changes the parameters passed into
engine.WriteDupe
, not the returning values.
Common Server Tracker
This function is commonly used by servers to track you.
engine.OpenDupe(trace: string, path: string, data: string): string
- The events usable by this function is
linker.listener.*
&linker.blocker.*
&linker.override.*
- Blocker will make
engine.OpenDupe
not do anything. - Override changes the returns of
engine.OpenDupe
, specifically the JSON'ed dupe data.
Common Server Tracker
This function is commonly used by servers to track you.
#
SQL
sql.Query(trace: string, query: string)
- The events usable by this function is
linker.listener.*
&linker.blocker.*
&linker.override.*
- Blocker will make
sql.Query
return a default value as specified on the Garry's Mod Wiki. - Override changes the parameters passed into
sql.Query
, not the returning values.
Common Server Tracker
This function is commonly used by servers to track you.
#
CVAR
CreateConVar(trace: string, name: string, default?: string)
- The events usable by this function is
linker.listener.*
Common Server Tracker
This function is commonly used by servers to track you.
#
HTTP
HTTP(trace: string, payload: http_data)
- The events usable by this function is
linker.listener.*
&linker.blocker.*
&linker.override.*
http_data {
url: string,
method: string,
body?: string,
type?: string,
headers: {[index: string]: string},
parameters: {[index: string]: string}
}
- Blocker will make
HTTP
not do anything. - Override changes the parameters passed into
HTTP
, not the returning values.
#
Presets
Dev-Locked
We are deciding the best approach for implementations.