hook

The hook namespace contains functions that directly interact with daochook.

Functions exposed by this namespace are accessed via the prefix: hook.

Functions

get_hook_path

Returns the path to where daochook is installed.

1string hook.get_hook_path();
Parameter NameTypeDescription
None.
Returns
(string) The path where daochook is installed.

get_hook_base

Returns the base address of daochook in the current process.

1number hook.get_hook_base();
Parameter NameTypeDescription
None.
Returns
(number) The base address of daochook in the current process.

get_game_path

Returns the path to where the game client is installed.

1string hook.get_game_path();
Parameter NameTypeDescription
None.
Returns
(string) The path where the game client is installed.

get_game_base

Returns the base address of game.dll in the current process.

1number hook.get_game_base();
Parameter NameTypeDescription
None.
Returns
(number) The base address of the game.dll module in the current process.

get_game_size

Returns the size of the game.dll module.

1number hook.get_game_size();
Parameter NameTypeDescription
None.
Returns
(number) The size of the game.dll module.

get_game_hwnd

Returns the window handle of the main game window.

1number hook.get_game_hwnd();
Parameter NameTypeDescription
None.
Returns
(number) The window handle of main game window.

get_d3d9

Returns the games IDirect3D9* device pointer.

1userdata hook.get_d3d9();
Parameter NameTypeDescription
None.
Returns
(userdata) The games IDirect3D9* device pointer.

get_d3d9dev

Returns the games IDirect3DDevice9* device pointer.

1userdata hook.get_d3d9dev();
Parameter NameTypeDescription
None.
Returns
(userdata) The games IDirect3DDevice9* device pointer.

get_use_ambient_override

Returns the current state of the ambient override feature.

1boolean hook.get_use_ambient_override();
Parameter NameTypeDescription
None.
Returns
(boolean) The current state of the feature.

set_use_ambient_override

Sets the ambient override feature on or off.

1hook.set_use_ambient_override(flag);
Parameter NameTypeDescription
flagbooleanFlag that states if the feature should be enabled or disabled.
Returns
None.

get_ambient_color

Returns the ambient color override value.

1number hook.get_ambient_color();
Parameter NameTypeDescription
None.
Returns
(number) The ambient color that will be used when the feature is enabled.

set_ambient_color

Sets the ambient color value to be used when the ambient color override feature is enabled.

1hook.set_ambient_color(r, g, b);
Parameter NameTypeDescription
rnumberThe red color amount. (0 to 255)
gnumberThe green color amount. (0 to 255)
bnumberThe blue color amount. (0 to 255)
Returns
None.

get_use_fillmode_override

Returns the current state of the fillmode override feature.

1boolean hook.get_use_fillmode_override();
Parameter NameTypeDescription
None.
Returns
(boolean) The current state of the feature.

set_use_fillmode_override

Sets the fillmode override feature on or off.

1hook.set_use_fillmode_override(flag);
Parameter NameTypeDescription
flagbooleanFlag that states if the feature should be enabled or disabled.
Returns
None.

get_use_fog_override

Returns the current state of the fog override feature.

1boolean hook.get_use_fog_override();
Parameter NameTypeDescription
None.
Returns
(boolean) The current state of the feature.

set_use_fog_override

Sets the fog override feature on or off.

1hook.set_use_fog_override(flag);
Parameter NameTypeDescription
flagbooleanFlag that states if the feature should be enabled or disabled.
Returns
None.

get_use_zbuffer_override

Returns the current state of the zbuffer override feature.

1boolean hook.get_use_zbuffer_override();
Parameter NameTypeDescription
None.
Returns
(boolean) The current state of the feature.

set_use_zbuffer_override

Sets the zbuffer override feature on or off.

1hook.set_use_zbuffer_override(flag);
Parameter NameTypeDescription
flagbooleanFlag that states if the feature should be enabled or disabled.
Returns
None.

Configuration Manager

Functions exposed for this manager are accessed via the prefix: hook.cfg.

load

Loads a configuration file into the cache.

1boolean hook.cfg.load(alias, file);
Parameter NameTypeDescription
aliasstringThe configuration cache alias.
filestringThe file path to the configurations.
Returns
(boolean) True on success, false otherwise.

save

Saves a configuration cache block to a file.

1boolean hook.cfg.save(alias);
2boolean hook.cfg.save(alias, file);
Parameter NameTypeDescription
aliasstringThe configuration cache alias.
filestring[Optional] The override file path to save the configurations to.
Returns
(boolean) True on success, false otherwise.

remove

Removes a configuration block from the cache.

1hook.cfg.remove(alias);
Parameter NameTypeDescription
aliasstringThe alias of the configuration cache to remove.
Returns
None.

get_sections

Returns the sections within a configuration block.

1string|nil hook.cfg.get_sections(alias);
Parameter NameTypeDescription
aliasstringThe configuration cache alias.
Returns
(string | nil) String containing the section names on success, nil otherwise.

get_section_keys

Returns the section keys within a configuration section.

1string|nil hook.cfg.get_section_keys(alias, section);
Parameter NameTypeDescription
aliasstringThe configuration cache alias.
sectionstringThe configuration section name.
Returns
(string | nil) String containing the section keys on success, nil otherwise.

get_string

Returns a string value from a configuration.

1string|nil hook.cfg.get_string(alias, section, key);
Parameter NameTypeDescription
aliasstringThe configuration cache alias.
sectionstringThe configuration section name.
keystringThe configuration key.
Returns
(string) The configuration value on success, nil otherwise.

set_value

Sets a configuration value.

1hook.cfg.set_value(alias, section, key, value);
Parameter NameTypeDescription
aliasstringThe configuration cache alias.
sectionstringThe configuration section name.
keystringThe configuration key.
valuestringThe value to set.
Returns
None.

