CheckFunctionPointer
function · os
- Address
0x42a320· 86 bytes, up to0x42a375- Meaning
- Stops the client with Invalid function pointer when an address lies outside the exe .text section
- Confidence
- verified, proof two
- Finding
- ui/luastate#the-c-function-contract
Finding: The C function contract in ui: the Lua state, its library and C functions
Every C function the client registers is int __fastcall f(lua_State *L) that answers its result
count. Registering sets the global of the name to a closure with no upvalues. Before the VM calls
any C function, 0x42a320 checks that its address lies in the exe's .text section and stops the
client with Invalid function pointer: %p otherwise. Arguments are read by index. An absent one has
the type none, −1, not nil, so a function that tests the type against nil's 0 tells the two apart:
glue's GetAddOnEnableState raises its usage for an absent first argument and accepts an explicit
nil. A Usage: failure calls luaL_error, which never returns: the error unwinds to the enclosing
protected call.
The derivation is in the doc.
Callers 5
- ConsoleCommandExecute console
- CVar::Set cvar
- luaD_rawrunprotected lua
- luaD_callhook lua
- luaD_precall lua
Callees 3
- FindTextSection os
- SStrPrintf storm
- SErrDisplayAppFatal storm
Calls and jumps by a bare address, from tables/calls.tsv.