Lua API
  • 🔎Overview
  • Introduction
    • 🚀Creating scripts
      • 🧠First Steps
      • 🖥️Adding UI
      • 📚Creating Libraries
  • API
    • 🌐Global Functions
    • ⚙️Instances
      • 🔢Math
      • ☎️Events
        • event_t
      • 🎮Game
        • global_vars_t
        • cengine_client
          • cnet_chan
        • ccsgo_input
        • cinput_system
        • cgame_ui_funcs
        • ccvar
          • convar
      • 🕹️Mods
        • events_t
      • ✏️Draw
        • ⚙️Types
          • ⚙️rect
          • ⚙️vec2
          • ⚙️color
          • ⚙️accessor
        • 🖥️Adapter
        • ✏️Layer
          • outline_mode
          • rounding
          • glow_parts
          • text_params
            • text_alignment
          • shadow_dir
          • command
            • render_mode
        • 🖼️Managed
          • 🖼️texture
            • svg_texture
            • animated_texture
          • 🖼️shader
          • ™️font_base
            • font
            • font_gdi
            • glyph_t
            • font_flags
      • 🙋Entities
        • entity_list_t
          • entity_entry_t
        • base_entity
          • schema_accessor_t
          • cs2_weapon_base_gun
          • cs2_player_pawn
          • cs2_player_controller
          • cs2_weapon_base
          • cs2_grenade_projectile
        • ccsweapon_base_vdata
          • cfiring_mode
        • chandle
        • csweapon_mode
        • csweapon_type
        • weapon_id
        • csweapon_category
        • observer_mode_t
      • 🖥️Gui
        • ⚙️Types
          • ⚙️bits
          • ⚙️control_id
        • context
          • user_t
        • context_input
          • mouse_button
        • notification_system
          • notification
        • control
          • control_type
          • value_param
          • checkbox
          • slider
          • label
          • selectable
          • button
          • color_picker
          • spacer
          • text_input
          • combo_box
          • image
        • container
          • control_container
            • layout
            • group
      • ⚙️Utils
    • ⚙️Types
      • ⚙️ptr
      • ⚙️ref_holder_t
      • ⚙️vector
      • ⚙️vector4d
      • 🎮veccolor
      • 🎮color
      • 🎮cview_setup
      • 🎮cuser_cmd
      • 🎮game_event_t
    • 🟰Enums
      • 🟰client_frame_stage
      • 🟰input_bit_mask
Powered by GitBook

© 2025 - FATALITY

On this page
  • base64_encode
  • base64_decode
  • get_unix_time
  • murmur2
  • fnv1a
  • find_export
  • find_pattern
  • clipboard_get
  • clipboard_set
Export as PDF
  1. API
  2. Instances

Utils

Usage: utils.{function}

This table exposes various utility functions.


base64_encode

Encode a string to Base64 format.

Arguments

Name

Type

Description

str

string

Source string.

Returns

Type

Description

string

Base64-encoded string.

Example

local enc = utils.base64_encode('Hello!'); -- SGVsbG8h

base64_decode

Decode Base64-encoded string.

Arguments

Name

Type

Description

str

string

Base64-encoded string.

Returns

Type

Description

string

Source string.

Example

local dec = utils.base64_decode('SGVsbG8h'); -- Hello!

get_unix_time

Returns current time as UNIX timestamp.

Arguments

None.

Returns

Type

Description

int

Timestamp.

Example

local ts = utils.get_unix_time();

murmur2

Returns MURMUR2-hashed string.

Arguments

Name

Type

Description

str

string

Source string.

Returns

Type

Description

int

Hash.

Example

local hash = utils.murmur2('Hello');

fnv1a

Returns FNV1A-hashed string.

Arguments

Name

Type

Description

str

string

Source string.

Returns

Type

Description

int

Hash.

Example

local hash = utils.fnv1a('Hello');

find_export

Returns an address to an export in an image.

Arguments

Name

Type

Description

mod

string

Image to look in.

exp

string

Export symbol.

Returns

Type

Description

int

Address, or 0 on failure.

Example

local message_box = utils.find_export('user32.dll', 'MessageBoxA');

find_pattern

Searches for a code pattern in an image.

Arguments

Name

Type

Description

mod

string

Image to search in.

pattern

string

Code pattern.

Returns

Type

Description

int

Address, or 0 on failure.

Example

local something = utils.find_pattern('engine2.dll', 'DE AD ? ? ? ? BE EF');

clipboard_get

Returns current clipboard content.

Arguments

None.

Returns

Type

Description

string

Clipboard content.

Example

local clip = utils.clipboard_get();

clipboard_set

Sets new clipboard content.

Arguments

Name

Type

Description

str

string

New content.

Returns

Nothing.

Example

utils.clipboard_set('Hello!');
PreviousgroupNextTypes

Last updated 3 months ago

⚙️
⚙️