OpenCoD2-Plus
Call of Duty 2 client & server, rebuilt
Loading...
Searching...
No Matches
check_bridge_symbols Namespace Reference

Functions

 labels (paths)
 symbol_types (nm, executable)
 main ()

Variables

 LABEL = re.compile(r'__asm__\(COD2_SYM\("(\w+)"\‍)\‍)')

Detailed Description

Lists the engine symbols a bridge import calls that are not code.

    python3 scripts/check_bridge_symbols.py <executable> <bridge.cpp>... [--nm NM] [--prefix _]

Each import of a generated bridge (src/compat/*_imports.cpp) calls the engine's
C symbol through an extern "C" declaration with an __asm__ label. When the
engine has no such function but a variable of that name (LittleLong, a function
pointer in q_shared.c, whose blob defines the data symbol), the call links and
jumps into data. For each label, the executable's symbol must be code (T, t or
W). Exits with 0 when all are.

Function Documentation

◆ labels()

check_bridge_symbols.labels ( paths)
The labels of the import declarations (cod2c_*), whatever their
parameters (function pointers and arrays have parentheses too).

◆ main()

check_bridge_symbols.main ( )

◆ symbol_types()

check_bridge_symbols.symbol_types ( nm,
executable )
{name: type letters} of the executable's defined symbols.

Variable Documentation

◆ LABEL

check_bridge_symbols.LABEL = re.compile(r'__asm__\(COD2_SYM\("(\w+)"\‍)\‍)')