get_values

Returns a configuration files values.

1table|nil hook.cfg.get_values(alias);
Parameter NameTypeDescription
aliasstringThe configuration cache alias.
Returns
(table | nil) Table containing the entire configuration file information on success, nil otherwise.

get_bool

Returns a configuration value (bool)

1boolean hook.cfg.get_bool(alias, section, key, default_value);
Parameter NameTypeDescription
aliasstringThe configuration cache alias.
sectionstringThe section that owns the desired value.
keystringThe key of the value to obtain.
default_valuebooleanThe default value to use if the given key does not exist.
Returns
(boolean) The configuration value on success, default_value otherwise.

get_uint8

Returns a configuration value (uint8)

1number hook.cfg.get_uint8(alias, section, key, default_value);
Parameter NameTypeDescription
aliasstringThe configuration cache alias.
sectionstringThe section that owns the desired value.
keystringThe key of the value to obtain.
default_valuenumberThe default value to use if the given key does not exist.
Returns
(number) The configuration value on success, default_value otherwise.

get_uint16

Returns a configuration value (uint16)

1number hook.cfg.get_uint16(alias, section, key, default_value);
Parameter NameTypeDescription
aliasstringThe configuration cache alias.
sectionstringThe section that owns the desired value.
keystringThe key of the value to obtain.
default_valuenumberThe default value to use if the given key does not exist.
Returns
(number) The configuration value on success, default_value otherwise.

get_uint32

Returns a configuration value (uint32)

1number hook.cfg.get_uint32(alias, section, key, default_value);
Parameter NameTypeDescription
aliasstringThe configuration cache alias.
sectionstringThe section that owns the desired value.
keystringThe key of the value to obtain.
default_valuenumberThe default value to use if the given key does not exist.
Returns
(number) The configuration value on success, default_value otherwise.

get_uint64

Returns a configuration value (uint64)

1number hook.cfg.get_uint64(alias, section, key, default_value);
Parameter NameTypeDescription
aliasstringThe configuration cache alias.
sectionstringThe section that owns the desired value.
keystringThe key of the value to obtain.
default_valuenumberThe default value to use if the given key does not exist.
Returns
(number) The configuration value on success, default_value otherwise.

get_int8

Returns a configuration value (int8)

1number hook.cfg.get_int8(alias, section, key, default_value);
Parameter NameTypeDescription
aliasstringThe configuration cache alias.
sectionstringThe section that owns the desired value.
keystringThe key of the value to obtain.
default_valuenumberThe default value to use if the given key does not exist.
Returns
(number) The configuration value on success, default_value otherwise.

get_int16

Returns a configuration value (int16)

1number hook.cfg.get_int16(alias, section, key, default_value);
Parameter NameTypeDescription
aliasstringThe configuration cache alias.
sectionstringThe section that owns the desired value.
keystringThe key of the value to obtain.
default_valuenumberThe default value to use if the given key does not exist.
Returns
(number) The configuration value on success, default_value otherwise.

get_int32

Returns a configuration value (int32)

1number hook.cfg.get_int32(alias, section, key, default_value);
Parameter NameTypeDescription
aliasstringThe configuration cache alias.
sectionstringThe section that owns the desired value.
keystringThe key of the value to obtain.
default_valuenumberThe default value to use if the given key does not exist.
Returns
(number) The configuration value on success, default_value otherwise.

get_int64

Returns a configuration value (int64)

1number hook.cfg.get_int64(alias, section, key, default_value);
Parameter NameTypeDescription
aliasstringThe configuration cache alias.
sectionstringThe section that owns the desired value.
keystringThe key of the value to obtain.
default_valuenumberThe default value to use if the given key does not exist.
Returns
(number) The configuration value on success, default_value otherwise.

get_float

Returns a configuration value (float)

1number hook.cfg.get_float(alias, section, key, default_value);
Parameter NameTypeDescription
aliasstringThe configuration cache alias.
sectionstringThe section that owns the desired value.
keystringThe key of the value to obtain.
default_valuenumberThe default value to use if the given key does not exist.
Returns
(number) The configuration value on success, default_value otherwise.

get_double

Returns a configuration value (double)

1number hook.cfg.get_double(alias, section, key, default_value);
Parameter NameTypeDescription
aliasstringThe configuration cache alias.
sectionstringThe section that owns the desired value.
keystringThe key of the value to obtain.
default_valuenumberThe default value to use if the given key does not exist.
Returns
(number) The configuration value on success, default_value otherwise.

Pointer Manager

Functions exposed for this manager are accessed via the prefix: hook.pointers.

load

Loads a file that contains pointer related configurations into the pointer cache.

1boolean hook.pointers.load(file);
Parameter NameTypeDescription
filestringThe file path to the configurations.
Returns
(boolean) True on success, false otherwise.

add

Adds a pointer to the pointer cache.

1number hook.pointers.add(name, pointer);
Parameter NameTypeDescription
namestringThe name of the pointer.
pointernumberThe existing pointer value.
Returns
(number) The pointer value passed in pointer.
1number hook.pointers.add(name, module_name, pattern, offset, count);
Parameter NameTypeDescription
namestringThe name of the pointer.
module_namestringThe name of the module to scan for the pointer within.
patternstringThe pattern of data to scan for.
offsetnumberThe offset to add to the address where the pattern was found.
countnumberThe count of the result to use if the pattern is found more than once.
Returns
(number) The pointer value passed in pointer.

get

Returns a pointer from the pointer cache.

1number hook.pointers.get(name);
Parameter NameTypeDescription
namestringThe name of the pointer.
Returns
(number) The pointer value if valid, 0 otherwise.