angr.go.analyses.package_variables

Type package-level variables from their initializers.

Constant-initialized variables live in .data and need no code, so everything a package initializer (pkg.init, pkg.init.N) and main.main store into a global is a computed value whose shape names its type: a runtime type descriptor or itab word followed by a data word (an interface), an allocator result (newobject -> *T, makeslice -> []T, makemap -> map[K]V), a read-only pointer plus a length (string), a static funcval (a func), or the result registers of a call with a known Go signature. The scan works on raw AIL with a per-register environment; no SSA or simplification is needed.

angr.go.analyses.package_variables.initializer_package(name)

The package of an initializer (pkg.init, pkg.init.N, main.main); None for anything else.

Return type:

str | None

Parameters:

name (str)

angr.go.analyses.package_variables.infer_package_variables(project, on_initializer=None)

Package-level variables typed from the stores in the binary’s initializers, named pkg.var_N.

Return type:

list[GoVariable]

Parameters: