FrameScriptRegisterFunction
function · ui · orchestration
- Address
0x704120· 55 bytes, up to0x704156- Signature
void __fastcall (const char *name, int (*fn)(lua_State *))- Meaning
- Sets the global of a name to a C closure of a function with no upvalues
- 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 54
- LoadSoundScriptFunctions sound
- RegisterGlueScriptFunctions glue
- RegisterRealmListScriptFunctions glue
- RegisterCreateScriptFunctions glue
- RegisterCharSelectScriptFunctions glue
- CGGameUI::RegisterScriptFunctions ui
- RegisterChatScriptFunctions ui
- RegisterWorldMapFunctions ui
- RegisterBattlefieldFunctions ui
- RegisterMailFunctions ui
- RegisterSpellBookFunctions ui
- RegisterTutorialFunctions ui
- RegisterBindingFunctions ui
- RegisterRaidFunctions ui
- RegisterPetFunctions ui
- RegisterTradeFunctions ui
- RegisterLootFunctions ui
- RegisterLotteryFunctions ui
- RegisterMinigameFunctions ui
- RegisterWorldStateFunctions ui
- RegisterInventoryFunctions ui
- RegisterMeetingStoneFunctions ui
- RegisterStableFunctions ui
- RegisterAuctionFunctions ui
- RegisterGuildFunctions ui
- RegisterSkillFunctions ui
- RegisterDuelFunctions ui
- RegisterReputationFunctions ui
- RegisterTrainerFunctions ui
- RegisterTaxiFunctions ui
- RegisterQuestLogFunctions ui
- RegisterGossipFunctions ui
- RegisterItemTextFunctions ui
- RegisterBuffFunctions ui
- RegisterActionFunctions ui
- RegisterPartyFunctions ui
- RegisterMacroFunctions ui
- RegisterTalentFunctions ui
- RegisterPetitionFunctions ui
- RegisterGuildRegistrarFunctions ui
- RegisterTabardFunctions ui
- RegisterCraftFunctions ui
- RegisterBankFunctions ui
- RegisterContainerFunctions ui
- RegisterMerchantFunctions ui
- RegisterTradeSkillFunctions ui
- RegisterQuestFunctions ui
- RegisterCameraScriptFunctions uicamera
- RegisterInputScriptFunctions input
- LoadGameScriptFunctions ui
- RegisterUnitFunctions ui
- RegisterSocialScriptFunctions net
- RegisterSpellTargetingScripts spell
- LoadFrameScriptFunctions ui
Callees 5
- lua_insert lua
- lua_pushstring lua
- lua_pushcclosure lua
- lua_settable lua
- FrameScript::GetContext ui
Calls and jumps by a bare address, from tables/calls.tsv.