Skip to main content
The CallSiteTable object provides access to information about a specific function call site, including the caller context, function parameters, and output. It is commonly used in VulHunt rules to analyze call site properties and dataflow.

Fields

FieldDescriptionType
callerThe context of the caller functionCallSiteContext
inputsThe parameters passed to the called functionOperandInfo[]
outputThe output (return value) of the called functionOperandInfo

Reference

caller

Provides access to the context of the caller function.

inputs

A table of OperandInfo objects representing the parameters passed to the called function.

output

An OperandInfo object representing the output (return value) of the called function.

Example

scopes = scope:calls{
  to = "strcpy",
  where = caller:named "target_function",
  using = {parameters = {var:named "input", _, _}},
  with = function(project, context)
    local caller = context.caller
    print("Call to strcpy from:", caller.name, "at address", caller.call_address)

    local src = context.inputs[2]
    if src and src.annotation == "input" then
      print("The source parameter is tainted with 'input'")
    end

    local ret = context.output
    -- Do something with the return value if needed
  end
}