Back to legacygamers.net
WARPGATE

Lua

Lua 5.1: C API, VM, GC, parser, code gen, all standard libs, CLuaState, CLuaScript

Functions 689Code 150 KBAddresses 0x00522930 to 0x00E25970Group Library
689 functions
AddressSizeNameDescription
0x00522930101lua_f_Ccalllua_settable(L, idx). Pops key+value from stack, gets table from environment at idx, creates table entry via luaV_settable. Equivalent to t[k]=v where t is at idx, k and v are at top-2 and top-1.
0x005229A024lua_api_f_callHelper that calls luaV_settable with parameters from a pair struct. param_2 points to {key_offset, nresults}. Forwarding wrapper used as callback by lua_settable and lua_pcall internals.
0x005229C0177lua_api_index2adrlua_index2adr(L, idx). Converts a Lua stack index to an actual memory address/TValue pointer. Handles positive indices (from base), negative indices (from top), and pseudo-indices: LUA_GLOBALSINDEX(-10002)=globals table, LUA_REGISTRYINDEX(-10000)=registry, LUA_ENVIRONINDEX(-10001)=current env, upvalue indices (below -10002).
0x00522A8038lua_api_pushvalue_rawLow-level stack push: copies a TValue (3 dwords: value, extra, type tag) from param_2 pointer onto the stack top, then increments stack top by one slot (0x10 bytes).
0x00522AB020lua_api_atpaniclua_sethook(L, hook). Sets the debug hook function pointer at global_State+0x58. Returns the old hook value. Used for Lua debug hooks (call/return/line/count).
0x00522AD057lua_api_calllua_settop / lua_pop variant. Adjusts stack top by removing param_2 elements. If param_3 == -1, also updates the high water mark (ci->top). Calls luaV_settable internally for protected adjustments.
0x00522B10106lua_api_checkstacklua_checkstack(L, extra). Ensures at least 'extra' free stack slots. Returns 0 if would exceed 8000 total slots (LUAI_MAXCSTACK). Grows stack via luaD_growstack if needed. Updates ci->top high water mark.
0x00522B80117lua_api_concatlua_concat(L, n). Concatenates n values at the top of the stack. If n>=2, calls luaV_concat and adjusts stack. If n==0, pushes empty string. If n==1, does nothing. Checks GC threshold before proceeding.
0x00522C0052lua_api_cpcalllua_setfield(L, idx, name). Sets a table field: t[name] = value at stack top. Packs idx and name into local struct, calls luaD_pcall with lua_api_settable as the callback. Pops the value from stack.
0x00522C4063lua_api_createtablelua_createtable(L, narray, nhash). Creates a new empty table with pre-allocated array and hash parts, pushes it onto the stack with type tag 5 (LUA_TTABLE). Checks GC threshold first.
0x00522C8053lua_api_dumpLightweight lua_pcall for Lua closures only. Checks that top-of-stack is type 6 (LUA_TFUNCTION) and that the closure is a Lua function (not C). If so, calls luaD_call. Returns 1 on error/not-applicable, 0 on success. Used for fast-path protected calls.
0x00522CC084lua_api_equallua_equal(L, idx1, idx2). Compares two stack values for equality. Converts both indices to addresses via index2adr, checks they are valid and have matching type tags, then calls luaV_equalobj for deep comparison. Returns 1 if equal, 0 otherwise.
0x00522D2018lua_api_errorlua_error(L). Signals an error using the value at top of stack as the error object. Calls luaG_errormsg which does a longjmp. Always returns 0 (never actually reached).
0x00522D40214lua_api_gclua_gc(L, what, data). Controls the garbage collector. what: 0=stop, 1=restart, 2=full collect, 3=get count KB, 4=get count bytes, 5=step, 6=set pause, 7=set stepmul. Returns status or old value depending on command.
0x00522E4040lua_api_getallocflua_getallocf(L, ud). Returns the memory allocator function from the global state. If ud is non-null, also stores the allocator userdata pointer into *ud. Reads from global_State+0x0C and +0x10.
0x00522E70109lua_api_getfenvlua_getfenv(L, idx). Pushes the environment table of the value at idx. For functions (type 6,7): pushes their env table (type 5). For userdata (type 8): pushes the env from the thread. For other types: pushes nil (type 0). Increments stack top.
0x00522EE089lua_api_getfield_00522ee0lua_getfield(L, idx, name). Pushes t[name] onto the stack where t is the table at idx. Creates a temporary TString from the C string name via luaS_newlstr (with strlen), then calls luaV_gettable to perform the lookup. Result pushed at stack top.
0x00522F4084lua_api_getmetatable_00522f40lua_getmetatable(L, idx). Pushes the metatable of the value at idx. For tables (type 5) and userdata (type 7): reads mt from obj+8. For other types: uses the per-type metatable from global_State+0x98. Returns 1 if metatable found, 0 if nil.
0x00522FA037lua_api_gettable_00522fa0lua_gettable(L, idx). Performs t[k] where t is at idx and k is at stack top. Replaces the key at stack top with the result. Calls luaV_gettable internally.
0x00522FD017lua_api_gettop_00522fd0lua_gettop(L). Returns the index of the top element on the stack (number of elements). Computed as (L->top - L->base) >> 4 since each TValue slot is 16 bytes.
0x00522FF0138lua_api_getupvalue_00522ff0lua_getupvalue(L, funcidx, n). Gets the n-th upvalue of a function. If the value at funcidx is a Lua closure (type 6, isC=0), reads from the proto's upvalue table. If C closure (isC!=0), reads upvalue directly from the closure struct. Pushes value and returns upvalue name, or NULL if n is out of range.
0x0052308080lua_api_insert_00523080lua_insert(L, idx). Moves top element into position idx, shifting elements above idx up to make room. Copies the top element to its final position after shifting all elements between idx and top up by one slot.
0x005230D042lua_api_iscfunction_005230d0lua_iscfunction(L, idx). Returns 1 if the value at idx is a C function (type 6 with isC flag set), 0 otherwise.
0x0052310056lua_api_isnumber_00523100lua_isnumber(L, idx). Returns 1 if the value at idx is a number (type 3) or can be converted to a number via luaV_tonumber. Returns 0 otherwise.
0x0052314048lua_api_isstring_00523140lua_isstring(L, idx). Returns 1 if the value at idx is a string (type 4) or a number (type 3, which is convertible to string). Returns 0 for nil/invalid or other types.
0x0052317041lua_api_isuserdata_00523170lua_isuserdata(L, idx). Returns 1 if the value at idx is a full userdata (type 7) or light userdata (type 2). Returns 0 otherwise.
0x005231A067lua_api_lessthan_005231a0lua_lessthan(L, idx1, idx2). Compares two stack values. Converts both indices to addresses via index2adr, validates both are not the nil sentinel, then calls luaV_lessthan for ordered comparison. Returns result or 0 if either is invalid.
0x005231F057lua_api_load_005231f0lua_load(L, reader, data, chunkname). Loads a Lua chunk using the reader function. Initializes a Zio with the reader/data, defaults chunkname to "?" if null, then calls luaD_protectedparser to parse the chunk.
0x0052323055lua_api_newthread_00523230lua_newthread(L). Creates a new Lua thread (coroutine), pushes it onto the stack with type tag 8 (LUA_TTHREAD). Checks GC threshold before allocation.
0x0052327083lua_api_newuserdata_00523270lua_newuserdata(L, size). Allocates a new full userdata of given size, pushes it onto the stack with type tag 7 (LUA_TUSERDATA). Checks GC threshold. Gets environment table from current closure. Returns pointer to the user data block (offset +0x18 from Udata header).
0x005232D057lua_api_next_005232d0lua_next(L, idx). Pops a key from the stack, pushes next key-value pair from the table at idx. Uses luaH_next internally. If there is a next element, pushes key+value (stack grows by +0x10). If no more elements, pops the key (stack shrinks by -0x10).
0x0052331088lua_api_objlen_00523310lua_objlen(L, idx). Returns the "length" of the value at idx. For numbers (type 3): converts to string first then returns string length. For strings (type 4): returns TString length (at obj+0x0C). For tables (type 5): returns luaH_getn (array length). For userdata (type 7): returns size (at obj+0x10). Otherwise returns 0.
0x00523380112lua_api_pcall_00523380lua_pcall(L, nargs, nresults, errfunc). Calls a function in protected mode. If errfunc!=0, converts it to address offset via index2adr. Calls luaD_pcall with the call wrapper. If nresults==-1 (LUA_MULTRET), updates ci->top high water mark.
0x005233F032lua_api_pushboolean_005233f0lua_pushboolean(L, b). Pushes a boolean value onto the stack. Stores (b != 0) as the value with type tag 1 (LUA_TBOOLEAN). Increments stack top by one slot (0x10 bytes).
0x00523410171lua_api_pushcclosure_00523410Lua C API: lua_call. Calls a function on the stack. param_2=nresults, param_3=nargs. Pops function and args, pushes results. Checks GC threshold before call.
0x005234C046lua_api_pushfstring_005234c0Lua C API: lua_pushfstring. Pushes a formatted string onto the stack (variadic). Uses lua_obj_pushvfstring internally. Checks GC threshold.
0x005234F035lua_api_pushinteger_005234f0Lua C API: lua_pushinteger. Pushes an integer onto the stack as a number (type=3/LUA_TNUMBER). Converts int to double.
0x0052352027lua_api_pushlightuserdata_00523520Lua C API: lua_pushlightuserdata. Pushes a light userdata (raw pointer) onto the stack with type=2/LUA_TLIGHTUSERDATA.
0x0052354063lua_api_pushlstring_00523540Lua C API: lua_pushlstring. Pushes a string with explicit length onto the stack. Creates internal Lua string via lua_string_newlstr, type=4/LUA_TSTRING. Checks GC threshold.
0x0052358022lua_api_pushnil_00523580Lua C API: lua_pushnil. Pushes nil onto the stack (type=0/LUA_TNIL). Increments stack top by 0x10.
0x005235A031lua_api_pushnumber_005235a0Lua C API: lua_pushnumber. Pushes a double-precision number onto the stack with type=3/LUA_TNUMBER.
0x005235C0103lua_api_pushstring_005235c0Lua C API: lua_pushstring. Pushes a null-terminated C string onto the stack. If NULL, pushes nil instead. Computes strlen then calls lua_string_newlstr. Checks GC threshold.
0x0052363035lua_api_pushthread_00523630Lua C API: lua_pushthread. Pushes the thread (coroutine) onto its own stack with type=8/LUA_TTHREAD. Returns true (1) if this is the main thread.
0x0052366047lua_api_pushvalue_00523660Lua C API: lua_pushvalue. Copies a stack element at the given index and pushes it onto the top of the stack.
0x0052369045lua_api_pushvfstring_00523690Lua C API: lua_pushvfstring. Pushes a formatted string onto the stack using a va_list. Checks GC threshold before string creation.
0x005236C064lua_api_rawequal_005236c0Lua C API: lua_rawequal. Compares two stack values for raw equality (no metamethods). Returns 0 if either index is invalid (nil sentinel). Uses lua_obj_rawequalobj internally.
0x0052370056lua_api_rawget_00523700Lua C API: lua_rawget. Does a raw table lookup (no metamethods). Takes table at param_2, key at stack top-1. Replaces key with result via lua_table_mainposition_get.
0x0052374057lua_api_rawgeti_00523740Lua C API: lua_rawgeti. Raw table access by integer index. Gets table[param_3] from table at stack index param_2, pushes result. No metamethods.
0x00523780111lua_api_rawset_00523780Lua C API: lua_rawset. Raw table set (no metamethods). Pops key and value from stack, sets table[key]=value. Handles GC write barrier for collectible values.
0x005237F0110lua_api_rawseti_005237f0Lua C API: lua_rawseti. Raw table set by integer index (no metamethods). Pops value from stack and sets table[param_3]=value. Handles GC write barrier.
0x0052386068lua_api_remove_00523860Lua C API: lua_remove. Removes the stack element at the given index, shifting elements above it down by one slot. Decrements stack top.
0x005238B0212lua_api_replace_005238b0Lua C API: lua_replace. Replaces the stack element at the given index with the top element, then pops the top. Special handling for LUA_ENVIRONINDEX (-10001) and LUA_GLOBALSINDEX (-10002). Handles GC write barrier.
0x0052399026lua_api_setallocf_00523990Lua C API: lua_setallocf. Sets the memory allocator function and its userdata in the global state. param_2=allocator function, param_3=allocator userdata.
0x005239B0129lua_api_setfenvLua C API: lua_setfenv. Sets the environment table for a function (type 6/7) or thread (type 8). Pops the table from the stack. Returns 1 on success, 0 if target type is unsupported. Handles GC write barrier.
0x00523A4093lua_api_setfield_00523a40Lua C API: lua_setfield. Sets table[key]=value where key is a C string (param_3) and value is popped from stack top. Table is at stack index param_2. Uses lua_vm_settable internally.
0x00523AA019lua_api_copy_hook_maskLua C API: lua_sethook (partial). Copies the hook mask field (offset 0x34) from one lua_State to another. Used to transfer debug hook settings between threads.
0x00523AC0169lua_api_setmetatable_00523ac0Lua C API: lua_setmetatable. Sets the metatable for the value at stack index param_2. For tables (type 5) and userdata (type 7), sets the metatable field directly. For other types, sets a per-type global metatable. Pops metatable from stack. Handles GC write barrier.
0x00523B7044lua_api_settable_00523b70Lua C API: lua_settable. Generic table set with metamethod support. Pops key and value from stack. Table is at stack index param_2. Uses lua_vm_settable internally.
0x00523BA079lua_api_settop_00523ba0Lua C API: lua_settop. Sets the stack top to an absolute or relative position. If positive, sets absolute top (fills with nil). If negative, adjusts relative to current top. Equivalent to lua_pop when param_2 is negative.
0x00523BF0213lua_api_setupvalue_00523bf0Lua C API: lua_setupvalue. Sets the upvalue of a function at stack index param_2. param_3 is the 1-based upvalue index. Pops the value from the stack. Returns the upvalue name or NULL if index is out of range. Handles both Lua closures and C closures. GC write barrier applied.
0x00523CD012lua_api_status_00523cd0Lua C API: lua_status. Returns the status byte of a lua_State (offset +6). 0=running, 1=yield, error codes for errors.
0x00523CE045lua_api_toboolean_00523ce0Lua C API: lua_toboolean. Converts a stack value to boolean. Returns 0 for nil (type 0) and false (type 1, value 0). Returns 1 for everything else.
0x00523D1040lua_api_tocfunction_00523d10Lua C API: lua_tocfunction. Returns the C function pointer from a stack value if it is a C function (type=6 and C flag set at offset +6). Returns 0/NULL otherwise.
0x00523D4069lua_api_tointeger_00523d40Lua C API: lua_tointeger. Converts a stack value to an integer. If the value is not a number (type 3), attempts conversion via lua_vm_tonumber. Returns 0 on failure. Uses ROUND for double-to-int conversion.
0x00523D90115lua_api_tolstring_00523d90Lua C API: lua_tolstring. Converts a stack value to a string and returns a pointer to it. If the value is not already a string (type 4), converts via lua_vm_tostring. Optional param_3 receives the string length. Returns NULL if conversion fails. May trigger GC.
0x00523E1055lua_api_tonumber_00523e10Lua C API: lua_tonumber. Converts a stack value to a double. If not already a number (type 3), attempts conversion via lua_vm_tonumber. Returns 0.0 on failure.
0x00523E5084lua_api_topointerLua C API: lua_topointer. Returns a generic pointer for a Lua value. For lightuserdata (type 2) and full userdata (type 7), returns the data pointer. For tables (5), functions (6), and threads (8), returns the GC object pointer. Returns NULL for other types.
0x00523EC031lua_api_tothreadLua C API: lua_tothread. Returns the lua_State pointer if the value at the given stack index is a thread (type 8). Returns NULL otherwise.
0x00523EE045lua_api_touserdataLua C API: lua_touserdata. Returns the userdata pointer for lightuserdata (type 2, returns value directly) or full userdata (type 7, returns pointer+0x18 to skip GC header). Returns NULL for other types.
0x00523F1034lua_api_typeLua C API: lua_type. Returns the type tag of the stack value at the given index. Returns LUA_TNONE (-1) if the index is invalid (points to nil sentinel). Type values: 0=nil, 1=boolean, 2=lightuserdata, 3=number, 4=string, 5=table, 6=function, 7=userdata, 8=thread.
0x00523F4027lua_api_typenameLua C API: lua_typename. Returns the type name string for the given type tag. Returns "no value" for type -1 (LUA_TNONE). Indexes into a global type name array.
0x00523F6090lua_api_xmoveLua C API: lua_xmove. Moves param_3 values from one lua_State (param_1) to another (param_2). Copies stack slots and adjusts both stack tops. No-op if source and destination are the same thread.
0x00523FC0106luaL_prepbuffer_flushLua auxiliary: luaL_prepbuffer flush. Optimizes buffer by concatenating accumulated string pieces on the Lua stack. Iterates through pieces, comparing sizes via lua_api_concat, and flushes when the remaining pieces are few and small enough.
0x0052403073luaL_fileresultLua auxiliary: luaL_fileresult. Formats and pushes an error message for file operations using errno/strerror. Format: "cannot %s %s: %s". Returns error code 6. Removes the file name from the stack after formatting.
0x0052408036lua_print_formattedLua internal: print formatted output. Retrieves stdout file handle via STL singleton, then calls __stdio_common_vfprintf to print formatted output. Used for Lua print() and error output.
0x005240B097lua_reader_fileLua internal: file reader callback for lua_load. Reads up to 0x200 bytes from a FILE* into a buffer using fread. On first call (flag set), returns BOM marker. Returns NULL on EOF. param_2 is the LoadF struct, param_3 receives the size read.
0x0052412033lua_reader_stringLua internal: string reader callback for lua_load (luaL_loadbuffer). Returns the string pointer on first call and sets size, then returns NULL on subsequent calls. param_2 is the LoadS struct (pointer + length).
0x0052415041lua_default_allocLua internal: default memory allocator (l_alloc). If size (param_4) is 0, calls free() and returns NULL. Otherwise calls realloc() to resize/allocate. This is the default allocator passed to lua_newstate.
0x00524180105luaL_addlstringLua auxiliary: luaL_addlstring. Adds a byte string of given length to a Lua string buffer. Copies bytes one at a time, flushing the buffer to the Lua stack when the 0x200-byte internal buffer is full.
0x005241F041luaL_addstringLua auxiliary: luaL_addstring. Adds a null-terminated C string to a Lua string buffer. Computes strlen then delegates to luaL_addlstring.
0x00524220128luaL_addvalueLua auxiliary: luaL_addvalue. Adds the value at the top of the Lua stack to a string buffer. Converts the top value to a string via lua_tolstring, then either copies it into the buffer directly or pushes it as a separate piece with lua_api_insert for later concatenation.
0x005242A0235luaL_argerrorLua auxiliary: luaL_argerror. Raises an argument error for a Lua C function. Checks if this is a method call (compares debug info name to "method") and adjusts the argument number. Formats error message: "bad argument #N to 'funcname' (expected)" or "calling 'funcname' on bad self".
0x0052439026luaL_buffinitLua auxiliary: luaL_buffinit. Initializes a luaL_Buffer struct. Sets the lua_State reference (offset +8), the write pointer to the start of the internal 0x200-byte buffer (offset +12), and the piece count to 0 (offset +4).
0x005243B0136luaL_callmetaLua auxiliary: luaL_callmeta. Calls a metamethod by name on the value at stack index param_2. Gets the metatable, looks up the named field (param_3), and if found (non-nil), calls it with the original value as argument. Returns 1 if metamethod was called, 0 otherwise. Cleans up metatable from stack.
0x0052444043luaL_checkanyluaL_checkany - Lua auxiliary library. Checks that the argument at position param_2 has any value (not none). Errors with "value expected" if the stack position is empty.
0x00524470101luaL_checkintegerluaL_checkinteger - Lua auxiliary library. Checks that the argument at position param_2 is a number and returns it as an integer. Errors with "number expected, got X" on type mismatch.
0x005244E089luaL_checklstringluaL_checklstring - Lua auxiliary library. Checks that the argument at position param_2 is a string. Returns the string pointer and optionally its length via param_3. Errors with "string expected, got X" on type mismatch.
0x00524540124luaL_checknumberluaL_checknumber - Lua auxiliary library. Checks that the argument at position param_2 is a number and returns it as a float/double. Errors with "number expected, got X" on type mismatch.
0x005245C0156luaL_checkoptionluaL_checkoption - Lua auxiliary library. Checks that the argument at param_2 is a string matching one of the null-terminated option list entries in param_4. Returns the index of the matched option. Errors with "invalid option" if no match found.
0x0052466036luaL_checkstackluaL_checkstack - Lua auxiliary library. Ensures the Lua stack has room for param_2 extra slots. Calls luaL_error if lua_checkstack fails.
0x0052469081luaL_checktypeluaL_checktype - Lua auxiliary library. Checks that the argument at position param_2 has exactly the Lua type specified by param_3. Errors with "X expected, got Y" on type mismatch.
0x005246F0138luaL_checkudataluaL_checkudata - Lua auxiliary library. Checks that the argument at position param_2 is a userdata with metatable matching the type name param_3. Returns the userdata pointer. Errors with type mismatch message if the metatable doesn't match.
0x00524780146luaL_errorluaL_error - Lua auxiliary library. Raises an error with a formatted message. Gets debug info (source file, line number) via lua_getinfo, prepends location prefix, concatenates with the error message, and calls lua_error. Does not return.
0x00524820224luaL_findtableluaL_findtable - Lua auxiliary library. Traverses a dot-separated field path in a table at the given index, creating intermediate tables as needed. Used by the module/package system. Returns NULL on success, or the problematic field name if a non-table value is encountered.
0x0052490090luaL_getmetafieldluaL_getmetafield - Lua auxiliary library. Pushes the metafield named param_3 from the metatable of the object at index param_2. Returns 1 if found and pushed, 0 if the object has no metatable or the field doesn't exist.
0x00524960365luaL_gsubluaL_gsub - Lua auxiliary library. Global string substitution. Replaces all occurrences of param_3 (pattern) with param_4 (replacement) in param_2 (source string). Uses an internal buffer to build the result, pushes the result string onto the Lua stack.
0x00524AD045luaL_loadbuffer_00524ad0luaL_loadbuffer - Lua auxiliary library. Loads a Lua chunk from a memory buffer. Wraps lua_load with a buffer reader function. param_2=buffer, param_3=size, param_4=chunk name.
0x00524B00567luaL_loadfile_00524b00luaL_loadfile - Lua auxiliary library. Loads a Lua chunk from a file. Handles: NULL filename (reads stdin), shebang lines (skips #! first line), binary chunks (reopens in binary mode). Calls add_patch_filename_to_list for loaded files. Returns 0 on success, error code on failure.
0x00524D4057luaL_loadstring_00524d40luaL_loadstring - Lua auxiliary library. Loads a Lua chunk from a null-terminated string. Computes strlen then delegates to lua_load with a buffer reader.
0x00524D8092luaL_newmetatable_00524d80luaL_newmetatable - Lua auxiliary library. Creates a new metatable in the registry with the given name param_2. Returns 0 if a table with that name already exists (leaves existing on stack), or 1 if a new table was created and registered.
0x00524DE040luaL_newstate_00524de0luaL_newstate - Lua auxiliary library. Creates a new Lua state using the default memory allocator. Sets lua_default_panic as the panic handler via lua_atpanic. Returns the lua_State pointer or 0 on failure.
0x00524E10281luaL_openlib_00524e10luaL_openlib - Lua auxiliary library. Registers a list of C functions (param_3, name/func pairs) into a library table. If param_2 (library name) is non-NULL, finds/creates the table in _LOADED. Supports upvalues via param_4 (nup). Used for creating Lua modules from C.
0x00524F30129luaL_optinteger_00524f30luaL_optinteger - Lua auxiliary library. Returns the integer value at stack position param_2 if present and valid, otherwise returns the default value param_3. Errors if the argument exists but is not a number.
0x00524FC092luaL_optlstring_00524fc0luaL_optlstring - Lua auxiliary library. Returns the string at stack position param_2 if present, otherwise returns the default string param_3. Optionally writes the string length to param_4. Errors if argument exists but is not a string.
0x00525020162luaL_optnumber_00525020luaL_optnumber - Lua auxiliary library. Returns the number at stack position param_2 if present, otherwise returns the default value param_3. Errors if argument exists but is not a number.
0x005250D050luaL_prepbuffer_005250d0luaL_prepbuffer - Lua auxiliary library. Flushes the current buffer contents to the Lua stack as a string fragment and resets the buffer pointer. Part of the luaL_Buffer system for efficient string building.
0x0052511064luaL_pushresultluaL_pushresult - Lua auxiliary library. Finalizes a luaL_Buffer. Flushes any remaining buffered data as a string, then calls lua_concat to merge all fragments into a single result string on the stack.
0x00525150173luaL_refluaL_ref - Lua auxiliary library. Creates a reference to the value at the top of the stack in the table at index param_2. Returns the reference integer key. Handles free-list recycling of old reference slots. Returns -1 for nil values.
0x00525200224luaL_registerluaL_register - Lua auxiliary library. Registers C functions into a module table (no upvalues). If param_2 (library name) is non-NULL, creates/finds the module in _LOADED and _G. Iterates the luaL_Reg array (name/func pairs) setting each into the table.
0x005252E054luaL_typerrorluaL_typerror - Lua auxiliary library. Raises a type error for the argument at position param_2. Formats message as "param_3 expected, got actual_type" and calls luaL_argerror.
0x0052532085luaL_unrefluaL_unref - Lua auxiliary library. Releases a reference previously created by luaL_ref. Frees the slot at index param_3 in the table at index param_2 by adding it back to the free list. Ignores negative reference values.
0x00525380130luaL_whereluaL_where - Lua auxiliary library. Pushes a string identifying the current position in the call stack at level param_2. Format: "source:line: ". Used as a prefix for error messages by luaL_error.
0x0052541048lua_default_paniclua_default_panic - Default Lua panic handler set by luaL_newstate. Prints "PANIC: unprotected error in call to Lua API" with the error message to stderr, then calls abort. This fires when an error occurs outside any protected call (pcall).
0x00525440207luaB_printluaB_print - Lua base library: print() implementation. Iterates all arguments, converts each to string via tostring(), prints tab-separated to stdout with a trailing newline. Errors if tostring returns non-string.
0x00525510275luaB_tonumberluaB_tonumber - Lua base library: tonumber() implementation. With one arg, converts to number. With two args, second is the base (2-36) for string-to-integer conversion via strtoul. Returns nil on conversion failure.
0x0052563086luaB_errorluaB_error - Lua base library: error() implementation. Takes an error message and optional level (default 1). If level > 0, prepends source location via luaL_where. Calls lua_error to raise.
0x0052569071luaB_getmetatableluaB_getmetatable - Lua base library: getmetatable() implementation. Returns the metatable of the given object. If the metatable has a __metatable field, returns that field's value instead (for protection).
0x005256E0118luaB_setmetatableluaB_setmetatable - Lua base library: setmetatable() implementation. Sets the metatable of a table (arg 1) to arg 2 (must be nil or table). Errors if the existing metatable has a __metatable field (protected metatable).
0x0052576071luaB_getfenvluaB_getfenv - Lua base library: getfenv() implementation. Returns the environment table of a function. For C functions, returns the global environment. Uses luaL_optinteger to resolve the function level on the call stack.
0x005257B0170luaB_setfenvluaB_setfenv - Lua base library: setfenv() implementation. Sets the environment table (arg 2, must be table) of a function (arg 1). Special case: if arg 1 is 0, sets the thread environment. Errors if cannot change environment of a C function.
0x0052586051luaB_rawequalluaB_rawequal - Lua base library: rawequal() implementation. Compares two values for equality without invoking __eq metamethod. Pushes boolean result.
0x005258A052luaB_rawgetluaB_rawget - Lua base library: rawget() implementation. Gets table[key] without invoking __index metamethod. Arg 1 must be a table, arg 2 is the key.
0x005258E060luaB_rawsetluaB_rawset - Lua base library: rawset() implementation. Sets table[key]=value without invoking __newindex metamethod. Arg 1 must be a table, arg 2 is key, arg 3 is value.
0x0052592034luaB_gcinfoluaB_gcinfo - Lua base library: gcinfo() implementation (deprecated). Returns the amount of memory in use by Lua (in KB) via lua_gc with LUA_GCCOUNT option.
0x00525950195luaB_collectgarbageluaB_collectgarbage - Lua base library: collectgarbage() implementation. Accepts option string ("collect","stop","restart","count","step","setpause","setstepmul") and optional argument. Dispatches to lua_gc with the appropriate GC command. Returns count as KB (with fractional part) or boolean for step mode.
0x00525A2048luaB_typeluaB_type - Lua base library: type() implementation. Returns the type name string of the argument (e.g. "number", "string", "table", "nil", etc.).
0x00525A5065luaB_nextluaB_next - Lua base library: next() implementation. Returns the next key-value pair from a table after the given key. Arg 1 must be a table. Returns nil when iteration is complete.
0x00525AA091luaB_loadstringluaB_loadstring - Lua base library: loadstring() implementation. Compiles a string as a Lua chunk. Returns the compiled function on success, or nil + error message on failure. Optional second arg is the chunk name.
0x00525B0066luaB_loadfileluaB_loadfile - Lua base library: loadfile() implementation. Loads a Lua file (or stdin if no filename). Returns compiled function on success, or nil + error message on failure.
0x00525B5099luaB_loadluaB_load - Lua base library: load() implementation. Loads a chunk from a reader function (arg 1, must be a function). Optional arg 2 is the chunk name (default "=(load)"). Returns compiled function on success, or nil + error message on failure.
0x00525BC080luaB_dofileluaB_dofile - Lua base library: dofile() implementation. Loads and executes a Lua file. Calls luaL_loadfile then lua_pcall. Raises error on failure. Returns all values from the executed chunk.
0x00525C1074luaB_assertluaB_assert - Lua base library: assert() implementation. If arg 1 is truthy, returns all arguments. If arg 1 is falsy, raises an error with arg 2 as the message (default "assertion failed!").
0x00525C60176luaB_unpackluaB_unpack - Lua base library: unpack() implementation. Returns elements from a table as multiple values. Arg 1 is the table, optional arg 2 is start index (default 1), optional arg 3 is end index (default #table). Errors with "too many results to unpack" if range exceeds stack capacity.
0x00525D10129luaB_selectluaB_select - Lua base library: select() implementation. If arg 1 is "#", returns the number of remaining arguments. Otherwise arg 1 is an integer index; returns all arguments from that index onward. Negative indices count from the end. Errors with "index out of range" for invalid indices.
0x00525DA073luaB_pcallLua base library: xpcall(f, err) - calls function f with error handler err, pushes success boolean and results
0x00525DF077luaB_xpcallLua base library: pcall(f, ...) - protected call with message handler, returns success boolean + results
0x00525E40115luaB_tostringLua base library: tostring(v) - converts value to string. Handles nil->"nil", boolean->"true"/"false", number->string, string->identity, other->__tostring metamethod or type+pointer
0x00525F4074luaB_costatusLua coroutine.status(co) - returns status string: "running", "suspended", "normal", or "dead"
0x00525F90123luaB_coresumeLua coroutine.resume(co, ...) - resumes coroutine, returns true+values on success or false+error on failure
0x0052601092luaB_cocreateLua coroutine.create(f) - creates new coroutine thread from Lua function f. Errors if f is a C function.
0x00526070105luaB_cowrapLua coroutine.wrap(f) - creates coroutine and returns an iterator function that resumes it on each call
0x005260E025lua_coroutine_yieldLua base library: error(message, level) - raises an error with the given message at the specified stack level
0x0052610036luaB_corunningLua coroutine.running() - returns the running coroutine thread, or nil if called from the main thread
0x00526130208lua_resume_internal_00526130Lua internal: lua_resume - resumes a coroutine, transferring arguments/results between caller and coroutine stacks. Checks stack space, sets debug hook, handles yield/error return codes.
0x00526200158lua_costatus_00526200Lua internal: costatus - determines coroutine status. Returns 0=running (same thread), 1=suspended (yielded or not started), 2=normal (has stack frames), 3=dead (finished or error). Uses security cookie.
0x005262A0126lua_generic_reader_005262a0Lua internal: generic reader callback for lua_load. Calls the reader function on the stack, expects string or nil return. Used by lua_load to read chunks from user-provided reader functions.
0x00526320210luaB_getfuncLua base library: getfenv(f) - gets the environment table of function f or stack level. If arg is a function, pushes it directly. Otherwise interprets as stack level, gets debug info, and retrieves environment.
0x0052640067lua_ipairs_iterator_00526400Lua internal: ipairs iterator function. Increments index by 1, does rawgeti on the table. Returns 2 values (index, value) if value is non-nil, else 0 to stop iteration.
0x00526450101lua_wrap_resume_iterator_00526450Lua internal: coroutine.wrap iterator. Resumes the wrapped coroutine thread (stored as upvalue). On failure, prepends traceback info and calls lua_error. Returns resume results on success.
0x005264C055luaB_ipairsLua base library: ipairs(t) - returns iterator function, table t, and initial index 0. The iterator (ipairs_iterator upvalue) traverses integer keys sequentially.
0x00526500216luaB_newproxyLua base library: newproxy(arg) - creates a new userdata proxy. If arg is true, creates with new metatable. If arg is an existing proxy, copies its metatable. Lua 5.1 specific function.
0x005265E053luaB_pairsLua base library: pairs(t) - returns next function (upvalue), table t, and nil as initial key for generic for loop iteration.
0x00526740233luaK_addk_00526740Lua code generator: luaK_addk - adds a constant value to the function prototype's constant table. Returns the index of the constant. Uses hash table for deduplication. Grows the constant array as needed.
0x00526830477luaK_codearith_00526830Lua code generator: luaK_codearith - emits arithmetic bytecode. Performs constant folding for add/sub/mul/div/mod/pow/unm when both operands are number constants. Falls back to emitting OP_ADD..OP_UNM instructions otherwise.
0x00526A40217luaK_codecomp_00526a40Lua code generator: luaK_codecomp - emits comparison instructions (OP_EQ, OP_LT, OP_LE). Frees operand registers, emits the comparison opcode followed by a conditional jump, stores result as jump list.
0x00526B2093luaK_condjump_00526b20Lua code generator: luaK_condjump - emits a conditional test+jump instruction pair. Emits the test opcode, saves pending jump, emits unconditional jump (OP_JMP), patches test to skip over. Returns jump position.
0x00526B8085luaK_exp2nextreg_00526b80Lua code generator: luaK_exp2nextreg - allocates next free register and discharges expression into it. Checks max stack depth limit (249). Increments freereg counter.
0x00526BE0475luaK_discharge2regLua code generator: luaK_discharge2reg - discharges expression to a specific target register. Handles all expression kinds: VNIL, VTRUE, VFALSE, VK (constant), VKNUM (number), VLOCAL, VUPVAL, VGLOBAL, VINDEXED, VRELOCABLE, VNONRELOC via MOVE instruction.
0x00526DF0288luaK_exp2regLua code generator: luaK_exp2reg - discharges expression to a specific register, then patches true/false jump lists to load the correct boolean value. Handles conditional expressions that need boolean materialization.
0x00526F1038luaK_freereg_00526f10Lua code generator: luaK_freereg - frees a register if it is a temporary (above the fixed local variables). Decrements freereg counter.
0x00526F4080luaK_fixline_00526f40Lua code generator: luaK_fixline - patches the return instruction's A field. Adjusts the instruction at the given position to set the correct number of return values.
0x00526F90249luaK_goiftrueLua code generator: luaK_goiftrue - emits code to test expression and jump if true. Handles NOT optimization (inverts condition). For VRELOCABLE with TESTSET, patches inline. Otherwise emits conditional jump. Builds true-list for patching.
0x0052709057luaK_reserveregs_00527090Lua code generator: luaK_reserveregs - checks and reserves additional stack slots. Errors with "function or expression too complex" if total exceeds 249 (MAXSTACK).
0x005270D0162luaK_code_005270d0Lua code generator: luaK_code - emits a single instruction to the code array. Patches any pending jump to this position, grows the code and lineinfo arrays as needed, stores instruction and line number. Returns the instruction index.
0x0052718045luaK_codeABC_00527180Lua code generator: luaK_codeABC - encodes and emits an iABC-format instruction. Packs opcode, A, B, C fields into a 32-bit instruction word and calls luaK_code.
0x005271B039luaK_codeABx_005271b0Lua code generator: luaK_codeABx - encodes and emits an iABx-format instruction. Packs opcode, A, Bx fields into a 32-bit instruction word and calls luaK_code.
0x005271E0132luaK_patchlist_005271e0Lua code generator: luaK_patchlist - patches a chain of jump instructions to target a specific position. Walks the linked list of jumps (encoded as sBx offsets in JMP instructions) and rewrites each to point to the target.
0x00527270290luaK_dischargevars_00527270Lua code generator: luaK_dischargevars - converts variable references (VLOCAL, VUPVAL, VGLOBAL, VINDEXED) into actual value expressions by emitting the appropriate load instructions (GETUPVAL, GETGLOBAL, GETTABLE). Also handles VJMP and VTEST types.
0x005273C0344luaK_exp2anyreg_005273c0Lua code generator: luaK_exp2anyreg - places expression result in any register. Tries to keep in current register if possible. For constants that fit in RK field, returns RK encoding (index\|0x100). Otherwise allocates a new register.
0x0052753080luaK_exp2nextreg_safe_00527530Lua code generator: exp2nextreg variant that tries to keep the value in its current register if it has no pending jumps, otherwise forces allocation of a new register via exp2nextreg_force.
0x00527580117luaK_exp2nextreg_force_00527580Lua code generator: exp2nextreg_force - unconditionally discharges expression, frees its register if temporary, allocates next register, and calls exp2reg. Ensures expression occupies a fresh register slot.
0x0052760097luaK_exp2val_00527600Lua code generator: luaK_exp2val - ensures expression has a concrete value. If expression has no pending jump patches, just discharges variables. Otherwise forces to a register via exp2nextreg_force.
0x0052767023luaK_setlineno_00527670Lua code generator: luaK_setlineno - sets the line number info for the last emitted instruction by writing to the lineinfo array at (pc-1).
0x0052769014luaK_setcurrentline_00527690Lua code generator: copies the lastline value to currentline. Simple state update for line tracking during code generation.
0x005276A0122luaK_goiffalse_005276a0Lua code generator: luaK_goiffalse - emits code to test expression and jump if false. Mirror of luaK_goiftrue. Handles constant true/false/nil, VRELOCABLE with NOT, and general expressions. Builds false-list for patching.
0x0052774031luaK_indexed_00527740Lua code generator: luaK_indexed - sets up indexed expression (table[key]). Converts key expression to RK format via exp2anyreg and stores in the expression descriptor's aux field.
0x0052776052luaK_prefix_00527760Lua code generator: luaK_prefix - handles prefix/unary operators and infix operator left-hand side preparation. For unary minus/not/len, processes operand. For comparisons and AND/OR, sets up conditional jump chains.
0x0052797059luaK_jump_00527970Lua code generator: luaK_jump - emits an unconditional OP_JMP instruction. Concatenates with any pending jump list. Returns the position of the emitted jump for later patching.
0x005279B0150luaK_nil_005279b0Lua code generator: luaK_nil - emits OP_LOADNIL instruction to set registers [reg..reg+n-1] to nil. Optimizes by coalescing with previous LOADNIL if the ranges overlap or are adjacent.
0x00527A5043luaK_numberK_00527a50Lua code generator: luaK_numberK - adds a number constant to the prototype constant table. Wraps the double value in a TValue struct and calls luaK_addk.
0x00527A8058luaK_patchtohere_00527a80Lua code generator: luaK_patchtohere - patches a jump to the current code position. If target equals lastline, concatenates to pending jump list. Otherwise calls patchclose to fix up jump targets.
0x00527AC030luaK_concat_00527ac0Lua code generator: luaK_concat - concatenates a jump to the pending jump list. Updates lastline and appends to the pending list via luaK_patchlist.
0x00527AE040luaK_posfix_00527ae0Lua code generator: luaK_posfix - handles the right-hand side of binary operations. The main binary expression code generator. Handles arithmetic (+,-,*,/,%,^), concatenation (..), comparison (==,~=,<,<=,>,>=), logical (and,or). Performs constant folding where possible.
0x00528D10468luaK_prefixLua code generator: applies prefix operator (UNM=0, NOT=1, LEN=2) to an expression. For UNM, tries constant folding on numbers. For NOT, swaps true/false jump lists. For LEN, emits OP_LEN instruction.
0x00528F1064luaK_checkstackLua code generator: ensures the function stack has room for 'n' more slots. Raises error if stack exceeds 249 registers ("function or expression too complex").
0x00528F5044luaK_codeABxLua code generator: emits an instruction in ABx format (opcode=0x1E/OP_CLOSURE). Encodes A=param_2 in bits 6-13, Bx=(param_3+1) in bits 14-31.
0x00528F80236luaK_setcallLua code generator: emits a CALL instruction for a function call expression. Reserves 2 stack slots, encodes function register, argument count, and generates OP_CALL (opcode 0x0B).
0x00529070130luaK_setlistLua code generator: emits OP_SETLIST instruction for table constructors. Encodes base register, field count (in batches of 50/LFIELDS_PER_FLUSH), and flush index. Handles extra arg for large tables.
0x0052910085luaK_setoneretLua code generator: adjusts expression to produce exactly one result. For VCALL (0xD), extracts register from instruction. For VVARARG (0xE), patches instruction to request 1 result and changes kind to VRELOCABLE.
0x00529160165luaK_setmultretLua code generator: adjusts expression to produce multiple results. For VCALL (0xD), patches C field of instruction. For VVARARG (0xE), patches B field, sets register, and reserves one stack slot.
0x00529210218luaK_storevarLua code generator: stores a value into a variable. Handles VLOCAL (6, direct reg move), VUPVAL (7, OP_SETUPVAL), VGLOBAL (8, OP_SETGLOBAL), and VINDEXED (9, OP_SETTABLE) variable kinds.
0x0052930039luaK_numberKLua code generator: adds a number constant to the constant pool. Creates a TValue with type=4 (LUA_TNUMBER), value=param_2, then calls luaK_addk to register it.
0x0052933091luaK_hasjumpsLua code generator: checks if a jump list contains any non-test jumps (i.e., jumps whose preceding instruction is not OP_TESTSET 0x1B). Returns 1 if non-test jumps exist, 0 otherwise.
0x00529390163luaK_patchlistauxLua 5.1 internal: luaK patchlistaux
0x00529440143luaK_patchtestregLua code generator: patches the register operand in a TESTSET instruction preceding a jump. If the preceding instruction is OP_TESTSET (0x1B), patches register A to param_3. If param_3==0xFF or matches current B, converts to OP_TEST.
0x005294D0124luaK_dischargejpcLua code generator: discharges a pending jump list by converting all TESTSET instructions in the list to TEST instructions (removing the register assignment). Traverses linked jump list until end (-1).
0x0052955026luaB_getfenv_compatLua base library: pushes the global environment table (registry index -10000) onto the stack. Simplified getfenv implementation that always returns the global table.
0x0052957047luaB_getmetatable_00529570Lua base library: implements getmetatable(obj). Returns the metatable of the given object, or nil if it has none. Corresponds to Lua's getmetatable() function.
0x005295A077luaB_setmetatable_005295a0Lua base library: implements setmetatable(table, metatable). Validates arg 2 is nil or table. Sets the metatable on arg 1 and pushes boolean result. Returns 1 value.
0x005295F033luaB_getfenv_005295f0Lua base library: implements getfenv(f). Checks arg 1 exists, then calls lua_getfenv to get the function environment table. Returns 1 value.
0x0052962062luaB_setfenv_00529620Lua base library: implements setfenv(f, table). Validates arg 2 is a table, calls lua_setfenv. Raises error if environment cannot be changed (e.g., C functions). Returns 1 value.
0x00529660662luaB_getinfoLua debug library: implements debug.getinfo(thread, f, what). Gets information about a function or stack level. Parses 'flnSu' option string to populate source, currentline, nups, name/namewhat, activelines, func fields in a table. Returns 1 table.
0x00529900248luaB_getlocalLua debug library: implements debug.getlocal(thread, level, local_index). Returns the name and value of a local variable at the given stack level. Returns 2 values (name, value) or nil if not found.
0x00529A00231lua_debug_setlocal_00529a00Lua debug library: implements debug.setlocal(thread, level, local_index, value). Sets the value of a local variable at the given stack level. Returns the local variable name as 1 value.
0x00529AF092lua_debug_getupvalue_00529af0Lua debug library: implements debug.getupvalue(f, up). Returns name and value of upvalue #up of function f. Only works for Lua functions (not C functions). Returns 2 values (name, value) or 0 if not found.
0x00529B50100lua_debug_setupvalue_00529b50Lua debug library: implements debug.setupvalue(f, up, value). Sets the value of upvalue #up of function f. Only works for Lua functions. Returns upvalue name (1 value) or 0 if not found.
0x00529BC0295lua_debug_sethook_00529bc0Lua debug library: implements debug.sethook(thread, hook, mask, count). Parses mask string for 'c' (call), 'r' (return), 'l' (line) flags. Stores hook function in registry keyed by thread lightuserdata. Calls lua_sethook.
0x00529CF0228lua_debug_gethook_00529cf0Lua debug library: implements debug.gethook(thread). Returns the current hook function, mask string ('c'/'r'/'l'), and count. Returns "external hook" if hook wasn't set through debug library. Returns 3 values.
0x00529DE0313lua_debug_debug_00529de0Lua debug library: implements debug.debug(). Enters interactive debug mode, reading commands from stdin via "lua_debug>" prompt. Executes each line via luaL_loadbuffer+lua_pcall. Exits on empty input or "cont" command.
0x00529F20585lua_debug_traceback_00529f20Lua debug library: implements debug.traceback(thread, msg, level). Builds a stack traceback string. For each frame, adds short_src:line info, function name/type. Collapses middle frames with "..." if stack is deep (>12 frames). Returns 1 string.
0x0052A17099lua_debug_gethooktable_0052a170Lua debug internal: retrieves or creates the hook table from the registry. The hook table maps thread lightuserdata keys to hook function values. Creates the table with initial capacity 1 if it doesn't exist.
0x0052A1E0141lua_debug_hookcallback_0052a1e0Lua debug internal: hook callback function invoked by the VM. Looks up the Lua hook function from the hook table, pushes the event name (from string array indexed by event type), pushes line number (or nil if negative), then calls the hook with 2 args.
0x0052A29079lua_debug_transfer_field_0052a290Lua debug internal: transfers a value from one thread's stack to a table field. If source and dest threads are the same, adjusts stack and sets field directly. Otherwise uses lua_xmove to transfer before setting field.
0x0052A2E0592luaG_getinfo_0052a2e0Lua debug core: implements lua_getinfo backend. Parses option string ('S','l','u','n','L','f') to fill debug info struct with source, line, nups, name/namewhat, active lines, function. Handles tail calls specially with placeholder info.
0x0052A58094luaG_checkopenop_0052a580Lua debug core: validates an instruction operand is within valid range for the given operand type. Type 0: must be 0 (register A). Type 2: must be < maxstacksize. Type 3: checks against maxstacksize or constant pool size. Returns 1 if valid, 0 if not.
0x0052A5E083luaG_currentline_0052a5e0Lua debug core: returns the current source line number for a call frame. Calculates the PC offset from the prototype's code array and looks up in the lineinfo array. Returns 0 if no lineinfo, -1 if not a Lua function.
0x0052A64075luaG_currentpc_0052a640Lua debug core: returns the current PC (program counter) index for a Lua call frame. Computes offset from the prototype's code base as (savedpc - code) / 4 - 1. Returns -1 if frame is not a Lua function.
0x0052A690130luaG_findlocal_0052a690Lua debug core: finds a local variable name by index at the current PC. First checks luaF_getlocalname from the prototype's debug info, then falls back to checking if index is within the stack range (returns "(temporary)" for unnamed stack slots).
0x0052A720301luaG_getfuncname_0052a720Lua debug core: determines the name and kind of a variable/function at a given register in a call frame. Follows MOVE chains, resolves upvalues, globals, table fields, and method calls. Returns kind string ("local","upvalue","global","field","method") and sets name pointer.
0x0052A88050luaG_knameLua debug core: returns the string name of a constant from the constant pool. If the RK index has bit 8 set (constant), looks up the constant table entry; returns the string payload if type==4 (LUA_TSTRING), otherwise returns "?" placeholder.
0x0052A8C048luaG_aritherrorLua debug core: raises an arithmetic error. Attempts to convert param_2 to number; if that fails, uses param_2 as the offending operand. Calls luaG_typeerror with "perform arithmetic on" message.
0x0052A8F031luaG_has_vararg_flagLua debug core: checks if the current prototype has vararg flags set. Calls luaG_checkopenop with the prototype's vararg field and register 0xFF. Returns true if the check succeeds (non-zero).
0x0052A91037luaG_isinlinejumpLua debug core: checks if an instruction is a potential open call/setlist. Returns 1 if opcode is 0x1C (CALL), 0x1D (TAILCALL), 0x1E (RETURN), or 0x22 (SETLIST) AND the A operand (bits 23+) is 0. Returns 0 otherwise.
0x0052A96038luaG_concaterrorLua debug core: raises a concatenation type error. Wrapper that calls luaG_typeerror with "attempt to concatenate" message.
0x0052A990140luaG_errormsgLua VM error handler: invokes the error handler function if one is set (non-zero errfunc offset). Copies error message and handler to stack, calls handler via luaD_call, then triggers luaD_throw with error code 2 (runtime error).
0x0052AA2080luaG_ordererrorLua debug core: raises a comparison/ordering error. If both operands have the same type, reports "attempt to compare two X values"; otherwise reports "attempt to compare X with Y". Always returns 0.
0x0052AA70282luaG_runerrorLua debug core: raises a runtime error with formatted message. Formats the message with lua_pushvfstring, prepends source:line prefix if current frame is a Lua function, then calls luaG_errormsg to invoke error handler and throw.
0x0052AB90138luaG_typeerrorLua debug core: raises a type error. Searches the current call frame's stack for the offending value, tries to determine its name via luaG_getfuncname. Produces messages like "attempt to X local 'y' (a Z value)" or "attempt to X a Z value".
0x0052AC2011lua_gethookLua API: returns the current hook function pointer from lua_State offset 0x44.
0x0052AC3011lua_gethookcountLua API: returns the current hook count from lua_State offset 0x3C (the instruction count interval for count hooks).
0x0052AC4012lua_gethookmaskLua API: returns the current hook mask byte from lua_State offset 0x38. Mask bits: 1=call, 2=return, 4=line, 8=count.
0x0052AC50319lua_getinfoLua API: implements lua_getinfo(L, what, ar). Supports '>' prefix to pop function from stack. Delegates to luaG_getinfo for actual info gathering. Handles 'f' option (push function) and 'L' option (push active lines table). Returns non-zero on success.
0x0052AD9077lua_do_getupvalue_by_index_0052ad90Lua VM: Gets an upvalue by index from a call frame. Looks up the upvalue slot in the closure's upvalue array and pushes its value onto the stack. Returns non-zero if successful.
0x0052ADE0119lua_do_findupvalue_by_count_0052ade0Lua VM: Finds an upvalue by walking backward through the call stack, counting visible upvalues (skipping vararg frames). Sets the index in param_3->offset and returns 1 if found, 0 otherwise.
0x0052AE6046lua_do_set_hook_config_0052ae60Lua VM: Configures debug hook settings on a lua_State. Sets the hook function pointer (+0x44), hook mask (+0x38), and hook count (+0x3c/+0x40). If either function or mask is 0, both are cleared.
0x0052AE9091lua_do__setupvalue_by_indexLua VM: Sets an upvalue by index. Pops the top stack value and copies it into the specified upvalue slot of the closure. Returns non-zero on success.
0x0052AEF01194lua_debug__checkcodeLua VM (ldebug.c): Validates a Lua prototype's bytecode instructions. Checks each opcode for valid register references, jump targets, upvalue indices, and instruction sequence constraints. Returns the last return instruction index or 0 on validation failure. Large switch on opcode types (0x00-0x25).
0x0052B420352lua_do__adjust_varargsLua VM (ldo.c): Adjusts the stack for a vararg function call. Pads fixed args if fewer were passed, moves fixed args below varargs, and optionally creates a vararg table (COMPAT_VARARG). Returns pointer to the adjusted base.
0x0052B580213lua_do__f_parserLua VM (ldo.c): Parser front-end. Checks ZIO lookahead byte: 0x1b = binary chunk (luaU_undump), else text (luaY_parser). Creates a closure from the resulting prototype and pushes it onto the stack. Allocates upvalues for the closure.
0x0052B66073lua_do__growCILua VM (ldo.c): Grows the call info (CI) stack. Doubles the CI stack size via realloc. If size exceeds 20000, raises "stack overflow" error. Hard limit at 20001 triggers error code 5 + int3 breakpoint.
0x0052B6B0130lua_do__callLua VM (ldo.c): Performs a Lua function call (luaD_call). Increments C call depth, checks for C stack overflow (200 = error, 224 = fatal). Calls luaD_precall; if it returns 0, runs luaV_execute. Decrements call depth on return. Runs GC step if threshold exceeded.
0x0052B740220lua_do__callhookLua VM (ldo.c): Invokes the user-set debug hook callback if one is registered and hooks are enabled. Saves/restores the stack top and CI stack pointers around the hook call. Temporarily disables hooks during execution to prevent recursion.
0x0052B82039lua_do__checkstack_growLua VM (ldo.c): Ensures the value stack has enough room by growing it. Calculates new size as max(current*2, current+needed) and calls luaD_reallocstack.
0x0052B850199lua_do__pcallLua VM (ldo.c): Protected call (luaD_pcall). Saves the current C call depth, CI stack offset, and allowhook flag. Calls luaD_rawrunprotected with the given function. On error, restores saved state, closes upvalues, and handles error results. Shrinks CI stack back to 20000 if it grew past that.
0x0052B920236lua_do__poscallLua VM (ldo.c): Post-call processing (luaD_poscall). Fires line/return hooks if active. Pops the call info frame, copies return values to the caller's expected slots. Returns the number of expected results + 1.
0x0052BA10632lua_do__precallLua VM (ldo.c): Pre-call setup (luaD_precall). For C functions: pushes a new CI frame, calls the C function, then does poscall; returns 1. For C closures that yield: returns 2. For Lua functions: adjusts varargs if needed, pushes CI frame, sets up registers and PC; returns 0 (caller should run luaV_execute). If not callable, looks up __call metamethod.
0x0052BC90240lua_do__protectedparserLua VM (ldo.c): Protected parser (luaD_protectedparser). Calls f_parser inside luaD_rawrunprotected. On success, restores CI/stack state. Frees the parser's scanner buffer regardless of outcome. Shrinks CI stack if it grew past 20000.
0x0052BD80136lua_do__rawrunprotectedLua VM (ldo.c): Raw protected execution (luaD_rawrunprotected). Saves/restores the error recovery chain (L->errorJmp). Uses setjmp3 to establish an error recovery point, then calls the provided function. Returns the error status code (0 = success).
0x0052BE10121lua_do__reallocCILua VM (ldo.c): Reallocates the call info (CI) stack to a new size. Each CI entry is 0x18 bytes. Updates the CI base pointer, current CI pointer, and end-of-CI pointer. Checks for overflow (size limit ~0xAAAAAAA entries).
0x0052BE90199lua_do__reallocstackLua VM (ldo.c): Reallocates the Lua value stack (luaD_reallocstack). Each slot is 0x10 bytes. Relocates all pointers in the CI stack and open upvalue list to the new base address. Updates stack_last, top, and base pointers.
0x0052BF60103lua_do__seterrorobjLua VM (ldo.c): Sets the error object on the stack (luaD_seterrorobj). For runtime errors (2,3): copies the top-of-stack error value to the target. For OOM (4): creates "not enough memory" string. For fatal (5): creates "error in error handling" string. Adjusts stack top.
0x0052BFE077lua_do__throwLua VM (ldo.c): Throws a Lua error (luaD_throw). If an error recovery point exists (L->errorJmp), stores the error code and does longjmp. Otherwise sets L->status, calls the global panic handler if set, then exit(1).
0x0052C030233lua_do__resumeLua VM (ldo.c): Resumes a coroutine (lua_resume). Checks that the coroutine is suspended or fresh (status 0/1). Verifies C stack depth < 200. Calls luaD_rawrunprotected with resume_inner. Returns the coroutine status. Errors if trying to resume a non-suspended coroutine.
0x0052C12055lua_do__yieldLua VM (ldo.c): Yields a coroutine (lua_yield). Checks that yield is not attempted across a metamethod/C-call boundary. Sets L->status = 1 (yielded), saves the first result pointer. Returns -1 to signal yield to the caller.
0x0052C160123lua_do__resetthreadLua VM (ldo.c): Resets a Lua thread/coroutine after an error. Resets CI to base, closes upvalues, sets error object, restores C call depth and allowhook. Shrinks CI stack back to 20000 if it grew. Clears errorJmp and errfunc.
0x0052C1E0123lua_do__resume_innerLua VM (ldo.c): Inner resume logic. For fresh coroutines (status=0): calls precall then execute. For yielded coroutines (status=1): clears status, resumes C closures via poscall or continues Lua execution via luaV_execute.
0x0052C260374lua_undump__dump_stackLua VM (lundump.c): Dumps the Lua stack constants of a prototype. Writes the constant count, then for each constant writes its type tag and value (nil=0, boolean=1, number=3 as double, string=4 with length prefix). Also dumps sub-prototypes and upvalue info by calling DumpCode and DumpDebug.
0x0052C3E0536lua_undump__dump_debugLua VM (lundump.c): Dumps the debug info section of a Lua prototype. Writes line info array, local variable records (name string + startpc + endpc), and upvalue name strings. When strip mode is enabled, writes zero counts instead of actual debug data.
0x0052C600336lua_undump__dump_functionLua VM (lundump.c): Dumps a complete Lua function prototype. Writes the source name string, then numeric fields (linedefined, lastlinedefined, nups, numparams, is_vararg, maxstacksize), then the code array, then calls DumpConstants and DumpDebug.
0x0052C750131lua_undump__dump_stringLua VM (lundump.c): Dumps a Lua string to the output. Writes 0 for NULL strings. For non-NULL strings, writes the length (including null terminator) followed by the string data bytes.
0x0052C7E0123lua_undump__luaU_dumpLua VM (lundump.c): Top-level dump entry point (luaU_dump). Writes the Lua binary header via luaU_make_header, then dumps the main function prototype via DumpFunction. Returns the writer's error status.
0x0052C860165lua_func__close_upvaluesLua VM (lfunc.c): Closes all open upvalues at or above the given stack level (luaF_close). Walks the open upvalue list. For upvalues that need to stay alive: copies the stack value into the upvalue object and relinks it into the GC alloc list. For dead upvalues: frees the memory.
0x0052C910152lua_func__findupvalLua VM (lfunc.c): Finds or creates an open upvalue for the given stack level (luaF_findupval). Walks the open upvalue list looking for a match. If found, returns it (toggling GC color if needed). If not found, allocates a new UpVal, inserts it sorted by stack level, and links it into the GC list.
0x0052C9B063lua_func__freeclosureLua VM (lfunc.c): Frees a closure object. For C closures (isC=1): size = nupvalues*16 + 0x18. For Lua closures (isC=0): size = nupvalues*4 + 0x14. Calls luaM_realloc with size 0 to free.
0x0052C9F0143lua_func__freeprotoLua VM (lfunc.c): Frees a Lua function prototype and all its sub-arrays. Frees: code array, sub-prototypes array, constants array, line info array, local variables array, and upvalue names array. Finally frees the Proto struct itself (0x4c bytes).
0x0052CA8050lua_func__freeupvalLua VM (lfunc.c): Frees an UpVal object. If the upvalue's value pointer doesn't point to its own embedded storage (i.e., it's still open/linked), unlinks it from the doubly-linked list first. Then frees the 0x20-byte UpVal struct.
0x0052CAC075lua_func__getlocalnameLua VM (lfunc.c): Gets the name of a local variable at a given PC position (luaF_getlocalname). Iterates through the prototype's localvar array, counting variables whose scope includes the given PC. Returns the string pointer of the Nth matching local, or 0 if not found.
0x0052CB1064lua_func__newCclosureLua VM (lfunc.c): Allocates a new C closure (luaF_newCclosure). Allocates nupvalues*16 + 0x18 bytes. Sets isC=1, nupvalues, and environment table. Links into the GC alloc list with type tag 6.
0x0052CB5088lua_func__newLclosureLua VM (lfunc.c): Allocates a new Lua closure (luaF_newLclosure). Allocates nupvalues*4 + 0x14 bytes. Sets isC=0, nupvalues, and environment table. Zeroes all upvalue slots. Links into the GC alloc list with type tag 6.
0x0052CBB0151lua_func__newprotoLua VM (lfunc.c): Allocates a new Lua function prototype (luaF_newproto). Allocates 0x4c bytes and zeroes all fields: code, constants, sub-protos, line info, locals, upvalue names, and their counts. Links into GC alloc list with type tag 9.
0x0052CC5052lua_func__newupvalLua VM (lfunc.c): Allocates a new upvalue object (luaF_newupval). Allocates 0x20 bytes, links into GC alloc list with type tag 10. Initializes the value pointer to point at the embedded storage (self+0x10) and sets value type to nil (0).
0x0052CC90217lua_gc__run_single_finalizerLua VM (lgc.c): Runs a single GC finalizer (__gc metamethod). Pops one object from the tmudata finalization ring, relinks it into the normal alloc list, recolors it. If it has a __gc metamethod in its metatable, pushes the metamethod + object onto the stack and calls it with allowhook=0 and doubled GC threshold to prevent recursive GC.
0x0052CD70616lua_gc__fullcycleLua VM (lgc.c): Runs a full GC collection cycle. Marks open upvalues pointing to string keys, runs mark propagation, separates udata with finalizers, runs propagation again for gray-again list, performs atomic sweep of strings. Then sweeps all object lists (main alloc, string table, tmudata). Clears weak table entries, flips GC colors, computes new GC threshold.
0x0052CFE027lua_gc__link_objectLua VM (lgc.c): Links a GC object into the gray-again list for re-traversal. Clears the object's black bit and prepends it to g_state->grayagain list. Used for barrier-back when a black object is written to by a white object.
0x0052D00050lua_gc__barrier_forwardLua VM (lgc.c): GC write barrier forward (luaC_barrierf). During the propagation phase, marks the referenced white object gray (pushes it onto the gray list). Outside propagation, just recolors the parent object to the current white.
0x0052D040246lua_gc__run_all_finalizersLua VM (lgc.c): Runs all pending GC finalizers. Loops while tmudata ring is non-empty, popping one object at a time, relinking it into the normal alloc list, and calling its __gc metamethod if present. Same logic as run_single_finalizer but in a loop.
0x0052D140331lua_gc__sweeplistLua VM (lgc.c): Sweeps GC objects in a linked list. Iterates through each hash bucket of the alloc list. For each object: if it's the wrong white color, frees it (dispatching by type: table, closure, proto, thread, upval, string, userdata). Otherwise, recolors it to the current white and keeps it. Processes up to 3 objects per bucket.
0x0052D2B0133lua_gc__fullgcLua VM (lgc.c): Full garbage collection entry point (luaC_fullgc). If GC is not yet in sweep phase, initializes sweep state. Runs incremental steps until sweep is complete (phase 4). Then runs finalization phase. Finally computes new GC threshold as (totalbytes/100)*gcpause.
0x0052D34037lua_gc__link_newobjLua VM (lgc.c): Links a newly allocated GC object into the alloc list (luaC_link). Sets the object's next pointer, type tag, and initial GC color to the current white bits. Prepends it to g_state->rootgc.
0x0052D370116lua_gc__linkupvalLua VM (lgc.c): Links a closed upvalue into the GC alloc list (luaC_linkupval). Prepends it to rootgc. If GC is in propagation phase and the upvalue's referenced value is a live black string object, marks the upvalue for re-traversal (barrier forward).
0x0052D3F0164lua_gc__separate_udata_with_finalizersLua VM (lgc.c): Separates userdata with __gc finalizers from the main alloc list into the tmudata finalization ring. Walks all objects; for those that are white (dead) or all (if param_2 is set) and not yet marked for finalization, checks for __gc metamethod. If found, moves the object to the tmudata ring. Returns estimated memory cost of moved objects.
0x0052D4A0515lua_gc__stepLua VM (lgc.c): Performs one incremental GC step (luaC_step). Budgets work based on gcstepmul*10. Dispatches by GC phase: 0=start mark, 1=propagate (traverse gray objects), 2=sweep strings, 3=sweep objects (shrinks string table if sparse), 4=finalize (call __gc). When a full cycle completes, recomputes GC threshold. If over budget, adjusts debt for next step.
0x0052D6C0214lua_gc__mark_roots_0052d6c0Lua GC: Marks root objects for garbage collection. Iterates through 9 GC root slots at param_1+0x98, clearing mark bits and linking objects onto the gray list (param_1+0x24) based on their type (table=5, closure=6, pair=7, thread=8, proto=9, upval=10).
0x0052D7C0122lua_gc__restart_collection_0052d7c0Lua GC: Restarts a GC collection cycle. Clears gray/grayagain/weak lists, marks the main thread, its global table and registry, then calls mark_roots. Sets GC state to 1 (propagate phase).
0x0052D840675lua_gc__sweep_gray_list_0052d840Lua GC: Processes the gray list during sweep phase. Traverses objects on the gray list (param_1+0x24), propagating marks to their children. Handles tables, closures, threads, and protos. Returns total estimated memory size of processed objects.
0x0052DB00627lua_gc__propagate_one_0052db00Lua GC: Propagates marks from a single gray object. Takes one object from the gray list and traverses it based on type: table (type 5), closure (6), thread (8), proto (9). Returns estimated memory size. Similar to sweep_gray_list but processes exactly one object.
0x0052DD90194lua_gc__mark_object_0052dd90Lua GC: Marks a single GC object as reachable. Clears white bits, then links object onto the gray list based on type (table=5, closure=6, pair=7, thread=8, proto=9, upval=10). For pairs, recursively marks both key and value. Called during mark phase of garbage collection.
0x0052DE70367lua_gc__step_0052de70Lua GC: Performs a single incremental GC step. State machine with phases: 0=restart, 1=propagate (process gray list), 2=sweep strings, 3=sweep other objects (with table/string resize), 4=finalize (call __gc metamethods). Returns work units consumed. Core of Lua's incremental garbage collector (luaC_step).
0x0052E000274lua_gc__sweep_objects_0052e000Lua GC: Sweeps objects from the allgc list. Iterates through linked GC objects, freeing dead (white) objects and keeping live ones. Handles different object types: string (4), table (5), closure (6), userdata (7), thread (8), proto (9), upval (10). Returns pointer to last processed link. param_3 limits objects processed per call.
0x0052E130324lua_gc__traverse_closure_0052e130Lua GC: Traverses a closure object during mark phase. For Lua closures (type 0): marks the proto and env, then marks each upvalue (GC objects get marked, non-GC upvalues get linked to gray list). For C closures (type != 0): iterates upvalue slots and marks any GC-reachable objects.
0x0052E290434lua_gc__traverse_table_0052e290Lua GC: Traverses a table during mark phase. Checks for __mode metamethod to detect weak tables (k=weak keys, v=weak values). Marks metatable if present. For non-weak tables, marks array elements and hash keys/values. Returns 1 if table has weak references (added to weak list), 0 otherwise. Clears dead keys (sets to nil type 11).
0x0052E45062lua_gc__register_base_libs_0052e450Lua: Registers base library functions into the Lua state. Iterates through a table at PTR_DAT_010da2b0 containing function pointer/name pairs, pushing each as a C closure and setting it as a global. Starts with luaopen_base. This is part of Lua's library initialization (luaL_openlibs equivalent).
0x0052E490154lua_io__tostring_0052e490Lua io library: __tostring metamethod for FILE* userdata. Returns "file (ADDR)" for open files, "closed file" for closed files, or nil if not a FILE userdata. Checks metatable against the FILE* metatable in the registry.
0x0052E530118lua_io__close_dispatch_0052e530Lua io library: io.close() dispatch function. If no argument, closes default output file. Otherwise checks the FILE* userdata, validates it's open, retrieves the __close function from the file's environment table, and calls it. The __close function varies: fclose for regular files, pclose for popen files, error for stdin/stdout.
0x0052E5B074lua_io__gc_0052e5b0Lua io library: __gc metamethod for FILE* userdata. Called when a file object is garbage collected. If the file is still open, retrieves and calls the __close function from the environment to close it. Returns 0 (no results pushed).
0x0052E60076lua_io__tostring_file_0052e600Lua io library: Alternate __tostring for FILE*. Returns "file (closed)" if closed, or "file (0xADDR)" format string with the FILE* pointer value if open. Uses lua_api_pushfstring with "file (%p)" format.
0x0052E650216lua_io__open_0052e650Lua io library: io.open(filename, mode) implementation. Creates a new FILE* userdata, sets the FILE metatable, calls fopen(). On success returns the userdata. On failure returns nil, error message (formatted as "filename: strerror"), and errno.
0x0052E730216lua_io__popen_0052e730Lua io library: io.popen(command, mode) implementation. Creates FILE* userdata, sets metatable, calls _popen(). On success returns userdata. On failure returns nil, error string, errno. Identical structure to io.open but uses _popen instead of fopen.
0x0052E810124lua_io__tmpfile_0052e810Lua io library: io.tmpfile() implementation. Creates FILE* userdata, sets metatable, calls tmpfile(). On success returns userdata. On failure returns nil, error string, errno.
0x0052E89023lua_io__input_0052e890Lua io library: io.input([file]) implementation. Wrapper that calls the set-default-io helper with index 1 (stdin slot) and read mode "r". Sets or returns the default input file.
0x0052E8B023lua_io__output_0052e8b0Lua io library: io.output([file]) implementation. Wrapper that calls the set-default-io helper with index 2 (stdout slot) and write mode "w". Sets or returns the default output file.
0x0052E8D082lua_io__lines_method_0052e8d0Lua io library: file:lines() method. Validates the FILE* userdata is open, pushes the file and a false flag (don't close on finish) as upvalues, then returns a C closure of the lines iterator function. Returns 1 value (the iterator).
0x0052E930281lua_io__lines_global_0052e930Lua io library: io.lines([filename]) implementation. If no argument, returns iterator for default input (like file:lines). If filename given, opens the file, creates an iterator closure with close-on-finish=true flag, so the file auto-closes when iteration ends.
0x0052EA5073lua_io__read_default_0052ea50Lua io library: io.read(...) implementation. Reads from the default input file (slot 1 in io env table). Gets the FILE* from the registry, validates it's open (errors with "standard input file is closed"), then delegates to the generic read helper starting at arg 1.
0x0052EAA064lua_io__read_method_0052eaa0Lua io library: file:read(...) method. Validates the FILE* userdata is open, then delegates to the generic read helper starting at arg 2 (skipping self).
0x0052EAE073lua_io__write_default_0052eae0Lua io library: io.write(...) implementation. Writes to the default output file (slot 2 in io env table). Gets the FILE* from the registry, validates it's open (errors with "standard output file is closed"), then delegates to the generic write helper starting at arg 1.
0x0052EB3064lua_io__write_method_0052eb30Lua io library: file:write(...) method. Validates the FILE* userdata is open, then delegates to the generic write helper starting at arg 2 (skipping self).
0x0052EB70181lua_io__seek_0052eb70Lua io library: file:seek(whence, offset) method. Validates FILE*, calls fseek with the chosen whence (set/cur/end from option table), then ftell to get position. On success returns position. On failure returns nil, strerror, errno.
0x0052EC30177lua_io__setvbuf_0052ec30Lua io library: file:setvbuf(mode, size) method. Validates FILE*, calls setvbuf() with mode from option table (no/full/line buffering) and optional buffer size (default 512). On success returns true. On failure returns nil, strerror, errno.
0x0052ECF0146lua_io__flush_default_0052ecf0Lua io library: io.flush() implementation. Flushes the default output file (slot 2 in io env table). Calls fflush(). On success returns true. On failure returns nil, strerror, errno.
0x0052ED90137lua_io__flush_method_0052ed90Lua io library: file:flush() method. Validates the FILE* userdata is open, calls fflush(). On success returns true. On failure returns nil, strerror, errno.
0x0052EE206lua_io__get_scan_buffer_0052ee20Lua io library: Returns pointer to a static scan buffer (DAT_0173eca8). Used by fscanf-based number reading for io.read("*n").
0x0052EE3051lua_io__close_file_aux_0052ee30Lua io library: Auxiliary close helper. Gets the __close function from the file's environment table and calls it. Used by the lines iterator and io.close to dispatch to the correct close function (fclose, pclose, or standard-file error).
0x0052EE7062lua_io__file_error_0052ee70Lua io library: File error formatting helper. Gets errno, formats error message as "filename: strerror", then calls luaL_argerror. Used when file operations fail during io.input/io.output set operations.
0x0052EEB036lua_io__fscanf_wrapper_0052eeb0Lua io library: Wrapper around __stdio_common_vfscanf for reading numbers. Called by io.read("*n") to scan a number from a FILE* stream. Gets scan buffer via get_scan_buffer helper.
0x0052EEE0210lua_io__set_default_file_0052eee0Lua io library: Sets or gets the default input/output file. If arg 1 is a string, opens the file with the given mode and stores in the env table at slot param_2. If arg 1 is a FILE* userdata, stores it directly. If no argument, just returns the current default. Used by io.input() and io.output().
0x0052EFC0493lua_io__read_helper_0052efc0Lua io library: Generic file read helper. Supports format strings: "*l" (read line), "*a" (read all), "*n" (read number), and numeric arg (read N bytes). If no args, defaults to read line. Calls clearerr before reading. On ferror, returns nil+error+errno. Returns number of results pushed.
0x0052F1B0226lua_io__write_helper_0052f1b0Lua io library: Generic file write helper. Iterates through Lua arguments starting at param_3. Numbers are formatted with "%.14g", strings use fwrite. On success returns true. On failure returns nil, strerror, errno. Used by both io.write() and file:write().
0x0052F2A0119lua_io__fclose_0052f2a0Lua io library: __close function for regular files. Calls fclose() on the FILE*, sets the userdata to NULL. On success returns true. On failure returns nil, strerror, errno. Stored in the file's environment table as __close.
0x0052F32036lua_io__noclose_0052f320Lua io library: __close function for standard files (stdin/stdout/stderr). Always returns nil + "cannot close standard file". Prevents closing standard I/O handles.
0x0052F350122lua_io__pclose_0052f350Lua io library: __close function for popen'd files. Calls _pclose() on the FILE*, sets userdata to NULL. On success (return != -1) returns true. On failure returns nil, strerror, errno. Set as __close for files created by io.popen().
0x0052F3D0167lua_io__lines_iterator_0052f3d0Lua io library: Iterator function for io.lines/file:lines. Reads one line from the upvalue FILE*. On ferror, raises an error. If line read succeeds, returns 1 (the line). If EOF and upvalue 2 is true (close-on-finish), closes the file and returns 0. Used as the C closure returned by lines().
0x0052F6B0208lua_io__read_bytes_0052f6b0Lua io library: Reads N bytes from a file (for io.read(N) or "*a" mode). Uses luaL_Buffer to accumulate data in 512-byte chunks via fread. If param_3=0, reads until EOF (for "*a"). Pushes result string. Returns 1 on success (data read), 0 if nothing read and param_3 was not fully consumed.
0x0052F780247lua_io__read_line_0052f780Lua io library: Reads one line from a file (for io.read("*l")). Uses luaL_Buffer with fgets in 512-byte chunks. Strips trailing newline. Returns true if a line was read, false on EOF with no data. Used by both read() and the lines iterator.
0x0052F88096lua_lex__check_next_0052f880Lua lexer: check_next - checks if current character matches any char in the given string. If match found, saves current char to token buffer and advances to next char. Returns 1 if matched, 0 otherwise. Used during number and dot token parsing.
0x0052F8E0143lua_lex__inclinenumber_0052f8e0Lua lexer: inclinenumber - handles newline sequences (LF, CR, CRLF, LFCR). Advances past the newline, increments line counter. If the next char is a different newline type (e.g., CR after LF), consumes it too (CRLF/LFCR support). Errors if line count exceeds MAX_INT-3.
0x0052F9701380lua_lex__llex_0052f970Lua 5.1 internal: lua lex llex 0052f970
0x0052FF8073lua_lex__init_reserved_words_0052ff80Lua lexer: Initializes the 21 reserved words (and, break, do, else, elseif, end, false, for, function, if, in, local, nil, not, or, repeat, return, then, true, until, while). Interns each string, sets the FIXEDGC bit (0x20) and stores keyword index+1 in the reserved byte field.
0x0052FFD0214lua_lex__syntax_error_0052ffd0Lua lexer: luaX_syntaxerror - raises a syntax error with location info. Formats error as "source:line: message near 'token'". For string/number/name tokens, shows the actual token text. For control chars, shows "char(N)". Calls luaD_throw(3) to raise the error.
0x005300B026lua_lex__next_005300b0Lua lexer: luaX_next - advances to the next token. Calls llex() to scan the next token, storing the token type in ls->t.token and semantic info in ls->t.seminfo.
0x005300D088lua_lex__intern_string_005300d0Lua lexer: luaX_newstring - interns a string during parsing. Creates or finds the string in the global string table, then anchors it in the parser's string table (so it won't be GC'd during parsing). If the string table grows past the GC threshold, triggers a GC check.
0x0053013059lua_lex_next_tokenLua lexer: advances to next token. Copies current lookahead into previous token, then reads next token from input stream (luaX_next).
0x00530170140lua_lex_initLua lexer: initializes lexer state (luaX_setinput). Sets up ZIO reader, allocates token buffer (32 bytes initial), reads first character from input stream.
0x0053020023lua_lex_syntax_errorLua lexer: reports syntax error for current token. Wrapper around luaX_lexerror passing current token type.
0x0053022071lua_lex_token_to_stringLua lexer: converts token code to printable string (luaX_token2str). For ASCII chars, formats as "char(N)" or single char. For reserved words/multi-char tokens, returns name from token table.
0x00530270190lua_lex_read_long_stringLua lexer: reads a long string or long comment delimited by [==[ ... ]==] (read_long_string). Handles newline normalization, nesting warnings, and EOF detection.
0x005304D0390lua_lex_read_numberLua 5.1 internal: lua lex read number
0x00530660311lua_lex_read_stringLua lexer: reads quoted string with escape sequences
0x00530A10190lua_lex_save_charLua lexer: appends char to token buffer
0x00530AD0325lua_lex_skip_separatorLua lexer: counts separator level for long strings
0x00530C2056lua_math_absLua math.abs - absolute value
0x00530C6054lua_math_sinLua math.sin - sine in radians
0x00530CA060lua_math_sinhLua math.sinh - hyperbolic sine
0x00530CE054lua_math_cosLua math.cos - cosine in radians
0x00530D2060lua_math_coshLua math.cosh - hyperbolic cosine
0x00530D6054lua_math_tanLua math.tan - tangent in radians
0x00530DA060lua_math_tanhLua math.tanh - hyperbolic tangent
0x00530DE054lua_math_asinLua math.asin - arc sine
0x00530E2054lua_math_acosLua math.acos - arc cosine
0x00530E6054lua_math_atanLua math.atan - arc tangent
0x00530EA077lua_math_atan2Lua math.atan2 - arc tangent of y/x
0x00530EF057lua_math_ceilLua math.ceil - smallest int >= arg
0x00530F3057lua_math_floorLua math.floor - largest int <= arg
0x00530F7077lua_math_fmodLua math.fmod - remainder of x/y
0x00530FC085lua_math_modfLua math.modf - integral and fractional parts
0x0053102074lua_math_sqrtLua math.sqrt - square root
0x0053107074lua_math_powLua 5.1 internal: lua math pow
0x005310C054lua_math_logLua math.log - natural logarithm
0x0053110054lua_math_log10Lua math.log10 - base-10 log
0x0053114054lua_math_expLua 5.1 internal: lua math exp
0x0053118040lua_math_degLua math.deg - radians to degrees
0x005311B040lua_math_radLua math.rad - degrees to radians
0x005311E063lua_math_frexpLua math.frexp - mantissa and exponent
0x0053122059lua_math_ldexpLua math.ldexp - m*2^e
0x00531260115lua_math_minLua math.min - minimum of args
0x005312E0115lua_math_maxLua math.max - maximum of args
0x00531360323lua_math_randomLua math.random - pseudo-random number
0x005314B027lua_math_randomseedLua math.randomseed - sets seed
0x005314D0130lua_open_math_libLua luaopen_math - registers math lib
0x00531560188lua_mem_growvectorLua luaM_growaux_ - grows dynamic array
0x0053162069lua_mem_reallocLua luaM_realloc_ - core memory realloc
0x0053167023lua_mem_toobig_errorLua luaM_toobig - alloc error
0x00531690103lua_pkg_ll_loadlib_luaLua package.loadlib(path, funcname) - Lua-facing wrapper. Calls ll_loadlib, returns function on success or nil+errmsg+errtype on failure (ll_module).
0x00531700436lua_pkg_requireLua require() - loads module
0x005318C0468lua_pkg_moduleLua module() - creates module table
0x00531AA092lua_pkg_seeallLua package.seeall(module) - sets module's metatable __index to _G so module can access global environment. Creates metatable if needed.
0x00531B00302lua_pkg_find_fileLua package.searchpath - finds file
0x00531C3044lua_pkg_gc_loadlibLua LOADLIB __gc - FreeLibrary
0x00531C60253lua_pkg_loadlibLua ll_loadlib - LoadLibraryA+GetProcAddress
0x00531D60167lua_pkg_loader_cLua loader_C - standard C module loader. Searches cpath for module, handles '-' in name for luaopen_ prefix, calls ll_loadlib to load and get entry point.
0x00531E10150lua_pkg_loader_crootLua loader_Croot - C submodule loader. For dotted names (e.g. "a.b.c"), loads root library "a" from cpath and looks for luaopen_a_b_c entry point in it.
0x00531EB0105lua_pkg_loader_luaLua loader_Lua - loads .lua file
0x00531F20114lua_pkg_loader_preloadLua loader_preload - from preload table
0x00531FA055lua_pkg_loaderrorLua ll_loadfunc error msg
0x00531FE0318lua_open_package_libLua luaopen_package - registers package lib
0x0053212077lua_pkg_make_funcnameLua mkfuncname - luaopen_X name
0x00532170129lua_pkg_push_win32_errorLua ll_sys - FormatMessageA error
0x00532200244lua_pkg_set_pathLua setpath - path from env var
0x00532300336lua_obj_chunkidLua luaO_chunkid - shortened source name
0x0053245027lua_obj_fb2intLua luaO_fb2int - float byte to int
0x0053247044lua_obj_int2fbLua luaO_int2fb - int to float byte
0x005324A040lua_obj_log2Lua luaO_log2 - ceil(log2(x))
0x005324D023lua_obj_pushfstring_vaLua luaO_pushfstring - variadic format
0x005324F0713lua_obj_pushvfstringLua luaO_pushvfstring - format string
0x0053283077lua_obj_rawequalobjLua luaO_rawequalObj - TValue compare
0x00532890162lua_obj_str2numberLua luaO_str2d - string to number
0x0053294050lua_util_sprintfLua 5.1 internal: lua util sprintf
0x0053298043lua_os_executeLua os.execute - system()
0x005329B0118lua_os_removeLua os.remove - deletes file
0x00532A30131lua_os_renameLua os.rename - renames file
0x00532AC0108lua_os_tmpnameLua os.tmpname - temp filename
0x00532B3041lua_os_getenvLua os.getenv - env variable
0x00532B6051lua_os_clockLua os.clock - CPU time
0x00532BA0652lua_os_dateLua os.date - formats date/time
0x00532E30626lua_os_timeLua os.time - current time
0x005330B085lua_os_difftimeLua os.difftime - time difference
0x0053311073lua_os_setlocaleLua os.setlocale - sets locale
0x0053316026lua_os_exitLua os.exit - exit()
0x0053318031lua_open_os_libLua luaopen_os - registers os lib
0x005331A0121lua_parser_adjust_assignLua parser: multi-assignment adjust
0x0053322070lua_parser_register_localvarsLua parser: registers locals
0x00533270412lua_parser_assignmentLua parser: assignment statement
0x00533410128lua_parser_blockLua parser: block scope
0x00533490744lua_parser_funcbodyLua parser: function body
0x00533780102lua_parser_break_statLua parser: break statement
0x005337F0104lua_parser_check_matchLua parser: matching close token
0x00533860103lua_parser_check_nameLua parser: checks TK_NAME
0x005338D0131lua_parser_chunkLua parser: statement list
0x00533980429lua_parser_close_funcLua parser: closes func scope
0x00533B3048lua_parser_codestringLua parser: LOADK for string
0x00533B60636lua_parser_constructorLua parser: table constructor
0x00533DE088lua_parser_limit_errorLua parser: limit exceeded error
0x00533E4075lua_parser_explist1Lua parser: expression list
0x00533E90388lua_parser_forbodyLua parser: for-loop body
0x00534020391lua_parser_fornumLua parser: numeric for
0x005341B0595lua_parser_forstatLua parser: for statement
0x00534410340lua_parser_funcargsLua parser: function arguments
0x00534570493lua_parser_ifstatLua parser: if/elseif/else/end
0x00534760328lua_parser_indexupvalueLua parser: upvalue index
0x005348B0236lua_parser_luaY_parserLua luaY_parser - main parser entry
0x005349A0217lua_parser_new_localvarLua parser: new local variable
0x00534A80224lua_parser_open_funcLua parser: init FuncState
0x00534B60393lua_parser_primaryexpLua parser: primary expression
0x00534E00225lua_parser_recfieldLua parser: record field
0x00534EF074lua_parser_removevarsLua parser: removes locals
0x00534F40446lua_parser_repeatstatLua parser: repeat...until
0x00535100104lua_parser_singlevarLua parser: resolves variable
0x00535170242lua_parser_singlevarauxLua parser: recursive var lookup
0x005352701669lua_parser_statementLua parser: statement dispatch
0x00535960678lua_parser_subexprLua parser: sub-expression
0x00535E10147lua_parser_test_then_blockLua parser: condition then block
0x00535EB034lua_parser_testnextLua parser: test and consume token
0x00535EE088lua_parser_yindexLua parser: [expr] index
0x00535F4016lua_state_freeall_objectsLua luaC_freeall - frees GC objects
0x00535F50135lua_state_close_stateLua close_state - destroys state
0x00535FE0116lua_state_init_stateLua f_luaopen - initializes core state
0x0053606077lua_state_free_threadLua 5.1 internal: lua state free thread
0x005360B095lua_state_new_threadLua luaE_newthread - new coroutine
0x0053611090lua_state_lua_closeLua 5.1 internal: lua state lua close
0x00536170349lua_state_lua_newstateLua 5.1 internal: lua state lua newstate
0x005362D0101lua_state_preinit_threadLua 5.1 internal: lua state preinit thread
0x00536340137lua_state_stack_initLua stack_init - allocates stacks
0x005363D0628lua_string_newlstrLua luaS_newlstr - interned string
0x00536650100lua_string_newudataLua 5.1 internal: lua string newudata
0x005366C0223lua_string_resizeLua luaS_resize - string hash table
0x005367A041lua_str_lenLua 5.1 internal: lua str len
0x005367D0162lua_str_subLua 5.1 internal: lua str sub
0x00536880192lua_str_reverseLua 5.1 internal: lua str reverse
0x00536940179lua_str_lowerLua 5.1 internal: lua str lower
0x00536A00179lua_str_upperLua 5.1 internal: lua str upper
0x00536AC0144lua_str_repLua 5.1 internal: lua str rep
0x00536B50209lua_str_byteLua 5.1 internal: lua str byte
0x00536C30186lua_str_charLua 5.1 internal: lua str char
0x00536CF0128lua_str_dumpLua 5.1 internal: lua str dump
0x00536D7018lua_str_findLua 5.1 internal: lua str find
0x00536D9018lua_str_matchLua 5.1 internal: lua str match
0x00536DB067lua_str_gmatchLua 5.1 internal: lua str gmatch
0x00536E0021lua_str_gfind_nodefLua string.gfind - deprecated
0x00536E20461lua_str_gsubLua 5.1 internal: lua str gsub
0x00536FF0524lua_str_formatLua 5.1 internal: lua str format
0x005375C0442lua_str_add_valueLua gsub: applies replacement
0x00537790113lua_str_pattern_classendLua pattern: class end position
0x00537810260lua_str_gmatch_auxLua 5.1 internal: lua str gmatch aux
0x00537920139lua_open_string_libLua 5.1 internal: lua open string lib
0x005379B01023lua_str_pattern_matchLua pattern: recursive match engine
0x00537E20238lua_str_match_classLua pattern: char class test
0x00537F60350lua_str_matchbracketclassLua pattern: bracket [set] match
0x00538110147lua_str_max_expandLua pattern: greedy quantifier
0x005381B0212lua_str_push_capturesLua pattern: push all captures
0x00538290148lua_str_push_one_captureLua pattern: push single capture
0x0053833076lua_str_start_captureLua pattern: begin capture
0x00538380717lua_str_find_auxLua str_find_aux - find/match impl
0x0053865024lua_str_writerLua dump writer callback
0x0053867069lua_table_hashnumLua 5.1 internal: lua table hashnum
0x005386C084lua_table_freeLua luaH_free - frees table
0x00538720159lua_table_mainposition_getLua luaH_get - table key lookup
0x005387C0236lua_table_getnLua luaH_getn - table array length
0x005388B0146lua_table_getnumLua luaH_getnum - int key lookup
0x0053895057lua_table_getstrLua luaH_getstr - string key lookup
0x0053899094lua_table_newLua luaH_new - creates empty table
0x005389F0383lua_table_nextLua luaH_next - table iteration
0x00538B7063lua_table_rehash_resizeLua luaH_resizearray
0x00538BB0230lua_table_newkeyLua luaH_set - sets value for key
0x00538CA070lua_table_setnumLua luaH_setnum - sets int key
0x00538CF089lua_table_setstrLua luaH_setstr - sets string key
0x00538D50147lua_table_mainpositionLua mainposition - hash node for key
0x00538E00243lua_table_newkey_insertLua luaH_newkey - inserts new key
0x00538F00591lua_table_rehashLua rehash - computes optimal sizes
0x00539150404lua_table_resizeLua luaH_resize - resizes table
0x005392F0106lua_table_resize_arrayLua setarrayvector - reallocs array
0x00539360199lua_table_resize_hashLua setnodevector - allocs hash nodes
0x00539430133lua_tbl_foreachiLua table.foreachi - deprecated
0x005394C0133lua_tbl_foreachLua table.foreach - deprecated
0x00539550149lua_tbl_maxnLua table.maxn - largest numeric key
0x005395F043lua_tbl_getnLua table.getn - table length
0x0053962047lua_tbl_setnLua table.setn - deprecated
0x00539650164lua_tbl_insertLua table.insert - inserts at position
0x00539700144lua_tbl_removeLua table.remove - removes at position
0x00539790345lua_tbl_concatLua table.concat - concatenates with sep
0x005398F095lua_tbl_sortLua table.sort - sorts in-place
0x00539950945lua_tbl_sort_quicksortLua table.sort: quicksort impl
0x00539D1031lua_open_table_libLua luaopen_table - registers table lib
0x00539D30110lua_tbl_sort_compareLua sort_comp - custom or default compare
0x00539DA043lua_tm_fastgetLua luaT_gettm - metamethod lookup
0x00539DD079lua_tm_gettmbyobjLua luaT_gettmbyobj - metamethod by object type
0x00539E2084lua_tm_init_stringsLua luaT_init - interns metamethod names
0x00539E80154lua_cli_dofileLua CLI: loads and executes file via luaL_loadfile
0x00539F20177lua_cli_dostringLua CLI: loads and executes string
0x00539FE0581lua_cli_dotty_replLua CLI: interactive REPL loop
0x0053A230469lua_cli_handle_scriptLua CLI: handles script with arg table
0x0053A41039lua_cli_sigint_handlerLua CLI: SIGINT signal handler
0x0053A44033lua_cli_sigint_hookLua CLI: debug hook for SIGINT
0x0053A470166lua_cli_mainLua CLI: main entry point
0x0053A520743lua_cli_pmainLua CLI: protected main, processes args
0x0053A91046lua_cli_print_versionLua CLI: prints Lua 5.1.4 version
0x0053A940299lua_cli_pushlineLua CLI: reads line from stdin with prompt
0x0053AA70160lua_cli_report_errorLua CLI: reports error to stderr
0x0053AB10162lua_cli_tracebackLua CLI: error handler with debug.traceback
0x0053ABC0755lua_undump_constantsLua luaU: loads constants and sub-protos
0x0053AED0756lua_undump_debug_infoLua luaU: loads debug info from bytecode
0x0053B1D0591lua_undump_functionLua luaU: loads complete Proto from bytecode
0x0053B420108lua_undump_read_intLua luaU: reads 4-byte int from bytecode
0x0053B490155lua_undump_read_stringLua luaU: reads length-prefixed string
0x0053B53028lua_undump_make_headerLua luaU_header - 12-byte header
0x0053B550250lua_undump_luaU_undumpLua luaU_undump - loads precompiled bytecode
0x0053B650491lua_vm_arithLua luaV_arith - arithmetic with coercion and metamethods
0x0053B860162lua_vm_call_tmCalls a tag method: pushes TM + args on stack, invokes it, copies result back to target
0x0053B910120lua_vm_call_order_tmCalls ordering tag method (__lt/__le) on two operands, returns 0/1/-1
0x0053B990134lua_vm_get_equalTMGets __eq tag method from two metatables, returns TM only if both have same handler
0x0053BA20127lua_string_compare_localeCompares two Lua strings using strcoll for locale-aware ordering
0x0053BAA0668lua_vm_concatConcatenates Lua values on stack, converting numbers to strings and using __concat TM
0x0053BD40169lua_vm_equalobjTests equality of two Lua objects with __eq metamethod support for tables/userdata
0x0053BE105658lua_vm_executeMain Lua VM execution loop: decodes/dispatches all opcodes (MOVE,LOAD,ARITH,CALL,etc)
0x0053D4F0228lua_vm_gettableTable index operation with __index metamethod chain, max 100 iterations
0x0053D5E0108lua_vm_lessthanLess-than comparison for numbers, strings (locale), or via __lt metamethod
0x0053D650404lua_vm_settableTable assignment with __newindex metamethod chain, max 100 iterations, handles GC barrier
0x0053D7F073lua_vm_tonumberConverts a Lua value to number: returns as-is if number, converts string via str2number
0x0053D840136lua_vm_tostringConverts a number value to string in-place using sprintf with %.14g format
0x0053D8D062lua_zio_getcReads one byte from a Lua ZIO stream, refilling buffer via reader callback if needed
0x0053D91039lua_zio_initInitializes a Lua ZIO stream with reader function, data pointer, and lua_State
0x0053D94069lua_zio_lookaheadPeeks at next byte in ZIO stream without consuming it, refills buffer if empty
0x0053D99085lua_zio_buffer_ensureEnsures ZIO buffer has at least param_3 bytes capacity, grows with min 32 bytes
0x0053D9F0109lua_zio_readReads param_3 bytes from ZIO stream into buffer, refilling via reader callback as needed
0x0053DA60792lua_debug_print_codePrints disassembly of Lua bytecode instructions with opcode names and operands
0x0053DDC0413lua_debug_print_constantPrints a Lua constant value with escape sequences for special chars in strings
0x0053E000516lua_debug_print_constantsPrints all constants of a Lua prototype including nil, bool, number, and string values
0x0053E2A0462lua_debug_print_functionRecursively prints Lua function prototype info: instructions, constants, locals, upvalues
0x0053E47048lua_debug_printfWrapper for fprintf to stdout used by Lua debug print functions
0x0059FC70322lua_quest_add_objective_textLua callback: adds quest objective text
0x0059FDC0331lua_quest_set_npc_imageLua callback: sets quest NPC portrait image
0x0059FF10892lua_quest_add_reward_itemsLua callback: adds reward items to quest
0x005A02901366lua_quest_load_resource_entriesLua callback: loads quest resource entries from Lua args into unordered_map. Args: (category_id, sub_id, strip_leading_slash, count, path1, path2, ...). Converts codepage strings, optionally strips leading '/' from paths, inserts into resource map and calls CEmotionMgr to create sortable list items.
0x005A07F0331lua_quest_set_npc_name_from_tableLua callback: sets NPC name from quest data table
0x005A0940567lua_quest_add_hunting_targetLua callback: adds hunting target to quest
0x005A0B80346lua_quest_add_mob_id_to_groupLua callback: adds mob ID to quest mob group
0x005A0CE0962lua_quest_register_sale_eventLua callback: registers item sale event with date validation
0x005B8D50121CLuaState__constructConstructs Lua state wrapper; sets vtable, allocates 4-byte state ptr, registers with Lua manager
0x005B8DE0105CLuaState__destructDestroys Lua state wrapper; unregisters from manager, closes Lua state, frees 4-byte allocation
0x005B8E5030CLuaState__scalar_dtor_4byteScalar deleting destructor for 4-byte Lua state object; frees if flag bit 0 set
0x005B8E70126CLuaState__scalar_dtor_8byteScalar deleting destructor for 8-byte Lua state wrapper; destroys state, frees if flag bit 0 set
0x00673C50562lua_insert_pet_evolution_recipeLua callback: InsertRecipe for pet evolution. Takes 4 number args from Lua stack: PetEgg item ID, Revolution PetEgg item ID, material item ID, material count. Validates all args are numbers and valid pet item IDs, then calls the recipe insertion helper. Returns (bool, string) on Lua stack.
0x00673E90357lua_insert_pet_auto_feedingLua callback: InsertPetAutoFeeding. Takes 1 number arg (pet egg item ID), validates it, then calls the auto-feeding insertion helper. Returns (bool, string) on Lua stack.
0x006BCB90112lua_get_job_group_typeLua binding: maps DAT_01733c60 job class ID to job group type (0-0x27), returns via json_internal
0x006BCE30485lua_get_option_sub_indexLua binding: maps job class ID to sub-index per option type (1-4), returns result via json_internal
0x006BD3C0663lua_get_option_handler_resultLua binding: looks up option by hash in global option manager, invokes handler vtable call, returns result
0x006BD660876lua_get_shop_item_priceLua binding: looks up item ID, constructs CShopItem, returns item price from local_a4 field
0x006BD9D0772lua_get_option_enabled_stateLua binding: initializes option manager if needed, looks up option by hash, returns enabled state
0x006BDCE0663lua_get_option_handler_result_2Lua binding: looks up option by hash in global option manager, invokes handler vtable call, returns int result
0x006BDF80863lua_get_shop_item_atoi_fieldLua binding: looks up item, constructs CShopItem, returns atoi of a string field from item data
0x006BE2F0175lua_get_option_manager_dispatchLua binding: initializes option manager, calls vtable dispatch on it, returns result via json_internal
0x006BE3A0732lua_get_sprite_name_without_rswLua binding: gets sprite name from player actor, strips ".rsw" extension, returns string result
0x006BE68053lua_get_pet_intimacy_levelLua binding: returns pet intimacy level as a number. Wraps get_pet_intimacy_level() for Lua access.
0x006BE6C046lua_get_current_job_idLua binding: returns the current job class ID by calling ItemBonus__get_job_group_from_skill_id and pushing the result as a number
0x006BE6F0839lua_get_shop_item_custom_valueLua binding: looks up item, constructs CShopItem, returns custom int value from item field offset 0xcc
0x006BEA40487lua_get_skill_group_countLua binding: takes a numeric argument, looks up skill group via CSkillMgr, returns count field at offset 0x10 from the found entry
0x006BEC30545lua_get_option_infoLua binding: retrieves option information from global game settings data
0x006BEFA0671lua_get_option_dataLua binding: retrieves option data from the game settings system
0x006BF24054lua_get_server_type_flagLua binding: returns 2 if DAT_0173823c==1 (server type flag), else 0, via json_internal
0x006BF280359lua_dispatch_chat_messageLua binding: takes a string argument, converts codepage encoding, and dispatches it as a chat message via CUIWindowMgr__dispatch_chat_message with color 0xFFFF
0x006BF3F0882lua_process_option_configLua binding: processes option configuration data with multiple json reads and returns status
0x007A7DB0230CLuaScript__FormatErrorStringFormats an error string using vsprintf into a 2048-byte buffer, then constructs an std::string from it. Used for Lua script error messages.
0x007A80B0542CLuaScript__RegisterEffectCallbackLua callback to register an effect callback. Validates args (1st=number, 2nd=string), gets effect ID, creates callback entry in vector. Returns 2.
0x007A82D0460CLuaScript__RegisterItemEffectCallbackLua callback to register an item effect callback. Takes 3 number args (item ID, color value, effect ID). Validates args and stores in effect callback data. Returns 2.
0x007A8FB0126CLuaScriptError__ctorConstructor for CLuaScriptError exception. Inherits from std::exception, copies error message, sets vtable chain.
0x007A9510103CLuaScriptError__scalar_deleting_dtorScalar deleting destructor for CLuaScriptError. Calls base exception destructor and optionally frees 0xC bytes.
0x007AE600754lua_CTipBox__AddPageExLua callback for AddPageEx in tip box system. Takes 8 numeric arguments from Lua stack: tip ID, page index, and 6 values for a 0x1C-byte page entry (coordinates/dimensions/scale). Validates all args are numbers, finds/creates the tree map entry, and pushes the page entry into the entry's vector. Returns 2 Lua values.
0x007AE900277lua_CTipBox__AddImgcoordLua callback for AddImgcoord in tip box system. Takes 3 numeric arguments: tip ID, width, height. Validates args are numbers, finds/creates tree map entry, sets image dimensions at offsets +0x44 and +0x48 in the entry. Returns 2 Lua values.
0x007AEA20202lua_CTipBox__AddIsTagLua callback for AddIsTag in tip box system. Takes 2 number args: tip ID and flag value (bool). Finds/creates the tree map entry by key, sets boolean at offset +0x34. Returns 2 Lua values (success bool + message string).
0x007AEAF0262lua_CTipBox__AddPageLua callback for AddPage in tip box system. Takes a number (tip ID) and string (page text) from Lua stack. Adds the string entry to the CTreeMap node's string vector via CTreeMap__add_string_entry. Returns 2 Lua values.
0x007AEC00486lua_CTipBox__AddTipLua callback for AddTip in tip box system. Takes 4 args: number (tip ID), string (name), number (type flag), string (description). Creates/updates CTreeMap entry with name, boolean flag (type==1), and description. Returns 2 Lua values.
0x0083BAF094lua_callback_navigate_to_npcLua callback that navigates to an NPC. Reads NPC ID string from vector element 0, converts to int with atoi, then calls navigation function (type 6) via FUN_00d678e0.
0x0083BB50101lua_callback_show_item_infoLua callback that shows item info. Reads item ID string from vector element 0, converts to int with atoi, then opens item info window (0x13B) via UIWindow__handle_event.
0x0083BBC0186lua_callback_open_urlLua callback that opens a URL in the default browser. Reads URL string from vector, calls ShellExecuteA with "open" action and SW_SHOW.
0x00941870310lua_add_item_to_exception_minimap_pos_listLua callback for 'AddItmeToExceptionMiniMapPosList'. Reads map name string (arg 1) and x,y coordinates (args 2,3) from Lua state. Inserts into a string-keyed map via std__map_string__find_or_insert_30, storing the x,y coordinates as floats.
0x009419B0442lua_add_item_to_kafra_service_map_listLua callback for 'AddItmeTokafraServiceMapList'. Reads category name (arg 1) and map name (arg 2) from Lua state. Inserts the map name string into a string-keyed std::map vector via std__map_string__find_or_insert_34, adding the map entry to the category's vector of maps.
0x00ADEA70293lua_callback_AddItemLua callback for AddItem in champion monster config. Validates that both arguments are numbers, reads monster ID and size from Lua stack, calls CRsmObjMgr__insert_or_update_entry. Pushes error string to Lua on validation failure. Returns 2 Lua values.
0x00ADEBA0370lua_callback_AddEffectLua callback for AddEffect in champion monster config. Validates both arguments are numbers, reads monster ID and effect ID from Lua stack, calls CRsmObjMgr__add_effect_to_entry on the global manager. Returns 2 Lua values.
0x00AE07A0975lua_callback_item_AddItemLua callback for AddItem in iteminfo Lua config. Takes 7 args: item ID (number), unidentified display name (string), unidentified resource name (string), identified display name (string), identified resource name (string), slot count (number), costume flag (number). Creates/updates cache entry with dimensions, name strings, and path strings. Returns 2 Lua values.
0x00AE0B70305lua_callback_AddItemEffectInfoLua callback for AddItemEffectInfo. Takes item ID and effect info number, stores at offset 0x88 of the cache entry.
0x00AE0CB0430lua_callback_AddItemIdentifiedDescLua callback for AddItemIdentifiedDesc. Takes item ID (number) and description string, appends the string to the identified description vector (offset 0x74) of the cache entry.
0x00AE0E60306lua_callback_AddItemIsCostumeLua callback for AddItemIsCostume. Takes item ID (number) and boolean flag, sets the costume flag (offset 0x84) on the cache entry to 1 if true, 0 if false.
0x00AE0FA0305lua_callback_AddItemPackageIDLua callback for AddItemPackageID. Takes item ID and package ID (both numbers), stores package ID at offset 0x8C of the cache entry.
0x00AE10E0430lua_callback_AddItemUnidentifiedDescLua callback for AddItemUnidentifiedDesc. Takes item ID (number) and description string, appends to the unidentified description vector (offset 0x38) of the cache entry.
0x00AFC86074lua_close_stateCloses a Lua state. Calls lua_close if the state pointer is non-null, then sets it to 0.
0x00AFC9A0887lua_call_functionCalls a Lua function by name. Pushes function via lua_getglobal, then pushes arguments based on format string: 'b'=bool, 'd'=int, 'l'=double, 's'=string, '>'=end args. Calls with pcall, retrieves return values by format. On error, shows MessageBox with Lua error string.
0x00AFCD90921lua_call_methodCalls a Lua method (table.function). Similar to lua_call_function but pushes both the table name and method name onto the Lua stack before calling. Uses same format string convention for args/returns.
0x00AFD24085lua_get_global_boolGets a global Lua variable as bool. Pushes global by name, checks if type is boolean (1), retrieves value via lua_toboolean, pops stack. Returns false if state is null or type mismatch.
0x00AFD2A0102lua_get_global_intGets a global Lua variable as integer. Pushes global by name, checks if type is number, retrieves value via lua_tonumber and converts to int. Returns -1 on type mismatch, 0 if state is null.
0x00AFD310379lua_get_global_stringGets a global Lua variable as string. Pushes global by name, checks if type is string, retrieves value via lua_tostring, constructs std::string result. Returns empty string on null state or type mismatch.
0x00AFD49057lua_check_global_is_tableChecks if a global Lua variable is a table. Pushes global by name, gets type. Returns 1 if type is 5 (LUA_TTABLE), 0 otherwise.
0x00AFD4D0848lua_get_table_as_sorted_listReads a Lua table field and returns its entries as a sorted linked list of integer values. Gets the field from Lua state, iterates with lua_next collecting integer values into a linked list, then merge-sorts the list before returning.
0x00AFD830432lua_call_table_functionCalls a function from a Lua table. Gets the global table, checks if type is 5 (table), builds format string based on arg type (0=d, 1=s, 2=l), then calls internal function dispatch. Returns result value or -1 on failure.
0x00AFD9E0517lua_call_table_function_get_stringCalls a Lua table function by field name and returns the string result. Builds the Lua function name from a type parameter (d/s/l suffix), calls lua_table_field_dispatch, and copies the returned C string into an STL string.
0x00AFDBF0104lua_set_and_call_table_fieldSets a field in a Lua table and calls it. Pushes number or string value (based on param_2: 0=number, 1=string), sets the table field, then checks if result is a table (type 5). Returns 1 if table, 0 otherwise.
0x00AFDC60255lua_table_field_dispatchDispatches a Lua table field access based on a format string. First char is key type (d=number, s=string) to push and get from table. Second char is return type (d=int, s=string, l=double) to retrieve from the result. Used by lua_call_table_function and lua_call_table_function_get_string.
0x00AFDD6067lua_load_and_execute_fileLoads a Lua buffer and executes it. Calls luaL_loadbuffer then lua_pcall. Returns 1 on success, 0 on failure or if the Lua state is null.
0x00AFDDB026lua_close_state_inlineInline version of lua_close_state. Calls lua_close if state is non-null, then zeroes the pointer.
0x00AFDDD054lua_reset_and_init_stateResets and reinitializes a Lua state. Closes the existing state if active, creates a new one with luaL_newstate, registers base libraries, and registers the game's global Lua functions.
0x00AFDE1067lua_create_new_threadCreates a new Lua thread (coroutine) from the existing state. If no state exists, creates a new one first. Stores the thread reference in param_2. Returns the thread pointer or 0 on failure.
0x00AFE7D0989lua_callback__change_data_directoryLua callback for c_ChangeDirectoryOfDatas. Retrieves directory paths from Lua arguments, builds source and destination path strings, checks if files need to be moved using _access, creates the destination directory recursively if needed, then renames (moves) the file. Returns 0 to Lua.
0x00AFEBD0126lua_callback__set_rgb_colorLua callback that reads 3 color components (R,G,B) from Lua arguments at indices 1,2,3, packs them into a single 24-bit RGB integer ((B<<16)\|(G<<8)\|R), adds an offset from DAT_010d9df0, and pushes the result back to Lua. Returns 1 (one return value).
0x00AFED50161lua_callback__add_need_skill_listLua callback for c_AddNeedSkillList. Reads 3 Lua args: skill ID, required skill ID, and required skill level. Validates all 3 are not -1, looks up the skill entry by ID via FUN_00e16510, and appends the (required_skill, required_level) pair to the skill's prerequisite list (offset 0x3C vector).
0x00AFEE00327lua_callback__add_skill_listLua callback for c_AddSkillList. Reads 6 args: skill ID, group, name string, max level, skill type, and flags. Constructs a CSkillEntry struct with these values and registers it with CSkillMgr. Compares the name against "empty" (0x6D65="em") to skip empty entries. Returns 1 to Lua.
0x00AFEF50201lua_callback__get_cmd_onoff_valueLua callback for c_GetCmdOnOffValue. Reads a setting name from Lua arg 1, ensures the global GameSettings singleton exists (allocates 0x58 bytes if null), queries the setting value. If the result type is 3, pushes the raw double value; otherwise pushes boolean (0 or 1). Returns 1 to Lua.
0x00AFF020282lua_callback__set_cmd_onoff_listLua callback for c_SetCmdOnOffList. Reads a setting name (arg 1) and a boolean value (arg 2) from Lua. Ensures GameSettings singleton exists. Gets the option config value for the name. Special-handles option 0xE5 by storing to DAT_01737a8c. Appends the (name, value) pair to the global settings vector at DAT_01737918. Returns 0.
0x00AFF1401261lua_callback__set_sub_chat_wnd_listLua callback for SetSubChatWndList. Reads window name (arg 1), option name (arg 2), and 4 numeric parameters (args 3-6). Checks if max chat window count (10) reached. Determines if it's an "On" type window vs other. Finds or creates the entry in a std::map keyed by integer, assigns the display parameters. Pushes the window index back to Lua. Returns 1.
0x00AFF630424lua_callback__set_sub_chat_wnd_optionLua callback for SetSubChatWndOption. Reads window name (arg 1), window index (arg 2), option index (arg 3), and value (arg 4). Looks up the chat window entry in the appropriate map ("On" vs other). Sets a boolean option flag at offset 0x2B + option_index in the entry. Returns 1.
0x00AFF7E0266lua_callback__trace_valueLua callback for TraceValue. Reads a string from Lua arg 1, shows it in a MessageBox with title "Lua error". Used for debugging/tracing Lua script values. Returns 1.
0x00AFF8F0529lua_callback__add_cashshop_banner2Lua callback for add_cashshop_banner2. Reads image path (arg 1) and link URL (arg 2) as strings. Finds the cash shop window (type 0x13E) via CUIWindowMgr, then adds a banner line to the text log with the image and URL strings. Returns 0.
0x00AFFB10529lua_callback__add_cashshop_bannerLua callback for add_cashshop_banner. Reads image path (arg 1) and link URL (arg 2) as strings. Finds the cash shop window (type 0x13E) via CUIWindowMgr, then adds a banner line to the text log with the image and URL strings. Returns 0. Nearly identical to add_cashshop_banner2.
0x00AFFD30560lua_callback__add_check_attendance_bannerLua callback for add_checkAttendance_banner. Reads image path (arg 1), URL (arg 2), and two integer parameters (args 3,4). Finds the attendance window (type 0x148), creates banner strings, and calls UICharListWnd__AddCharSlot to add the attendance banner entry. Returns 0.
0x00AFFF6082lua_callback__add_ingredientLua callback for add_ingredient. Reads item ID (arg 1) and amount (arg 2). Finds the crafting window (type 0x122) and calls stub_00601bc0 to add the ingredient. Returns 0.
0x00AFFFC062lua_callback__add_ingredient_lapineLua callback for add_ingredient_lapine_upgrade_box. Reads item ID from Lua arg 1, finds the lapine upgrade window (UIWindowMgr type 0x12E), and calls CSearchShopWnd__add_item_to_search_list to add the ingredient item. Returns 0.
0x00BAC770256lua_get_robe_sprite_nameCalls Lua function "ReqRobSprName" via the global Lua state (DAT_01738010) to get the robe/garment sprite name for a given parameter. Constructs and returns the result as an STL string. The Lua function returns a string which is copied into the output regardless of success/failure.
0x00D9E3F049CLuaState__ctorCLuaState constructor. Sets vtable to PTR_FUN_011a4514, stores param_2 at offset 0x10, zeros lua_State pointer (offset 4) and other fields. 0x18 bytes total.
0x00D9E43082CLuaState__dtorCLuaState destructor. Sets vtable, closes lua_State via lua_close if non-null, zeros pointer.
0x00D9E490103CLuaState__scalar_deleting_dtorCLuaState scalar deleting destructor. Closes lua_State if present, frees 0x18 bytes if param_2 bit 0 set.
0x00D9EAF0432lua_ai_attack_homunculusLua AI Attack function for homunculus. Reads owner and target IDs from Lua stack, validates entities, checks if target is dead/riding/mounted, sends attack packet 0x233 with rate limiting.
0x00D9ECA0354lua_ai_attack_mercenaryLua AI Attack function for mercenary. Similar to homunculus version but uses mercenary-specific entity checks and rate limiting globals.
0x00D9EE10220lua_ai_get_actorsLua AI GetActors. Returns table of all visible entity IDs to Lua. Iterates entity linked list, pushes each entity's ID (field 0x110) as key-value pairs. Includes own character ID.
0x00D9EEF0285lua_ai_get_msgLua AI GetMsg. Gets entity message data via virtual method 0xCC. Returns table with message type and params (varies by type: position, target, skill info).
0x00D9F0B0413lua_ai_get_res_msgLua AI GetResMsg. Similar to GetMsg but uses virtual method 0xD4 for response messages. Returns table with message type and parameters.
0x00D9F27055lua_ai_get_tickLua AI GetTick. Returns GetTickCount() as a double to Lua.
0x00D9F2B0175lua_ai_move_homunculusLua AI Move function for homunculus. Reads entity ID, x, y from Lua stack, validates entity, sends move packet via CNetworkSession.
0x00D9F415592lua_get_skill_target_positionLua API: calculates target cell position for skill use. Takes skill ID and level from Lua stack, computes position using skill attack range, acos/cos/sin for direction, and pathfinding fallback. Returns (x, y) cell coordinates.
0x00D9F8E01573lua_ai_move_mercenaryLua AI Move function for mercenary. Reads entity ID, x, y from Lua stack, validates entity, sends move packet via CNetworkSession.
0x00D9FF50361lua_ai_is_monsterLua AI IsMonster. Reads entity ID from Lua stack, checks if entity is a monster type. Returns boolean result to Lua.
0x00DA00D0388lua_ai_move_commandLua AI Move command. Reads entity ID and coordinates from Lua stack, sends movement command.
0x00DA0260146lua_ai_move_to_ownerLua AI MoveToOwner. Moves the AI-controlled entity to its owner's position.
0x00DA0300285lua_ai_skill_groundLua AI SkillGround. Uses ground-targeted skill. Reads skill ID, level, x, y from Lua stack and sends skill packet.
0x00DA0420521lua_ai_skill_objectLua AI SkillObject. Uses target-directed skill. Reads skill ID, level, target ID from Lua stack and sends skill packet.
0x00DA0630229lua_ai_traceLua AI Trace. Debug logging function. Reads string from Lua stack and outputs to debug trace.
0x00DA07201345lua_ai_trace_aiLua AI TraceAI. Extended debug trace for AI state. Logs AI behavior messages.
0x00DA0C70274lua_ai_trace_valueLua AI TraceValue. Debug function to trace variable values from Lua AI scripts.
0x00DA0D9067lua_ai_push_key_value_pairLua AI helper. Pushes a key-value pair (both ints) to Lua table at top of stack.
0x00DDBB601251lua_get_table_string_value_for_cRetrieves a string value from a Lua table for use in C code. Calls lua_get_global_string, sets up packet handlers via CPacketManager, then calls lua function "GetTableStringValueForC". Returns the string result in param_2 (STL string). If lua_get_global_string returns non-null, copies the result directly; otherwise invokes the Lua function to fetch it.
0x00DE0830167lua_get_real_weapon_idCalls the Lua function 'GetRealWeaponId' with the given weapon ID parameter. Returns the Lua result if the call succeeds, otherwise returns the input param unchanged.
0x00DE3800223lua_req_weapon_name_by_class_numCalls the Lua function 'ReqWeaponNameByClassNum' with the current item description data. Returns the string result or empty string if Lua call fails.
0x00E08A00314lua_call_HaveSkillEffectInfoAllocates a string "HaveSkillEffectInfo" and calls the corresponding Lua function via lua_call_function. Used to query Lua for skill effect information.
0x00E090E0259lua_get_default_option_value_floatCalls Lua function "l_GetDefaultOptionValue" with a parameter from this+23000. If the global DAT_0110f580 changes after the Lua call, returns that new float value; otherwise returns the passed-in default param_3.
0x00E091F0211lua_get_default_option_value_intCalls Lua function "l_GetDefaultOptionValue" with a parameter from this+23000. Returns the default value param_3 unchanged (Lua call may have side effects).
0x00E092D0407lua_get_default_option_value_stringCalls Lua function "l_GetDefaultOptionValue" with a parameter from this+23000. Initializes param_2 as an STL string and copies param_4 into it. Returns the string output parameter.
0x00E09790345lua_get_hotkey_configCalls Lua function "GetHotKey" to retrieve hotkey configuration for a given key index (param_2+1). Initializes output param_1 with two empty STL strings. On successful Lua call, copies the two returned strings into the output structure.
0x00E0A4C0419lua_get_original_hotkey_list_sizeCalls Lua function "GetOriginalHotKeyListSize". Always returns 0 regardless of the Lua result or the param_1 flag. The return value paths are all dead code returning 0.
0x00E0A670229lua_get_option_value_floatCalls Lua function "l_GetOptionValue" with a parameter from this+23000. If global DAT_0110f580 changes, returns the new float value; otherwise returns the default param_3.
0x00E0A760301lua_get_option_value_structCalls Lua function "l_GetOptionValue" with a parameter from this+23000. Copies 16 bytes from param_4 into param_2 (4 DWORDs). Used to retrieve structured option data.
0x00E0A890181lua_get_option_value_intCalls Lua function "l_GetOptionValue" with a parameter from this+23000. Returns param_3 unchanged (Lua call may have side effects on globals).
0x00E0A950375lua_get_option_value_stringCalls Lua function "l_GetOptionValue" with a parameter from this+23000. Initializes an STL string from param_4 and returns it in param_2.
0x00E0AC40202lua_get_pet_acc_act_nameCalls Lua function "GetPetAccActName" with a parameter from this+23000. Checks if the returned resource exists via CResourceMgr. Returns the resource pointer if valid, or a default string pointer if the Lua call fails or resource doesn't exist.
0x00E0AE00170lua_get_pet_food_itemCalls Lua function "GetPetFood" with a parameter from this+23000 and param_2. Returns the result integer from Lua if the call succeeds, or -1 (0xFFFFFFFF) if it fails.
0x00E0B170218lua_get_pet_illust_name_v3Calls Lua function "GetPetIllustName_V3" with a parameter from this+23000. Formats the result via lua_util_sprintf.
0x00E0B250195lua_get_pet_jtid_by_egg_itidCalls Lua function "GetPetJTID_by_PetEggITID" with a parameter from this+23000. Returns the pet job type ID from Lua, or -1 if the call fails.
0x00E12780169lua_get_pet_stringCalls Lua function "GetPetString" with a parameter from this+23000 and param_2. Returns the result integer from Lua if successful, or 0 if the call fails.
0x00E19110273lua_get_job_inherit_tableQueries Lua "JobInheritTable" and "JOB_INHERIT_LIST2" to determine the inherited job for a given job ID. Calls each table lookup as a function, preferring the result from JOB_INHERIT_LIST2 if it returns non -1.
0x00E19230315lua_get_title_stringCalls Lua function "GetTitleString" with param_2. Returns the resulting string in param_1 as an STL string. Returns empty string if Lua call fails.
0x00E1E250932lua_create_skill_effectsCreates visual and sound effects for a skill via Lua callbacks. Calls HaveSkillEffectInfo to check if effects exist, then GetEffectWaveFileName for sound, GetEffectNum for effect count, and GetEffectID for each effect. Creates effects via CEffectManager or CEntity depending on whether the effect is in the EffectMap.
0x00E24550898lua_check_have_skill_effect_infoCalls Lua function "HaveSkillEffectInfo" and returns the result masked (always returns 0 due to &0xFFFFFF00 mask). Appears to be a check-only call with side effects.
0x00E24DE0865lua_create_ground_skill_effectsCreates ground-targeted skill effects via Lua callbacks. Similar to lua_create_skill_effects but uses GetGroundEffectNum and GetGroundEffectID for ground-placed skills. Creates effects via CEffectManager or CGameMode depending on EffectMap lookup.
0x00E25970255lua_reset_hotkey_bindingsCalls Lua function "ResetTheHotKey" twice with different parameters to reset two hotkey bars (0x84/0xC0 and 0x87/0x24 at position 0x12, mode 1).