Lua
Lua 5.1: C API, VM, GC, parser, code gen, all standard libs, CLuaState, CLuaScript
| Address | Size | Name | Description |
|---|---|---|---|
| 0x00522930 | 101 | lua_f_Ccall | lua_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. |
| 0x005229A0 | 24 | lua_api_f_call | Helper 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. |
| 0x005229C0 | 177 | lua_api_index2adr | lua_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). |
| 0x00522A80 | 38 | lua_api_pushvalue_raw | Low-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). |
| 0x00522AB0 | 20 | lua_api_atpanic | lua_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). |
| 0x00522AD0 | 57 | lua_api_call | lua_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. |
| 0x00522B10 | 106 | lua_api_checkstack | lua_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. |
| 0x00522B80 | 117 | lua_api_concat | lua_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. |
| 0x00522C00 | 52 | lua_api_cpcall | lua_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. |
| 0x00522C40 | 63 | lua_api_createtable | lua_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. |
| 0x00522C80 | 53 | lua_api_dump | Lightweight 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. |
| 0x00522CC0 | 84 | lua_api_equal | lua_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. |
| 0x00522D20 | 18 | lua_api_error | lua_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). |
| 0x00522D40 | 214 | lua_api_gc | lua_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. |
| 0x00522E40 | 40 | lua_api_getallocf | lua_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. |
| 0x00522E70 | 109 | lua_api_getfenv | lua_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. |
| 0x00522EE0 | 89 | lua_api_getfield_00522ee0 | lua_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. |
| 0x00522F40 | 84 | lua_api_getmetatable_00522f40 | lua_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. |
| 0x00522FA0 | 37 | lua_api_gettable_00522fa0 | lua_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. |
| 0x00522FD0 | 17 | lua_api_gettop_00522fd0 | lua_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. |
| 0x00522FF0 | 138 | lua_api_getupvalue_00522ff0 | lua_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. |
| 0x00523080 | 80 | lua_api_insert_00523080 | lua_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. |
| 0x005230D0 | 42 | lua_api_iscfunction_005230d0 | lua_iscfunction(L, idx). Returns 1 if the value at idx is a C function (type 6 with isC flag set), 0 otherwise. |
| 0x00523100 | 56 | lua_api_isnumber_00523100 | lua_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. |
| 0x00523140 | 48 | lua_api_isstring_00523140 | lua_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. |
| 0x00523170 | 41 | lua_api_isuserdata_00523170 | lua_isuserdata(L, idx). Returns 1 if the value at idx is a full userdata (type 7) or light userdata (type 2). Returns 0 otherwise. |
| 0x005231A0 | 67 | lua_api_lessthan_005231a0 | lua_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. |
| 0x005231F0 | 57 | lua_api_load_005231f0 | lua_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. |
| 0x00523230 | 55 | lua_api_newthread_00523230 | lua_newthread(L). Creates a new Lua thread (coroutine), pushes it onto the stack with type tag 8 (LUA_TTHREAD). Checks GC threshold before allocation. |
| 0x00523270 | 83 | lua_api_newuserdata_00523270 | lua_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). |
| 0x005232D0 | 57 | lua_api_next_005232d0 | lua_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). |
| 0x00523310 | 88 | lua_api_objlen_00523310 | lua_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. |
| 0x00523380 | 112 | lua_api_pcall_00523380 | lua_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. |
| 0x005233F0 | 32 | lua_api_pushboolean_005233f0 | lua_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). |
| 0x00523410 | 171 | lua_api_pushcclosure_00523410 | Lua 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. |
| 0x005234C0 | 46 | lua_api_pushfstring_005234c0 | Lua C API: lua_pushfstring. Pushes a formatted string onto the stack (variadic). Uses lua_obj_pushvfstring internally. Checks GC threshold. |
| 0x005234F0 | 35 | lua_api_pushinteger_005234f0 | Lua C API: lua_pushinteger. Pushes an integer onto the stack as a number (type=3/LUA_TNUMBER). Converts int to double. |
| 0x00523520 | 27 | lua_api_pushlightuserdata_00523520 | Lua C API: lua_pushlightuserdata. Pushes a light userdata (raw pointer) onto the stack with type=2/LUA_TLIGHTUSERDATA. |
| 0x00523540 | 63 | lua_api_pushlstring_00523540 | Lua 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. |
| 0x00523580 | 22 | lua_api_pushnil_00523580 | Lua C API: lua_pushnil. Pushes nil onto the stack (type=0/LUA_TNIL). Increments stack top by 0x10. |
| 0x005235A0 | 31 | lua_api_pushnumber_005235a0 | Lua C API: lua_pushnumber. Pushes a double-precision number onto the stack with type=3/LUA_TNUMBER. |
| 0x005235C0 | 103 | lua_api_pushstring_005235c0 | Lua 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. |
| 0x00523630 | 35 | lua_api_pushthread_00523630 | Lua 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. |
| 0x00523660 | 47 | lua_api_pushvalue_00523660 | Lua C API: lua_pushvalue. Copies a stack element at the given index and pushes it onto the top of the stack. |
| 0x00523690 | 45 | lua_api_pushvfstring_00523690 | Lua C API: lua_pushvfstring. Pushes a formatted string onto the stack using a va_list. Checks GC threshold before string creation. |
| 0x005236C0 | 64 | lua_api_rawequal_005236c0 | Lua 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. |
| 0x00523700 | 56 | lua_api_rawget_00523700 | Lua 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. |
| 0x00523740 | 57 | lua_api_rawgeti_00523740 | Lua 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. |
| 0x00523780 | 111 | lua_api_rawset_00523780 | Lua 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. |
| 0x005237F0 | 110 | lua_api_rawseti_005237f0 | Lua 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. |
| 0x00523860 | 68 | lua_api_remove_00523860 | Lua C API: lua_remove. Removes the stack element at the given index, shifting elements above it down by one slot. Decrements stack top. |
| 0x005238B0 | 212 | lua_api_replace_005238b0 | Lua 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. |
| 0x00523990 | 26 | lua_api_setallocf_00523990 | Lua C API: lua_setallocf. Sets the memory allocator function and its userdata in the global state. param_2=allocator function, param_3=allocator userdata. |
| 0x005239B0 | 129 | lua_api_setfenv | Lua 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. |
| 0x00523A40 | 93 | lua_api_setfield_00523a40 | Lua 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. |
| 0x00523AA0 | 19 | lua_api_copy_hook_mask | Lua 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. |
| 0x00523AC0 | 169 | lua_api_setmetatable_00523ac0 | Lua 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. |
| 0x00523B70 | 44 | lua_api_settable_00523b70 | Lua 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. |
| 0x00523BA0 | 79 | lua_api_settop_00523ba0 | Lua 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. |
| 0x00523BF0 | 213 | lua_api_setupvalue_00523bf0 | Lua 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. |
| 0x00523CD0 | 12 | lua_api_status_00523cd0 | Lua C API: lua_status. Returns the status byte of a lua_State (offset +6). 0=running, 1=yield, error codes for errors. |
| 0x00523CE0 | 45 | lua_api_toboolean_00523ce0 | Lua 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. |
| 0x00523D10 | 40 | lua_api_tocfunction_00523d10 | Lua 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. |
| 0x00523D40 | 69 | lua_api_tointeger_00523d40 | Lua 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. |
| 0x00523D90 | 115 | lua_api_tolstring_00523d90 | Lua 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. |
| 0x00523E10 | 55 | lua_api_tonumber_00523e10 | Lua 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. |
| 0x00523E50 | 84 | lua_api_topointer | Lua 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. |
| 0x00523EC0 | 31 | lua_api_tothread | Lua 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. |
| 0x00523EE0 | 45 | lua_api_touserdata | Lua 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. |
| 0x00523F10 | 34 | lua_api_type | Lua 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. |
| 0x00523F40 | 27 | lua_api_typename | Lua 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. |
| 0x00523F60 | 90 | lua_api_xmove | Lua 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. |
| 0x00523FC0 | 106 | luaL_prepbuffer_flush | Lua 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. |
| 0x00524030 | 73 | luaL_fileresult | Lua 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. |
| 0x00524080 | 36 | lua_print_formatted | Lua 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. |
| 0x005240B0 | 97 | lua_reader_file | Lua 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. |
| 0x00524120 | 33 | lua_reader_string | Lua 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). |
| 0x00524150 | 41 | lua_default_alloc | Lua 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. |
| 0x00524180 | 105 | luaL_addlstring | Lua 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. |
| 0x005241F0 | 41 | luaL_addstring | Lua auxiliary: luaL_addstring. Adds a null-terminated C string to a Lua string buffer. Computes strlen then delegates to luaL_addlstring. |
| 0x00524220 | 128 | luaL_addvalue | Lua 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. |
| 0x005242A0 | 235 | luaL_argerror | Lua 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". |
| 0x00524390 | 26 | luaL_buffinit | Lua 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). |
| 0x005243B0 | 136 | luaL_callmeta | Lua 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. |
| 0x00524440 | 43 | luaL_checkany | luaL_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. |
| 0x00524470 | 101 | luaL_checkinteger | luaL_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. |
| 0x005244E0 | 89 | luaL_checklstring | luaL_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. |
| 0x00524540 | 124 | luaL_checknumber | luaL_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. |
| 0x005245C0 | 156 | luaL_checkoption | luaL_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. |
| 0x00524660 | 36 | luaL_checkstack | luaL_checkstack - Lua auxiliary library. Ensures the Lua stack has room for param_2 extra slots. Calls luaL_error if lua_checkstack fails. |
| 0x00524690 | 81 | luaL_checktype | luaL_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. |
| 0x005246F0 | 138 | luaL_checkudata | luaL_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. |
| 0x00524780 | 146 | luaL_error | luaL_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. |
| 0x00524820 | 224 | luaL_findtable | luaL_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. |
| 0x00524900 | 90 | luaL_getmetafield | luaL_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. |
| 0x00524960 | 365 | luaL_gsub | luaL_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. |
| 0x00524AD0 | 45 | luaL_loadbuffer_00524ad0 | luaL_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. |
| 0x00524B00 | 567 | luaL_loadfile_00524b00 | luaL_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. |
| 0x00524D40 | 57 | luaL_loadstring_00524d40 | luaL_loadstring - Lua auxiliary library. Loads a Lua chunk from a null-terminated string. Computes strlen then delegates to lua_load with a buffer reader. |
| 0x00524D80 | 92 | luaL_newmetatable_00524d80 | luaL_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. |
| 0x00524DE0 | 40 | luaL_newstate_00524de0 | luaL_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. |
| 0x00524E10 | 281 | luaL_openlib_00524e10 | luaL_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. |
| 0x00524F30 | 129 | luaL_optinteger_00524f30 | luaL_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. |
| 0x00524FC0 | 92 | luaL_optlstring_00524fc0 | luaL_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. |
| 0x00525020 | 162 | luaL_optnumber_00525020 | luaL_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. |
| 0x005250D0 | 50 | luaL_prepbuffer_005250d0 | luaL_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. |
| 0x00525110 | 64 | luaL_pushresult | luaL_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. |
| 0x00525150 | 173 | luaL_ref | luaL_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. |
| 0x00525200 | 224 | luaL_register | luaL_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. |
| 0x005252E0 | 54 | luaL_typerror | luaL_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. |
| 0x00525320 | 85 | luaL_unref | luaL_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. |
| 0x00525380 | 130 | luaL_where | luaL_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. |
| 0x00525410 | 48 | lua_default_panic | lua_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). |
| 0x00525440 | 207 | luaB_print | luaB_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. |
| 0x00525510 | 275 | luaB_tonumber | luaB_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. |
| 0x00525630 | 86 | luaB_error | luaB_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. |
| 0x00525690 | 71 | luaB_getmetatable | luaB_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). |
| 0x005256E0 | 118 | luaB_setmetatable | luaB_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). |
| 0x00525760 | 71 | luaB_getfenv | luaB_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. |
| 0x005257B0 | 170 | luaB_setfenv | luaB_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. |
| 0x00525860 | 51 | luaB_rawequal | luaB_rawequal - Lua base library: rawequal() implementation. Compares two values for equality without invoking __eq metamethod. Pushes boolean result. |
| 0x005258A0 | 52 | luaB_rawget | luaB_rawget - Lua base library: rawget() implementation. Gets table[key] without invoking __index metamethod. Arg 1 must be a table, arg 2 is the key. |
| 0x005258E0 | 60 | luaB_rawset | luaB_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. |
| 0x00525920 | 34 | luaB_gcinfo | luaB_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. |
| 0x00525950 | 195 | luaB_collectgarbage | luaB_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. |
| 0x00525A20 | 48 | luaB_type | luaB_type - Lua base library: type() implementation. Returns the type name string of the argument (e.g. "number", "string", "table", "nil", etc.). |
| 0x00525A50 | 65 | luaB_next | luaB_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. |
| 0x00525AA0 | 91 | luaB_loadstring | luaB_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. |
| 0x00525B00 | 66 | luaB_loadfile | luaB_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. |
| 0x00525B50 | 99 | luaB_load | luaB_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. |
| 0x00525BC0 | 80 | luaB_dofile | luaB_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. |
| 0x00525C10 | 74 | luaB_assert | luaB_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!"). |
| 0x00525C60 | 176 | luaB_unpack | luaB_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. |
| 0x00525D10 | 129 | luaB_select | luaB_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. |
| 0x00525DA0 | 73 | luaB_pcall | Lua base library: xpcall(f, err) - calls function f with error handler err, pushes success boolean and results |
| 0x00525DF0 | 77 | luaB_xpcall | Lua base library: pcall(f, ...) - protected call with message handler, returns success boolean + results |
| 0x00525E40 | 115 | luaB_tostring | Lua base library: tostring(v) - converts value to string. Handles nil->"nil", boolean->"true"/"false", number->string, string->identity, other->__tostring metamethod or type+pointer |
| 0x00525F40 | 74 | luaB_costatus | Lua coroutine.status(co) - returns status string: "running", "suspended", "normal", or "dead" |
| 0x00525F90 | 123 | luaB_coresume | Lua coroutine.resume(co, ...) - resumes coroutine, returns true+values on success or false+error on failure |
| 0x00526010 | 92 | luaB_cocreate | Lua coroutine.create(f) - creates new coroutine thread from Lua function f. Errors if f is a C function. |
| 0x00526070 | 105 | luaB_cowrap | Lua coroutine.wrap(f) - creates coroutine and returns an iterator function that resumes it on each call |
| 0x005260E0 | 25 | lua_coroutine_yield | Lua base library: error(message, level) - raises an error with the given message at the specified stack level |
| 0x00526100 | 36 | luaB_corunning | Lua coroutine.running() - returns the running coroutine thread, or nil if called from the main thread |
| 0x00526130 | 208 | lua_resume_internal_00526130 | Lua 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. |
| 0x00526200 | 158 | lua_costatus_00526200 | Lua 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. |
| 0x005262A0 | 126 | lua_generic_reader_005262a0 | Lua 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. |
| 0x00526320 | 210 | luaB_getfunc | Lua 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. |
| 0x00526400 | 67 | lua_ipairs_iterator_00526400 | Lua 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. |
| 0x00526450 | 101 | lua_wrap_resume_iterator_00526450 | Lua 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. |
| 0x005264C0 | 55 | luaB_ipairs | Lua base library: ipairs(t) - returns iterator function, table t, and initial index 0. The iterator (ipairs_iterator upvalue) traverses integer keys sequentially. |
| 0x00526500 | 216 | luaB_newproxy | Lua 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. |
| 0x005265E0 | 53 | luaB_pairs | Lua base library: pairs(t) - returns next function (upvalue), table t, and nil as initial key for generic for loop iteration. |
| 0x00526740 | 233 | luaK_addk_00526740 | Lua 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. |
| 0x00526830 | 477 | luaK_codearith_00526830 | Lua 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. |
| 0x00526A40 | 217 | luaK_codecomp_00526a40 | Lua 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. |
| 0x00526B20 | 93 | luaK_condjump_00526b20 | Lua 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. |
| 0x00526B80 | 85 | luaK_exp2nextreg_00526b80 | Lua code generator: luaK_exp2nextreg - allocates next free register and discharges expression into it. Checks max stack depth limit (249). Increments freereg counter. |
| 0x00526BE0 | 475 | luaK_discharge2reg | Lua 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. |
| 0x00526DF0 | 288 | luaK_exp2reg | Lua 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. |
| 0x00526F10 | 38 | luaK_freereg_00526f10 | Lua code generator: luaK_freereg - frees a register if it is a temporary (above the fixed local variables). Decrements freereg counter. |
| 0x00526F40 | 80 | luaK_fixline_00526f40 | Lua 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. |
| 0x00526F90 | 249 | luaK_goiftrue | Lua 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. |
| 0x00527090 | 57 | luaK_reserveregs_00527090 | Lua code generator: luaK_reserveregs - checks and reserves additional stack slots. Errors with "function or expression too complex" if total exceeds 249 (MAXSTACK). |
| 0x005270D0 | 162 | luaK_code_005270d0 | Lua 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. |
| 0x00527180 | 45 | luaK_codeABC_00527180 | Lua 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. |
| 0x005271B0 | 39 | luaK_codeABx_005271b0 | Lua 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. |
| 0x005271E0 | 132 | luaK_patchlist_005271e0 | Lua 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. |
| 0x00527270 | 290 | luaK_dischargevars_00527270 | Lua 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. |
| 0x005273C0 | 344 | luaK_exp2anyreg_005273c0 | Lua 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. |
| 0x00527530 | 80 | luaK_exp2nextreg_safe_00527530 | Lua 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. |
| 0x00527580 | 117 | luaK_exp2nextreg_force_00527580 | Lua 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. |
| 0x00527600 | 97 | luaK_exp2val_00527600 | Lua 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. |
| 0x00527670 | 23 | luaK_setlineno_00527670 | Lua code generator: luaK_setlineno - sets the line number info for the last emitted instruction by writing to the lineinfo array at (pc-1). |
| 0x00527690 | 14 | luaK_setcurrentline_00527690 | Lua code generator: copies the lastline value to currentline. Simple state update for line tracking during code generation. |
| 0x005276A0 | 122 | luaK_goiffalse_005276a0 | Lua 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. |
| 0x00527740 | 31 | luaK_indexed_00527740 | Lua 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. |
| 0x00527760 | 52 | luaK_prefix_00527760 | Lua 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. |
| 0x00527970 | 59 | luaK_jump_00527970 | Lua 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. |
| 0x005279B0 | 150 | luaK_nil_005279b0 | Lua 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. |
| 0x00527A50 | 43 | luaK_numberK_00527a50 | Lua 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. |
| 0x00527A80 | 58 | luaK_patchtohere_00527a80 | Lua 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. |
| 0x00527AC0 | 30 | luaK_concat_00527ac0 | Lua code generator: luaK_concat - concatenates a jump to the pending jump list. Updates lastline and appends to the pending list via luaK_patchlist. |
| 0x00527AE0 | 40 | luaK_posfix_00527ae0 | Lua 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. |
| 0x00528D10 | 468 | luaK_prefix | Lua 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. |
| 0x00528F10 | 64 | luaK_checkstack | Lua code generator: ensures the function stack has room for 'n' more slots. Raises error if stack exceeds 249 registers ("function or expression too complex"). |
| 0x00528F50 | 44 | luaK_codeABx | Lua 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. |
| 0x00528F80 | 236 | luaK_setcall | Lua 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). |
| 0x00529070 | 130 | luaK_setlist | Lua 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. |
| 0x00529100 | 85 | luaK_setoneret | Lua 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. |
| 0x00529160 | 165 | luaK_setmultret | Lua 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. |
| 0x00529210 | 218 | luaK_storevar | Lua 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. |
| 0x00529300 | 39 | luaK_numberK | Lua 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. |
| 0x00529330 | 91 | luaK_hasjumps | Lua 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. |
| 0x00529390 | 163 | luaK_patchlistaux | Lua 5.1 internal: luaK patchlistaux |
| 0x00529440 | 143 | luaK_patchtestreg | Lua 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. |
| 0x005294D0 | 124 | luaK_dischargejpc | Lua 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). |
| 0x00529550 | 26 | luaB_getfenv_compat | Lua base library: pushes the global environment table (registry index -10000) onto the stack. Simplified getfenv implementation that always returns the global table. |
| 0x00529570 | 47 | luaB_getmetatable_00529570 | Lua base library: implements getmetatable(obj). Returns the metatable of the given object, or nil if it has none. Corresponds to Lua's getmetatable() function. |
| 0x005295A0 | 77 | luaB_setmetatable_005295a0 | Lua 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. |
| 0x005295F0 | 33 | luaB_getfenv_005295f0 | Lua base library: implements getfenv(f). Checks arg 1 exists, then calls lua_getfenv to get the function environment table. Returns 1 value. |
| 0x00529620 | 62 | luaB_setfenv_00529620 | Lua 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. |
| 0x00529660 | 662 | luaB_getinfo | Lua 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. |
| 0x00529900 | 248 | luaB_getlocal | Lua 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. |
| 0x00529A00 | 231 | lua_debug_setlocal_00529a00 | Lua 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. |
| 0x00529AF0 | 92 | lua_debug_getupvalue_00529af0 | Lua 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. |
| 0x00529B50 | 100 | lua_debug_setupvalue_00529b50 | Lua 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. |
| 0x00529BC0 | 295 | lua_debug_sethook_00529bc0 | Lua 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. |
| 0x00529CF0 | 228 | lua_debug_gethook_00529cf0 | Lua 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. |
| 0x00529DE0 | 313 | lua_debug_debug_00529de0 | Lua 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. |
| 0x00529F20 | 585 | lua_debug_traceback_00529f20 | Lua 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. |
| 0x0052A170 | 99 | lua_debug_gethooktable_0052a170 | Lua 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. |
| 0x0052A1E0 | 141 | lua_debug_hookcallback_0052a1e0 | Lua 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. |
| 0x0052A290 | 79 | lua_debug_transfer_field_0052a290 | Lua 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. |
| 0x0052A2E0 | 592 | luaG_getinfo_0052a2e0 | Lua 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. |
| 0x0052A580 | 94 | luaG_checkopenop_0052a580 | Lua 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. |
| 0x0052A5E0 | 83 | luaG_currentline_0052a5e0 | Lua 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. |
| 0x0052A640 | 75 | luaG_currentpc_0052a640 | Lua 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. |
| 0x0052A690 | 130 | luaG_findlocal_0052a690 | Lua 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). |
| 0x0052A720 | 301 | luaG_getfuncname_0052a720 | Lua 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. |
| 0x0052A880 | 50 | luaG_kname | Lua 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. |
| 0x0052A8C0 | 48 | luaG_aritherror | Lua 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. |
| 0x0052A8F0 | 31 | luaG_has_vararg_flag | Lua 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). |
| 0x0052A910 | 37 | luaG_isinlinejump | Lua 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. |
| 0x0052A960 | 38 | luaG_concaterror | Lua debug core: raises a concatenation type error. Wrapper that calls luaG_typeerror with "attempt to concatenate" message. |
| 0x0052A990 | 140 | luaG_errormsg | Lua 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). |
| 0x0052AA20 | 80 | luaG_ordererror | Lua 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. |
| 0x0052AA70 | 282 | luaG_runerror | Lua 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. |
| 0x0052AB90 | 138 | luaG_typeerror | Lua 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". |
| 0x0052AC20 | 11 | lua_gethook | Lua API: returns the current hook function pointer from lua_State offset 0x44. |
| 0x0052AC30 | 11 | lua_gethookcount | Lua API: returns the current hook count from lua_State offset 0x3C (the instruction count interval for count hooks). |
| 0x0052AC40 | 12 | lua_gethookmask | Lua API: returns the current hook mask byte from lua_State offset 0x38. Mask bits: 1=call, 2=return, 4=line, 8=count. |
| 0x0052AC50 | 319 | lua_getinfo | Lua 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. |
| 0x0052AD90 | 77 | lua_do_getupvalue_by_index_0052ad90 | Lua 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. |
| 0x0052ADE0 | 119 | lua_do_findupvalue_by_count_0052ade0 | Lua 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. |
| 0x0052AE60 | 46 | lua_do_set_hook_config_0052ae60 | Lua 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. |
| 0x0052AE90 | 91 | lua_do__setupvalue_by_index | Lua 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. |
| 0x0052AEF0 | 1194 | lua_debug__checkcode | Lua 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). |
| 0x0052B420 | 352 | lua_do__adjust_varargs | Lua 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. |
| 0x0052B580 | 213 | lua_do__f_parser | Lua 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. |
| 0x0052B660 | 73 | lua_do__growCI | Lua 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. |
| 0x0052B6B0 | 130 | lua_do__call | Lua 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. |
| 0x0052B740 | 220 | lua_do__callhook | Lua 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. |
| 0x0052B820 | 39 | lua_do__checkstack_grow | Lua 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. |
| 0x0052B850 | 199 | lua_do__pcall | Lua 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. |
| 0x0052B920 | 236 | lua_do__poscall | Lua 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. |
| 0x0052BA10 | 632 | lua_do__precall | Lua 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. |
| 0x0052BC90 | 240 | lua_do__protectedparser | Lua 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. |
| 0x0052BD80 | 136 | lua_do__rawrunprotected | Lua 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). |
| 0x0052BE10 | 121 | lua_do__reallocCI | Lua 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). |
| 0x0052BE90 | 199 | lua_do__reallocstack | Lua 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. |
| 0x0052BF60 | 103 | lua_do__seterrorobj | Lua 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. |
| 0x0052BFE0 | 77 | lua_do__throw | Lua 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). |
| 0x0052C030 | 233 | lua_do__resume | Lua 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. |
| 0x0052C120 | 55 | lua_do__yield | Lua 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. |
| 0x0052C160 | 123 | lua_do__resetthread | Lua 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. |
| 0x0052C1E0 | 123 | lua_do__resume_inner | Lua 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. |
| 0x0052C260 | 374 | lua_undump__dump_stack | Lua 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. |
| 0x0052C3E0 | 536 | lua_undump__dump_debug | Lua 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. |
| 0x0052C600 | 336 | lua_undump__dump_function | Lua 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. |
| 0x0052C750 | 131 | lua_undump__dump_string | Lua 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. |
| 0x0052C7E0 | 123 | lua_undump__luaU_dump | Lua 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. |
| 0x0052C860 | 165 | lua_func__close_upvalues | Lua 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. |
| 0x0052C910 | 152 | lua_func__findupval | Lua 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. |
| 0x0052C9B0 | 63 | lua_func__freeclosure | Lua 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. |
| 0x0052C9F0 | 143 | lua_func__freeproto | Lua 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). |
| 0x0052CA80 | 50 | lua_func__freeupval | Lua 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. |
| 0x0052CAC0 | 75 | lua_func__getlocalname | Lua 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. |
| 0x0052CB10 | 64 | lua_func__newCclosure | Lua 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. |
| 0x0052CB50 | 88 | lua_func__newLclosure | Lua 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. |
| 0x0052CBB0 | 151 | lua_func__newproto | Lua 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. |
| 0x0052CC50 | 52 | lua_func__newupval | Lua 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). |
| 0x0052CC90 | 217 | lua_gc__run_single_finalizer | Lua 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. |
| 0x0052CD70 | 616 | lua_gc__fullcycle | Lua 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. |
| 0x0052CFE0 | 27 | lua_gc__link_object | Lua 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. |
| 0x0052D000 | 50 | lua_gc__barrier_forward | Lua 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. |
| 0x0052D040 | 246 | lua_gc__run_all_finalizers | Lua 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. |
| 0x0052D140 | 331 | lua_gc__sweeplist | Lua 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. |
| 0x0052D2B0 | 133 | lua_gc__fullgc | Lua 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. |
| 0x0052D340 | 37 | lua_gc__link_newobj | Lua 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. |
| 0x0052D370 | 116 | lua_gc__linkupval | Lua 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). |
| 0x0052D3F0 | 164 | lua_gc__separate_udata_with_finalizers | Lua 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. |
| 0x0052D4A0 | 515 | lua_gc__step | Lua 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. |
| 0x0052D6C0 | 214 | lua_gc__mark_roots_0052d6c0 | Lua 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). |
| 0x0052D7C0 | 122 | lua_gc__restart_collection_0052d7c0 | Lua 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). |
| 0x0052D840 | 675 | lua_gc__sweep_gray_list_0052d840 | Lua 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. |
| 0x0052DB00 | 627 | lua_gc__propagate_one_0052db00 | Lua 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. |
| 0x0052DD90 | 194 | lua_gc__mark_object_0052dd90 | Lua 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. |
| 0x0052DE70 | 367 | lua_gc__step_0052de70 | Lua 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). |
| 0x0052E000 | 274 | lua_gc__sweep_objects_0052e000 | Lua 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. |
| 0x0052E130 | 324 | lua_gc__traverse_closure_0052e130 | Lua 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. |
| 0x0052E290 | 434 | lua_gc__traverse_table_0052e290 | Lua 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). |
| 0x0052E450 | 62 | lua_gc__register_base_libs_0052e450 | Lua: 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). |
| 0x0052E490 | 154 | lua_io__tostring_0052e490 | Lua 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. |
| 0x0052E530 | 118 | lua_io__close_dispatch_0052e530 | Lua 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. |
| 0x0052E5B0 | 74 | lua_io__gc_0052e5b0 | Lua 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). |
| 0x0052E600 | 76 | lua_io__tostring_file_0052e600 | Lua 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. |
| 0x0052E650 | 216 | lua_io__open_0052e650 | Lua 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. |
| 0x0052E730 | 216 | lua_io__popen_0052e730 | Lua 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. |
| 0x0052E810 | 124 | lua_io__tmpfile_0052e810 | Lua io library: io.tmpfile() implementation. Creates FILE* userdata, sets metatable, calls tmpfile(). On success returns userdata. On failure returns nil, error string, errno. |
| 0x0052E890 | 23 | lua_io__input_0052e890 | Lua 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. |
| 0x0052E8B0 | 23 | lua_io__output_0052e8b0 | Lua 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. |
| 0x0052E8D0 | 82 | lua_io__lines_method_0052e8d0 | Lua 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). |
| 0x0052E930 | 281 | lua_io__lines_global_0052e930 | Lua 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. |
| 0x0052EA50 | 73 | lua_io__read_default_0052ea50 | Lua 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. |
| 0x0052EAA0 | 64 | lua_io__read_method_0052eaa0 | Lua io library: file:read(...) method. Validates the FILE* userdata is open, then delegates to the generic read helper starting at arg 2 (skipping self). |
| 0x0052EAE0 | 73 | lua_io__write_default_0052eae0 | Lua 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. |
| 0x0052EB30 | 64 | lua_io__write_method_0052eb30 | Lua io library: file:write(...) method. Validates the FILE* userdata is open, then delegates to the generic write helper starting at arg 2 (skipping self). |
| 0x0052EB70 | 181 | lua_io__seek_0052eb70 | Lua 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. |
| 0x0052EC30 | 177 | lua_io__setvbuf_0052ec30 | Lua 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. |
| 0x0052ECF0 | 146 | lua_io__flush_default_0052ecf0 | Lua 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. |
| 0x0052ED90 | 137 | lua_io__flush_method_0052ed90 | Lua io library: file:flush() method. Validates the FILE* userdata is open, calls fflush(). On success returns true. On failure returns nil, strerror, errno. |
| 0x0052EE20 | 6 | lua_io__get_scan_buffer_0052ee20 | Lua io library: Returns pointer to a static scan buffer (DAT_0173eca8). Used by fscanf-based number reading for io.read("*n"). |
| 0x0052EE30 | 51 | lua_io__close_file_aux_0052ee30 | Lua 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). |
| 0x0052EE70 | 62 | lua_io__file_error_0052ee70 | Lua 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. |
| 0x0052EEB0 | 36 | lua_io__fscanf_wrapper_0052eeb0 | Lua 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. |
| 0x0052EEE0 | 210 | lua_io__set_default_file_0052eee0 | Lua 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(). |
| 0x0052EFC0 | 493 | lua_io__read_helper_0052efc0 | Lua 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. |
| 0x0052F1B0 | 226 | lua_io__write_helper_0052f1b0 | Lua 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(). |
| 0x0052F2A0 | 119 | lua_io__fclose_0052f2a0 | Lua 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. |
| 0x0052F320 | 36 | lua_io__noclose_0052f320 | Lua io library: __close function for standard files (stdin/stdout/stderr). Always returns nil + "cannot close standard file". Prevents closing standard I/O handles. |
| 0x0052F350 | 122 | lua_io__pclose_0052f350 | Lua 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(). |
| 0x0052F3D0 | 167 | lua_io__lines_iterator_0052f3d0 | Lua 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(). |
| 0x0052F6B0 | 208 | lua_io__read_bytes_0052f6b0 | Lua 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. |
| 0x0052F780 | 247 | lua_io__read_line_0052f780 | Lua 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. |
| 0x0052F880 | 96 | lua_lex__check_next_0052f880 | Lua 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. |
| 0x0052F8E0 | 143 | lua_lex__inclinenumber_0052f8e0 | Lua 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. |
| 0x0052F970 | 1380 | lua_lex__llex_0052f970 | Lua 5.1 internal: lua lex llex 0052f970 |
| 0x0052FF80 | 73 | lua_lex__init_reserved_words_0052ff80 | Lua 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. |
| 0x0052FFD0 | 214 | lua_lex__syntax_error_0052ffd0 | Lua 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. |
| 0x005300B0 | 26 | lua_lex__next_005300b0 | Lua 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. |
| 0x005300D0 | 88 | lua_lex__intern_string_005300d0 | Lua 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. |
| 0x00530130 | 59 | lua_lex_next_token | Lua lexer: advances to next token. Copies current lookahead into previous token, then reads next token from input stream (luaX_next). |
| 0x00530170 | 140 | lua_lex_init | Lua lexer: initializes lexer state (luaX_setinput). Sets up ZIO reader, allocates token buffer (32 bytes initial), reads first character from input stream. |
| 0x00530200 | 23 | lua_lex_syntax_error | Lua lexer: reports syntax error for current token. Wrapper around luaX_lexerror passing current token type. |
| 0x00530220 | 71 | lua_lex_token_to_string | Lua 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. |
| 0x00530270 | 190 | lua_lex_read_long_string | Lua lexer: reads a long string or long comment delimited by [==[ ... ]==] (read_long_string). Handles newline normalization, nesting warnings, and EOF detection. |
| 0x005304D0 | 390 | lua_lex_read_number | Lua 5.1 internal: lua lex read number |
| 0x00530660 | 311 | lua_lex_read_string | Lua lexer: reads quoted string with escape sequences |
| 0x00530A10 | 190 | lua_lex_save_char | Lua lexer: appends char to token buffer |
| 0x00530AD0 | 325 | lua_lex_skip_separator | Lua lexer: counts separator level for long strings |
| 0x00530C20 | 56 | lua_math_abs | Lua math.abs - absolute value |
| 0x00530C60 | 54 | lua_math_sin | Lua math.sin - sine in radians |
| 0x00530CA0 | 60 | lua_math_sinh | Lua math.sinh - hyperbolic sine |
| 0x00530CE0 | 54 | lua_math_cos | Lua math.cos - cosine in radians |
| 0x00530D20 | 60 | lua_math_cosh | Lua math.cosh - hyperbolic cosine |
| 0x00530D60 | 54 | lua_math_tan | Lua math.tan - tangent in radians |
| 0x00530DA0 | 60 | lua_math_tanh | Lua math.tanh - hyperbolic tangent |
| 0x00530DE0 | 54 | lua_math_asin | Lua math.asin - arc sine |
| 0x00530E20 | 54 | lua_math_acos | Lua math.acos - arc cosine |
| 0x00530E60 | 54 | lua_math_atan | Lua math.atan - arc tangent |
| 0x00530EA0 | 77 | lua_math_atan2 | Lua math.atan2 - arc tangent of y/x |
| 0x00530EF0 | 57 | lua_math_ceil | Lua math.ceil - smallest int >= arg |
| 0x00530F30 | 57 | lua_math_floor | Lua math.floor - largest int <= arg |
| 0x00530F70 | 77 | lua_math_fmod | Lua math.fmod - remainder of x/y |
| 0x00530FC0 | 85 | lua_math_modf | Lua math.modf - integral and fractional parts |
| 0x00531020 | 74 | lua_math_sqrt | Lua math.sqrt - square root |
| 0x00531070 | 74 | lua_math_pow | Lua 5.1 internal: lua math pow |
| 0x005310C0 | 54 | lua_math_log | Lua math.log - natural logarithm |
| 0x00531100 | 54 | lua_math_log10 | Lua math.log10 - base-10 log |
| 0x00531140 | 54 | lua_math_exp | Lua 5.1 internal: lua math exp |
| 0x00531180 | 40 | lua_math_deg | Lua math.deg - radians to degrees |
| 0x005311B0 | 40 | lua_math_rad | Lua math.rad - degrees to radians |
| 0x005311E0 | 63 | lua_math_frexp | Lua math.frexp - mantissa and exponent |
| 0x00531220 | 59 | lua_math_ldexp | Lua math.ldexp - m*2^e |
| 0x00531260 | 115 | lua_math_min | Lua math.min - minimum of args |
| 0x005312E0 | 115 | lua_math_max | Lua math.max - maximum of args |
| 0x00531360 | 323 | lua_math_random | Lua math.random - pseudo-random number |
| 0x005314B0 | 27 | lua_math_randomseed | Lua math.randomseed - sets seed |
| 0x005314D0 | 130 | lua_open_math_lib | Lua luaopen_math - registers math lib |
| 0x00531560 | 188 | lua_mem_growvector | Lua luaM_growaux_ - grows dynamic array |
| 0x00531620 | 69 | lua_mem_realloc | Lua luaM_realloc_ - core memory realloc |
| 0x00531670 | 23 | lua_mem_toobig_error | Lua luaM_toobig - alloc error |
| 0x00531690 | 103 | lua_pkg_ll_loadlib_lua | Lua package.loadlib(path, funcname) - Lua-facing wrapper. Calls ll_loadlib, returns function on success or nil+errmsg+errtype on failure (ll_module). |
| 0x00531700 | 436 | lua_pkg_require | Lua require() - loads module |
| 0x005318C0 | 468 | lua_pkg_module | Lua module() - creates module table |
| 0x00531AA0 | 92 | lua_pkg_seeall | Lua package.seeall(module) - sets module's metatable __index to _G so module can access global environment. Creates metatable if needed. |
| 0x00531B00 | 302 | lua_pkg_find_file | Lua package.searchpath - finds file |
| 0x00531C30 | 44 | lua_pkg_gc_loadlib | Lua LOADLIB __gc - FreeLibrary |
| 0x00531C60 | 253 | lua_pkg_loadlib | Lua ll_loadlib - LoadLibraryA+GetProcAddress |
| 0x00531D60 | 167 | lua_pkg_loader_c | Lua 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. |
| 0x00531E10 | 150 | lua_pkg_loader_croot | Lua 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. |
| 0x00531EB0 | 105 | lua_pkg_loader_lua | Lua loader_Lua - loads .lua file |
| 0x00531F20 | 114 | lua_pkg_loader_preload | Lua loader_preload - from preload table |
| 0x00531FA0 | 55 | lua_pkg_loaderror | Lua ll_loadfunc error msg |
| 0x00531FE0 | 318 | lua_open_package_lib | Lua luaopen_package - registers package lib |
| 0x00532120 | 77 | lua_pkg_make_funcname | Lua mkfuncname - luaopen_X name |
| 0x00532170 | 129 | lua_pkg_push_win32_error | Lua ll_sys - FormatMessageA error |
| 0x00532200 | 244 | lua_pkg_set_path | Lua setpath - path from env var |
| 0x00532300 | 336 | lua_obj_chunkid | Lua luaO_chunkid - shortened source name |
| 0x00532450 | 27 | lua_obj_fb2int | Lua luaO_fb2int - float byte to int |
| 0x00532470 | 44 | lua_obj_int2fb | Lua luaO_int2fb - int to float byte |
| 0x005324A0 | 40 | lua_obj_log2 | Lua luaO_log2 - ceil(log2(x)) |
| 0x005324D0 | 23 | lua_obj_pushfstring_va | Lua luaO_pushfstring - variadic format |
| 0x005324F0 | 713 | lua_obj_pushvfstring | Lua luaO_pushvfstring - format string |
| 0x00532830 | 77 | lua_obj_rawequalobj | Lua luaO_rawequalObj - TValue compare |
| 0x00532890 | 162 | lua_obj_str2number | Lua luaO_str2d - string to number |
| 0x00532940 | 50 | lua_util_sprintf | Lua 5.1 internal: lua util sprintf |
| 0x00532980 | 43 | lua_os_execute | Lua os.execute - system() |
| 0x005329B0 | 118 | lua_os_remove | Lua os.remove - deletes file |
| 0x00532A30 | 131 | lua_os_rename | Lua os.rename - renames file |
| 0x00532AC0 | 108 | lua_os_tmpname | Lua os.tmpname - temp filename |
| 0x00532B30 | 41 | lua_os_getenv | Lua os.getenv - env variable |
| 0x00532B60 | 51 | lua_os_clock | Lua os.clock - CPU time |
| 0x00532BA0 | 652 | lua_os_date | Lua os.date - formats date/time |
| 0x00532E30 | 626 | lua_os_time | Lua os.time - current time |
| 0x005330B0 | 85 | lua_os_difftime | Lua os.difftime - time difference |
| 0x00533110 | 73 | lua_os_setlocale | Lua os.setlocale - sets locale |
| 0x00533160 | 26 | lua_os_exit | Lua os.exit - exit() |
| 0x00533180 | 31 | lua_open_os_lib | Lua luaopen_os - registers os lib |
| 0x005331A0 | 121 | lua_parser_adjust_assign | Lua parser: multi-assignment adjust |
| 0x00533220 | 70 | lua_parser_register_localvars | Lua parser: registers locals |
| 0x00533270 | 412 | lua_parser_assignment | Lua parser: assignment statement |
| 0x00533410 | 128 | lua_parser_block | Lua parser: block scope |
| 0x00533490 | 744 | lua_parser_funcbody | Lua parser: function body |
| 0x00533780 | 102 | lua_parser_break_stat | Lua parser: break statement |
| 0x005337F0 | 104 | lua_parser_check_match | Lua parser: matching close token |
| 0x00533860 | 103 | lua_parser_check_name | Lua parser: checks TK_NAME |
| 0x005338D0 | 131 | lua_parser_chunk | Lua parser: statement list |
| 0x00533980 | 429 | lua_parser_close_func | Lua parser: closes func scope |
| 0x00533B30 | 48 | lua_parser_codestring | Lua parser: LOADK for string |
| 0x00533B60 | 636 | lua_parser_constructor | Lua parser: table constructor |
| 0x00533DE0 | 88 | lua_parser_limit_error | Lua parser: limit exceeded error |
| 0x00533E40 | 75 | lua_parser_explist1 | Lua parser: expression list |
| 0x00533E90 | 388 | lua_parser_forbody | Lua parser: for-loop body |
| 0x00534020 | 391 | lua_parser_fornum | Lua parser: numeric for |
| 0x005341B0 | 595 | lua_parser_forstat | Lua parser: for statement |
| 0x00534410 | 340 | lua_parser_funcargs | Lua parser: function arguments |
| 0x00534570 | 493 | lua_parser_ifstat | Lua parser: if/elseif/else/end |
| 0x00534760 | 328 | lua_parser_indexupvalue | Lua parser: upvalue index |
| 0x005348B0 | 236 | lua_parser_luaY_parser | Lua luaY_parser - main parser entry |
| 0x005349A0 | 217 | lua_parser_new_localvar | Lua parser: new local variable |
| 0x00534A80 | 224 | lua_parser_open_func | Lua parser: init FuncState |
| 0x00534B60 | 393 | lua_parser_primaryexp | Lua parser: primary expression |
| 0x00534E00 | 225 | lua_parser_recfield | Lua parser: record field |
| 0x00534EF0 | 74 | lua_parser_removevars | Lua parser: removes locals |
| 0x00534F40 | 446 | lua_parser_repeatstat | Lua parser: repeat...until |
| 0x00535100 | 104 | lua_parser_singlevar | Lua parser: resolves variable |
| 0x00535170 | 242 | lua_parser_singlevaraux | Lua parser: recursive var lookup |
| 0x00535270 | 1669 | lua_parser_statement | Lua parser: statement dispatch |
| 0x00535960 | 678 | lua_parser_subexpr | Lua parser: sub-expression |
| 0x00535E10 | 147 | lua_parser_test_then_block | Lua parser: condition then block |
| 0x00535EB0 | 34 | lua_parser_testnext | Lua parser: test and consume token |
| 0x00535EE0 | 88 | lua_parser_yindex | Lua parser: [expr] index |
| 0x00535F40 | 16 | lua_state_freeall_objects | Lua luaC_freeall - frees GC objects |
| 0x00535F50 | 135 | lua_state_close_state | Lua close_state - destroys state |
| 0x00535FE0 | 116 | lua_state_init_state | Lua f_luaopen - initializes core state |
| 0x00536060 | 77 | lua_state_free_thread | Lua 5.1 internal: lua state free thread |
| 0x005360B0 | 95 | lua_state_new_thread | Lua luaE_newthread - new coroutine |
| 0x00536110 | 90 | lua_state_lua_close | Lua 5.1 internal: lua state lua close |
| 0x00536170 | 349 | lua_state_lua_newstate | Lua 5.1 internal: lua state lua newstate |
| 0x005362D0 | 101 | lua_state_preinit_thread | Lua 5.1 internal: lua state preinit thread |
| 0x00536340 | 137 | lua_state_stack_init | Lua stack_init - allocates stacks |
| 0x005363D0 | 628 | lua_string_newlstr | Lua luaS_newlstr - interned string |
| 0x00536650 | 100 | lua_string_newudata | Lua 5.1 internal: lua string newudata |
| 0x005366C0 | 223 | lua_string_resize | Lua luaS_resize - string hash table |
| 0x005367A0 | 41 | lua_str_len | Lua 5.1 internal: lua str len |
| 0x005367D0 | 162 | lua_str_sub | Lua 5.1 internal: lua str sub |
| 0x00536880 | 192 | lua_str_reverse | Lua 5.1 internal: lua str reverse |
| 0x00536940 | 179 | lua_str_lower | Lua 5.1 internal: lua str lower |
| 0x00536A00 | 179 | lua_str_upper | Lua 5.1 internal: lua str upper |
| 0x00536AC0 | 144 | lua_str_rep | Lua 5.1 internal: lua str rep |
| 0x00536B50 | 209 | lua_str_byte | Lua 5.1 internal: lua str byte |
| 0x00536C30 | 186 | lua_str_char | Lua 5.1 internal: lua str char |
| 0x00536CF0 | 128 | lua_str_dump | Lua 5.1 internal: lua str dump |
| 0x00536D70 | 18 | lua_str_find | Lua 5.1 internal: lua str find |
| 0x00536D90 | 18 | lua_str_match | Lua 5.1 internal: lua str match |
| 0x00536DB0 | 67 | lua_str_gmatch | Lua 5.1 internal: lua str gmatch |
| 0x00536E00 | 21 | lua_str_gfind_nodef | Lua string.gfind - deprecated |
| 0x00536E20 | 461 | lua_str_gsub | Lua 5.1 internal: lua str gsub |
| 0x00536FF0 | 524 | lua_str_format | Lua 5.1 internal: lua str format |
| 0x005375C0 | 442 | lua_str_add_value | Lua gsub: applies replacement |
| 0x00537790 | 113 | lua_str_pattern_classend | Lua pattern: class end position |
| 0x00537810 | 260 | lua_str_gmatch_aux | Lua 5.1 internal: lua str gmatch aux |
| 0x00537920 | 139 | lua_open_string_lib | Lua 5.1 internal: lua open string lib |
| 0x005379B0 | 1023 | lua_str_pattern_match | Lua pattern: recursive match engine |
| 0x00537E20 | 238 | lua_str_match_class | Lua pattern: char class test |
| 0x00537F60 | 350 | lua_str_matchbracketclass | Lua pattern: bracket [set] match |
| 0x00538110 | 147 | lua_str_max_expand | Lua pattern: greedy quantifier |
| 0x005381B0 | 212 | lua_str_push_captures | Lua pattern: push all captures |
| 0x00538290 | 148 | lua_str_push_one_capture | Lua pattern: push single capture |
| 0x00538330 | 76 | lua_str_start_capture | Lua pattern: begin capture |
| 0x00538380 | 717 | lua_str_find_aux | Lua str_find_aux - find/match impl |
| 0x00538650 | 24 | lua_str_writer | Lua dump writer callback |
| 0x00538670 | 69 | lua_table_hashnum | Lua 5.1 internal: lua table hashnum |
| 0x005386C0 | 84 | lua_table_free | Lua luaH_free - frees table |
| 0x00538720 | 159 | lua_table_mainposition_get | Lua luaH_get - table key lookup |
| 0x005387C0 | 236 | lua_table_getn | Lua luaH_getn - table array length |
| 0x005388B0 | 146 | lua_table_getnum | Lua luaH_getnum - int key lookup |
| 0x00538950 | 57 | lua_table_getstr | Lua luaH_getstr - string key lookup |
| 0x00538990 | 94 | lua_table_new | Lua luaH_new - creates empty table |
| 0x005389F0 | 383 | lua_table_next | Lua luaH_next - table iteration |
| 0x00538B70 | 63 | lua_table_rehash_resize | Lua luaH_resizearray |
| 0x00538BB0 | 230 | lua_table_newkey | Lua luaH_set - sets value for key |
| 0x00538CA0 | 70 | lua_table_setnum | Lua luaH_setnum - sets int key |
| 0x00538CF0 | 89 | lua_table_setstr | Lua luaH_setstr - sets string key |
| 0x00538D50 | 147 | lua_table_mainposition | Lua mainposition - hash node for key |
| 0x00538E00 | 243 | lua_table_newkey_insert | Lua luaH_newkey - inserts new key |
| 0x00538F00 | 591 | lua_table_rehash | Lua rehash - computes optimal sizes |
| 0x00539150 | 404 | lua_table_resize | Lua luaH_resize - resizes table |
| 0x005392F0 | 106 | lua_table_resize_array | Lua setarrayvector - reallocs array |
| 0x00539360 | 199 | lua_table_resize_hash | Lua setnodevector - allocs hash nodes |
| 0x00539430 | 133 | lua_tbl_foreachi | Lua table.foreachi - deprecated |
| 0x005394C0 | 133 | lua_tbl_foreach | Lua table.foreach - deprecated |
| 0x00539550 | 149 | lua_tbl_maxn | Lua table.maxn - largest numeric key |
| 0x005395F0 | 43 | lua_tbl_getn | Lua table.getn - table length |
| 0x00539620 | 47 | lua_tbl_setn | Lua table.setn - deprecated |
| 0x00539650 | 164 | lua_tbl_insert | Lua table.insert - inserts at position |
| 0x00539700 | 144 | lua_tbl_remove | Lua table.remove - removes at position |
| 0x00539790 | 345 | lua_tbl_concat | Lua table.concat - concatenates with sep |
| 0x005398F0 | 95 | lua_tbl_sort | Lua table.sort - sorts in-place |
| 0x00539950 | 945 | lua_tbl_sort_quicksort | Lua table.sort: quicksort impl |
| 0x00539D10 | 31 | lua_open_table_lib | Lua luaopen_table - registers table lib |
| 0x00539D30 | 110 | lua_tbl_sort_compare | Lua sort_comp - custom or default compare |
| 0x00539DA0 | 43 | lua_tm_fastget | Lua luaT_gettm - metamethod lookup |
| 0x00539DD0 | 79 | lua_tm_gettmbyobj | Lua luaT_gettmbyobj - metamethod by object type |
| 0x00539E20 | 84 | lua_tm_init_strings | Lua luaT_init - interns metamethod names |
| 0x00539E80 | 154 | lua_cli_dofile | Lua CLI: loads and executes file via luaL_loadfile |
| 0x00539F20 | 177 | lua_cli_dostring | Lua CLI: loads and executes string |
| 0x00539FE0 | 581 | lua_cli_dotty_repl | Lua CLI: interactive REPL loop |
| 0x0053A230 | 469 | lua_cli_handle_script | Lua CLI: handles script with arg table |
| 0x0053A410 | 39 | lua_cli_sigint_handler | Lua CLI: SIGINT signal handler |
| 0x0053A440 | 33 | lua_cli_sigint_hook | Lua CLI: debug hook for SIGINT |
| 0x0053A470 | 166 | lua_cli_main | Lua CLI: main entry point |
| 0x0053A520 | 743 | lua_cli_pmain | Lua CLI: protected main, processes args |
| 0x0053A910 | 46 | lua_cli_print_version | Lua CLI: prints Lua 5.1.4 version |
| 0x0053A940 | 299 | lua_cli_pushline | Lua CLI: reads line from stdin with prompt |
| 0x0053AA70 | 160 | lua_cli_report_error | Lua CLI: reports error to stderr |
| 0x0053AB10 | 162 | lua_cli_traceback | Lua CLI: error handler with debug.traceback |
| 0x0053ABC0 | 755 | lua_undump_constants | Lua luaU: loads constants and sub-protos |
| 0x0053AED0 | 756 | lua_undump_debug_info | Lua luaU: loads debug info from bytecode |
| 0x0053B1D0 | 591 | lua_undump_function | Lua luaU: loads complete Proto from bytecode |
| 0x0053B420 | 108 | lua_undump_read_int | Lua luaU: reads 4-byte int from bytecode |
| 0x0053B490 | 155 | lua_undump_read_string | Lua luaU: reads length-prefixed string |
| 0x0053B530 | 28 | lua_undump_make_header | Lua luaU_header - 12-byte header |
| 0x0053B550 | 250 | lua_undump_luaU_undump | Lua luaU_undump - loads precompiled bytecode |
| 0x0053B650 | 491 | lua_vm_arith | Lua luaV_arith - arithmetic with coercion and metamethods |
| 0x0053B860 | 162 | lua_vm_call_tm | Calls a tag method: pushes TM + args on stack, invokes it, copies result back to target |
| 0x0053B910 | 120 | lua_vm_call_order_tm | Calls ordering tag method (__lt/__le) on two operands, returns 0/1/-1 |
| 0x0053B990 | 134 | lua_vm_get_equalTM | Gets __eq tag method from two metatables, returns TM only if both have same handler |
| 0x0053BA20 | 127 | lua_string_compare_locale | Compares two Lua strings using strcoll for locale-aware ordering |
| 0x0053BAA0 | 668 | lua_vm_concat | Concatenates Lua values on stack, converting numbers to strings and using __concat TM |
| 0x0053BD40 | 169 | lua_vm_equalobj | Tests equality of two Lua objects with __eq metamethod support for tables/userdata |
| 0x0053BE10 | 5658 | lua_vm_execute | Main Lua VM execution loop: decodes/dispatches all opcodes (MOVE,LOAD,ARITH,CALL,etc) |
| 0x0053D4F0 | 228 | lua_vm_gettable | Table index operation with __index metamethod chain, max 100 iterations |
| 0x0053D5E0 | 108 | lua_vm_lessthan | Less-than comparison for numbers, strings (locale), or via __lt metamethod |
| 0x0053D650 | 404 | lua_vm_settable | Table assignment with __newindex metamethod chain, max 100 iterations, handles GC barrier |
| 0x0053D7F0 | 73 | lua_vm_tonumber | Converts a Lua value to number: returns as-is if number, converts string via str2number |
| 0x0053D840 | 136 | lua_vm_tostring | Converts a number value to string in-place using sprintf with %.14g format |
| 0x0053D8D0 | 62 | lua_zio_getc | Reads one byte from a Lua ZIO stream, refilling buffer via reader callback if needed |
| 0x0053D910 | 39 | lua_zio_init | Initializes a Lua ZIO stream with reader function, data pointer, and lua_State |
| 0x0053D940 | 69 | lua_zio_lookahead | Peeks at next byte in ZIO stream without consuming it, refills buffer if empty |
| 0x0053D990 | 85 | lua_zio_buffer_ensure | Ensures ZIO buffer has at least param_3 bytes capacity, grows with min 32 bytes |
| 0x0053D9F0 | 109 | lua_zio_read | Reads param_3 bytes from ZIO stream into buffer, refilling via reader callback as needed |
| 0x0053DA60 | 792 | lua_debug_print_code | Prints disassembly of Lua bytecode instructions with opcode names and operands |
| 0x0053DDC0 | 413 | lua_debug_print_constant | Prints a Lua constant value with escape sequences for special chars in strings |
| 0x0053E000 | 516 | lua_debug_print_constants | Prints all constants of a Lua prototype including nil, bool, number, and string values |
| 0x0053E2A0 | 462 | lua_debug_print_function | Recursively prints Lua function prototype info: instructions, constants, locals, upvalues |
| 0x0053E470 | 48 | lua_debug_printf | Wrapper for fprintf to stdout used by Lua debug print functions |
| 0x0059FC70 | 322 | lua_quest_add_objective_text | Lua callback: adds quest objective text |
| 0x0059FDC0 | 331 | lua_quest_set_npc_image | Lua callback: sets quest NPC portrait image |
| 0x0059FF10 | 892 | lua_quest_add_reward_items | Lua callback: adds reward items to quest |
| 0x005A0290 | 1366 | lua_quest_load_resource_entries | Lua 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. |
| 0x005A07F0 | 331 | lua_quest_set_npc_name_from_table | Lua callback: sets NPC name from quest data table |
| 0x005A0940 | 567 | lua_quest_add_hunting_target | Lua callback: adds hunting target to quest |
| 0x005A0B80 | 346 | lua_quest_add_mob_id_to_group | Lua callback: adds mob ID to quest mob group |
| 0x005A0CE0 | 962 | lua_quest_register_sale_event | Lua callback: registers item sale event with date validation |
| 0x005B8D50 | 121 | CLuaState__construct | Constructs Lua state wrapper; sets vtable, allocates 4-byte state ptr, registers with Lua manager |
| 0x005B8DE0 | 105 | CLuaState__destruct | Destroys Lua state wrapper; unregisters from manager, closes Lua state, frees 4-byte allocation |
| 0x005B8E50 | 30 | CLuaState__scalar_dtor_4byte | Scalar deleting destructor for 4-byte Lua state object; frees if flag bit 0 set |
| 0x005B8E70 | 126 | CLuaState__scalar_dtor_8byte | Scalar deleting destructor for 8-byte Lua state wrapper; destroys state, frees if flag bit 0 set |
| 0x00673C50 | 562 | lua_insert_pet_evolution_recipe | Lua 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. |
| 0x00673E90 | 357 | lua_insert_pet_auto_feeding | Lua 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. |
| 0x006BCB90 | 112 | lua_get_job_group_type | Lua binding: maps DAT_01733c60 job class ID to job group type (0-0x27), returns via json_internal |
| 0x006BCE30 | 485 | lua_get_option_sub_index | Lua binding: maps job class ID to sub-index per option type (1-4), returns result via json_internal |
| 0x006BD3C0 | 663 | lua_get_option_handler_result | Lua binding: looks up option by hash in global option manager, invokes handler vtable call, returns result |
| 0x006BD660 | 876 | lua_get_shop_item_price | Lua binding: looks up item ID, constructs CShopItem, returns item price from local_a4 field |
| 0x006BD9D0 | 772 | lua_get_option_enabled_state | Lua binding: initializes option manager if needed, looks up option by hash, returns enabled state |
| 0x006BDCE0 | 663 | lua_get_option_handler_result_2 | Lua binding: looks up option by hash in global option manager, invokes handler vtable call, returns int result |
| 0x006BDF80 | 863 | lua_get_shop_item_atoi_field | Lua binding: looks up item, constructs CShopItem, returns atoi of a string field from item data |
| 0x006BE2F0 | 175 | lua_get_option_manager_dispatch | Lua binding: initializes option manager, calls vtable dispatch on it, returns result via json_internal |
| 0x006BE3A0 | 732 | lua_get_sprite_name_without_rsw | Lua binding: gets sprite name from player actor, strips ".rsw" extension, returns string result |
| 0x006BE680 | 53 | lua_get_pet_intimacy_level | Lua binding: returns pet intimacy level as a number. Wraps get_pet_intimacy_level() for Lua access. |
| 0x006BE6C0 | 46 | lua_get_current_job_id | Lua binding: returns the current job class ID by calling ItemBonus__get_job_group_from_skill_id and pushing the result as a number |
| 0x006BE6F0 | 839 | lua_get_shop_item_custom_value | Lua binding: looks up item, constructs CShopItem, returns custom int value from item field offset 0xcc |
| 0x006BEA40 | 487 | lua_get_skill_group_count | Lua binding: takes a numeric argument, looks up skill group via CSkillMgr, returns count field at offset 0x10 from the found entry |
| 0x006BEC30 | 545 | lua_get_option_info | Lua binding: retrieves option information from global game settings data |
| 0x006BEFA0 | 671 | lua_get_option_data | Lua binding: retrieves option data from the game settings system |
| 0x006BF240 | 54 | lua_get_server_type_flag | Lua binding: returns 2 if DAT_0173823c==1 (server type flag), else 0, via json_internal |
| 0x006BF280 | 359 | lua_dispatch_chat_message | Lua binding: takes a string argument, converts codepage encoding, and dispatches it as a chat message via CUIWindowMgr__dispatch_chat_message with color 0xFFFF |
| 0x006BF3F0 | 882 | lua_process_option_config | Lua binding: processes option configuration data with multiple json reads and returns status |
| 0x007A7DB0 | 230 | CLuaScript__FormatErrorString | Formats an error string using vsprintf into a 2048-byte buffer, then constructs an std::string from it. Used for Lua script error messages. |
| 0x007A80B0 | 542 | CLuaScript__RegisterEffectCallback | Lua callback to register an effect callback. Validates args (1st=number, 2nd=string), gets effect ID, creates callback entry in vector. Returns 2. |
| 0x007A82D0 | 460 | CLuaScript__RegisterItemEffectCallback | Lua 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. |
| 0x007A8FB0 | 126 | CLuaScriptError__ctor | Constructor for CLuaScriptError exception. Inherits from std::exception, copies error message, sets vtable chain. |
| 0x007A9510 | 103 | CLuaScriptError__scalar_deleting_dtor | Scalar deleting destructor for CLuaScriptError. Calls base exception destructor and optionally frees 0xC bytes. |
| 0x007AE600 | 754 | lua_CTipBox__AddPageEx | Lua 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. |
| 0x007AE900 | 277 | lua_CTipBox__AddImgcoord | Lua 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. |
| 0x007AEA20 | 202 | lua_CTipBox__AddIsTag | Lua 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). |
| 0x007AEAF0 | 262 | lua_CTipBox__AddPage | Lua 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. |
| 0x007AEC00 | 486 | lua_CTipBox__AddTip | Lua 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. |
| 0x0083BAF0 | 94 | lua_callback_navigate_to_npc | Lua 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. |
| 0x0083BB50 | 101 | lua_callback_show_item_info | Lua 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. |
| 0x0083BBC0 | 186 | lua_callback_open_url | Lua callback that opens a URL in the default browser. Reads URL string from vector, calls ShellExecuteA with "open" action and SW_SHOW. |
| 0x00941870 | 310 | lua_add_item_to_exception_minimap_pos_list | Lua 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. |
| 0x009419B0 | 442 | lua_add_item_to_kafra_service_map_list | Lua 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. |
| 0x00ADEA70 | 293 | lua_callback_AddItem | Lua 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. |
| 0x00ADEBA0 | 370 | lua_callback_AddEffect | Lua 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. |
| 0x00AE07A0 | 975 | lua_callback_item_AddItem | Lua 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. |
| 0x00AE0B70 | 305 | lua_callback_AddItemEffectInfo | Lua callback for AddItemEffectInfo. Takes item ID and effect info number, stores at offset 0x88 of the cache entry. |
| 0x00AE0CB0 | 430 | lua_callback_AddItemIdentifiedDesc | Lua callback for AddItemIdentifiedDesc. Takes item ID (number) and description string, appends the string to the identified description vector (offset 0x74) of the cache entry. |
| 0x00AE0E60 | 306 | lua_callback_AddItemIsCostume | Lua 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. |
| 0x00AE0FA0 | 305 | lua_callback_AddItemPackageID | Lua callback for AddItemPackageID. Takes item ID and package ID (both numbers), stores package ID at offset 0x8C of the cache entry. |
| 0x00AE10E0 | 430 | lua_callback_AddItemUnidentifiedDesc | Lua callback for AddItemUnidentifiedDesc. Takes item ID (number) and description string, appends to the unidentified description vector (offset 0x38) of the cache entry. |
| 0x00AFC860 | 74 | lua_close_state | Closes a Lua state. Calls lua_close if the state pointer is non-null, then sets it to 0. |
| 0x00AFC9A0 | 887 | lua_call_function | Calls 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. |
| 0x00AFCD90 | 921 | lua_call_method | Calls 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. |
| 0x00AFD240 | 85 | lua_get_global_bool | Gets 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. |
| 0x00AFD2A0 | 102 | lua_get_global_int | Gets 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. |
| 0x00AFD310 | 379 | lua_get_global_string | Gets 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. |
| 0x00AFD490 | 57 | lua_check_global_is_table | Checks if a global Lua variable is a table. Pushes global by name, gets type. Returns 1 if type is 5 (LUA_TTABLE), 0 otherwise. |
| 0x00AFD4D0 | 848 | lua_get_table_as_sorted_list | Reads 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. |
| 0x00AFD830 | 432 | lua_call_table_function | Calls 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. |
| 0x00AFD9E0 | 517 | lua_call_table_function_get_string | Calls 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. |
| 0x00AFDBF0 | 104 | lua_set_and_call_table_field | Sets 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. |
| 0x00AFDC60 | 255 | lua_table_field_dispatch | Dispatches 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. |
| 0x00AFDD60 | 67 | lua_load_and_execute_file | Loads 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. |
| 0x00AFDDB0 | 26 | lua_close_state_inline | Inline version of lua_close_state. Calls lua_close if state is non-null, then zeroes the pointer. |
| 0x00AFDDD0 | 54 | lua_reset_and_init_state | Resets 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. |
| 0x00AFDE10 | 67 | lua_create_new_thread | Creates 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. |
| 0x00AFE7D0 | 989 | lua_callback__change_data_directory | Lua 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. |
| 0x00AFEBD0 | 126 | lua_callback__set_rgb_color | Lua 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). |
| 0x00AFED50 | 161 | lua_callback__add_need_skill_list | Lua 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). |
| 0x00AFEE00 | 327 | lua_callback__add_skill_list | Lua 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. |
| 0x00AFEF50 | 201 | lua_callback__get_cmd_onoff_value | Lua 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. |
| 0x00AFF020 | 282 | lua_callback__set_cmd_onoff_list | Lua 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. |
| 0x00AFF140 | 1261 | lua_callback__set_sub_chat_wnd_list | Lua 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. |
| 0x00AFF630 | 424 | lua_callback__set_sub_chat_wnd_option | Lua 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. |
| 0x00AFF7E0 | 266 | lua_callback__trace_value | Lua 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. |
| 0x00AFF8F0 | 529 | lua_callback__add_cashshop_banner2 | Lua 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. |
| 0x00AFFB10 | 529 | lua_callback__add_cashshop_banner | Lua 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. |
| 0x00AFFD30 | 560 | lua_callback__add_check_attendance_banner | Lua 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. |
| 0x00AFFF60 | 82 | lua_callback__add_ingredient | Lua 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. |
| 0x00AFFFC0 | 62 | lua_callback__add_ingredient_lapine | Lua 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. |
| 0x00BAC770 | 256 | lua_get_robe_sprite_name | Calls 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. |
| 0x00D9E3F0 | 49 | CLuaState__ctor | CLuaState 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. |
| 0x00D9E430 | 82 | CLuaState__dtor | CLuaState destructor. Sets vtable, closes lua_State via lua_close if non-null, zeros pointer. |
| 0x00D9E490 | 103 | CLuaState__scalar_deleting_dtor | CLuaState scalar deleting destructor. Closes lua_State if present, frees 0x18 bytes if param_2 bit 0 set. |
| 0x00D9EAF0 | 432 | lua_ai_attack_homunculus | Lua 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. |
| 0x00D9ECA0 | 354 | lua_ai_attack_mercenary | Lua AI Attack function for mercenary. Similar to homunculus version but uses mercenary-specific entity checks and rate limiting globals. |
| 0x00D9EE10 | 220 | lua_ai_get_actors | Lua 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. |
| 0x00D9EEF0 | 285 | lua_ai_get_msg | Lua AI GetMsg. Gets entity message data via virtual method 0xCC. Returns table with message type and params (varies by type: position, target, skill info). |
| 0x00D9F0B0 | 413 | lua_ai_get_res_msg | Lua AI GetResMsg. Similar to GetMsg but uses virtual method 0xD4 for response messages. Returns table with message type and parameters. |
| 0x00D9F270 | 55 | lua_ai_get_tick | Lua AI GetTick. Returns GetTickCount() as a double to Lua. |
| 0x00D9F2B0 | 175 | lua_ai_move_homunculus | Lua AI Move function for homunculus. Reads entity ID, x, y from Lua stack, validates entity, sends move packet via CNetworkSession. |
| 0x00D9F415 | 592 | lua_get_skill_target_position | Lua 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. |
| 0x00D9F8E0 | 1573 | lua_ai_move_mercenary | Lua AI Move function for mercenary. Reads entity ID, x, y from Lua stack, validates entity, sends move packet via CNetworkSession. |
| 0x00D9FF50 | 361 | lua_ai_is_monster | Lua AI IsMonster. Reads entity ID from Lua stack, checks if entity is a monster type. Returns boolean result to Lua. |
| 0x00DA00D0 | 388 | lua_ai_move_command | Lua AI Move command. Reads entity ID and coordinates from Lua stack, sends movement command. |
| 0x00DA0260 | 146 | lua_ai_move_to_owner | Lua AI MoveToOwner. Moves the AI-controlled entity to its owner's position. |
| 0x00DA0300 | 285 | lua_ai_skill_ground | Lua AI SkillGround. Uses ground-targeted skill. Reads skill ID, level, x, y from Lua stack and sends skill packet. |
| 0x00DA0420 | 521 | lua_ai_skill_object | Lua AI SkillObject. Uses target-directed skill. Reads skill ID, level, target ID from Lua stack and sends skill packet. |
| 0x00DA0630 | 229 | lua_ai_trace | Lua AI Trace. Debug logging function. Reads string from Lua stack and outputs to debug trace. |
| 0x00DA0720 | 1345 | lua_ai_trace_ai | Lua AI TraceAI. Extended debug trace for AI state. Logs AI behavior messages. |
| 0x00DA0C70 | 274 | lua_ai_trace_value | Lua AI TraceValue. Debug function to trace variable values from Lua AI scripts. |
| 0x00DA0D90 | 67 | lua_ai_push_key_value_pair | Lua AI helper. Pushes a key-value pair (both ints) to Lua table at top of stack. |
| 0x00DDBB60 | 1251 | lua_get_table_string_value_for_c | Retrieves 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. |
| 0x00DE0830 | 167 | lua_get_real_weapon_id | Calls the Lua function 'GetRealWeaponId' with the given weapon ID parameter. Returns the Lua result if the call succeeds, otherwise returns the input param unchanged. |
| 0x00DE3800 | 223 | lua_req_weapon_name_by_class_num | Calls the Lua function 'ReqWeaponNameByClassNum' with the current item description data. Returns the string result or empty string if Lua call fails. |
| 0x00E08A00 | 314 | lua_call_HaveSkillEffectInfo | Allocates a string "HaveSkillEffectInfo" and calls the corresponding Lua function via lua_call_function. Used to query Lua for skill effect information. |
| 0x00E090E0 | 259 | lua_get_default_option_value_float | Calls 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. |
| 0x00E091F0 | 211 | lua_get_default_option_value_int | Calls Lua function "l_GetDefaultOptionValue" with a parameter from this+23000. Returns the default value param_3 unchanged (Lua call may have side effects). |
| 0x00E092D0 | 407 | lua_get_default_option_value_string | Calls 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. |
| 0x00E09790 | 345 | lua_get_hotkey_config | Calls 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. |
| 0x00E0A4C0 | 419 | lua_get_original_hotkey_list_size | Calls 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. |
| 0x00E0A670 | 229 | lua_get_option_value_float | Calls 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. |
| 0x00E0A760 | 301 | lua_get_option_value_struct | Calls 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. |
| 0x00E0A890 | 181 | lua_get_option_value_int | Calls Lua function "l_GetOptionValue" with a parameter from this+23000. Returns param_3 unchanged (Lua call may have side effects on globals). |
| 0x00E0A950 | 375 | lua_get_option_value_string | Calls Lua function "l_GetOptionValue" with a parameter from this+23000. Initializes an STL string from param_4 and returns it in param_2. |
| 0x00E0AC40 | 202 | lua_get_pet_acc_act_name | Calls 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. |
| 0x00E0AE00 | 170 | lua_get_pet_food_item | Calls 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. |
| 0x00E0B170 | 218 | lua_get_pet_illust_name_v3 | Calls Lua function "GetPetIllustName_V3" with a parameter from this+23000. Formats the result via lua_util_sprintf. |
| 0x00E0B250 | 195 | lua_get_pet_jtid_by_egg_itid | Calls 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. |
| 0x00E12780 | 169 | lua_get_pet_string | Calls 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. |
| 0x00E19110 | 273 | lua_get_job_inherit_table | Queries 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. |
| 0x00E19230 | 315 | lua_get_title_string | Calls Lua function "GetTitleString" with param_2. Returns the resulting string in param_1 as an STL string. Returns empty string if Lua call fails. |
| 0x00E1E250 | 932 | lua_create_skill_effects | Creates 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. |
| 0x00E24550 | 898 | lua_check_have_skill_effect_info | Calls 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. |
| 0x00E24DE0 | 865 | lua_create_ground_skill_effects | Creates 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. |
| 0x00E25970 | 255 | lua_reset_hotkey_bindings | Calls Lua function "ResetTheHotKey" twice with different parameters to reset two hotkey bars (0x84/0xC0 and 0x87/0x24 at position 0x12, mode 1). |
No function here matches that. Search all 47,061 functions instead.