Skip to main content
The CallSiteContext object provides information about a specific function call site in the binary. It is used to access details such as the caller function, call address, and address properties.

Fields

FieldDescriptionType
addressAddress of the caller functionAddressValue
call_addressAddress of the call site within the functionAddressValue
nameName of the caller functionstring
address_bitsNumber of bits in the addressnumber
address_bytesNumber of bytes in the addressnumber

Reference

address

The address of the caller function.

call_address

The address of the call site within the caller function.

name

The name of the caller function.

address_bits

The number of bits used for addresses in the binary.

address_bytes

The number of bytes used for addresses in the binary.

Example

scopes = scope:calls{
  to = "strcpy",
  with = function(project, context)
    local caller = context.caller  -- caller is a CallSiteContext

    print("Call to strcpy found in function:", caller.name)
    print("Caller function address:", caller.address)
    print("Call site address:", caller.call_address)
    print("Address bits:", caller.address_bits)
    print("Address bytes:", caller.address_bytes)
  end
}