Skip to content

address

This class is only active if MEM_ADDRESS is used in a read function. Lua does not naturally allow you to add or subtract from userdata. This class is designed to let you do so. If you pass this class to a read or write function, it will automatically get the address field and convert it.

address

Type

userdata


add

Type

function

Parameters

  • number/userdata

Returns

  • address

subtract

Type

function

Parameters

  • number/userdata

Returns

  • address

get

Type

function

Returns

  • userdata address

read

Type

function

Parameters

  • MEM_ type
  • number address
  • number size (only if MEM_STRING specified)

Returns

  • MEM_ value

Example

Lua
1
2
3
4
5
-- read (localplayer + C_CSPlayerPawn -> m_aimPunchCache) schema, which leads to a pointer
local punch_cache = localplayer:read(MEM_ADDRESS, valve_source2:get_schema("C_CSPlayerPawn", "m_aimPunchCache") + 0x8)

-- read values as a vector
local punch = punch_cache:read( MEM_VECTOR, 0 )

write

Type

function

Description

This method does not allow you to write memory to blacklisted games. This restriction cannot be removed. Any game that is officially supported by constelia.ai (fantasy.cat) is considered blacklisted (CS, TF2, etc). This restriction is applied on both FC2 Windows and FC2 Linux.

Parameters

  • MEM_ type
  • number address
  • number/string value
  • number size (only if MEM_STRING specified)

Returns

  • MEM_ value

new

Type

function

Description

Creates a new address class.

Parameters

  • number/userdata address

Returns

  • address

is_valid

Type

function

Returns

  • boolean

lshift

Type

function

Description

Equivalent to bit.lshift(x, address)

Parameters

  • number

Returns

  • number

rshift

Type

function

Description

Equivalent to bit.rshift(x, address)

Parameters

  • number

Returns

  • number

band

Type

function

Description

Equivalent to bit.band(address, x)

Parameters

  • number

Returns

  • number

bor

Type

function

Description

Equivalent to bit.bor(address, x)

Parameters

  • number

Returns

  • number

is_zero

Type

function

Description

Not the same as is_valid as that function checks for an invalid pointer value rather than if the pointer is 0. This directly checks if the address is 0.

Returns

  • boolean