โš™๏ธutils

Usage:

utils.{function}

This table exposes various utility functions.


base64_encode๏ปฟ

Function

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๏ปฟ

Function

Decode Base64-encoded string.

Arguments

Name

Type

Description

str

string

Base64-encoded string.

Returns

Type

Description

string

Source string.

Example


get_unix_time๏ปฟ

Function

Returns current time as UNIX timestamp.

Arguments

None.

Returns

Type

Description

int

Timestamp.

Example


murmur2๏ปฟ

Function

Returns MURMUR2-hashed string.

Arguments

Name

Type

Description

str

string

Source string.

Returns

Type

Description

int

Hash.

Example


fnv1a๏ปฟ

Function

Returns FNV1A-hashed string.

Arguments

Name

Type

Description

str

string

Source string.

Returns

Type

Description

int

Hash.

Example


find_export๏ปฟ

FunctionInsecure only

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


find_pattern๏ปฟ

FunctionInsecure only

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


clipboard_get๏ปฟ

FunctionInsecure only

Returns current clipboard content.

Arguments

None.

Returns

Type

Description

string

Clipboard content.

Example


clipboard_set๏ปฟ

FunctionInsecure only

Sets new clipboard content.

Arguments

Name

Type

Description

str

string

New content.

Returns

Nothing.

Example


array_to_string

Function

Converts an array of bytes into a string.

Arguments

Name

Type

Description

bytes

table

Array of bytes

Returns

Type

Description

string

The converted string

Example


string_to_array

Function

Converts a string into an array of bytes (ASCII representation).

Arguments

Name

Type

Description

str

string

Text to be converted

Returns

Type

Description

table

The converted table

Example


json_encode

Function

Encodes a lua table into JSON.

Arguments

Name

Type

Description

obj

table

Table to be converted

Returns

Type

Description

string

The JSON-encoded string

Example


json_decode

Function

Decodes a JSON string into a Lua table.

Arguments

Name

Type

Description

str

string

The JSON string

Returns

Type

Description

table

The decoded JSON object

Example


file_exists

Function

Returns whether a file exists or not. It is relative to your game/csgo folder.

Arguments

Name

Type

Description

path

string

Path to the file.

Returns

Type

Description

boolean

Whether the file exists or not

Example


file_read

Function

Reads the contents of a file. It is relative to your game/csgo folder.

Arguments

Name

Type

Description

path

string

Path to the file.

Returns

Type

Description

table<number>

Contents of the file, in bytes

Example


file_write

Function

Writes any contents to a file. It is relative to your game/csgo folder.

Arguments

Name

Type

Description

path

string

Path to the file.

contents

table<number>

Contents of the file, in bytes

Returns

Nothing.

Example

Last updated