luaZ_read
function · lua · boundary
- Address
0x6fb520· 146 bytes, up to0x6fb5b1- Meaning
- Copies a number of bytes out of a stream, refilling it as needed, and returns the bytes missing
- Confidence
- verified, proof two
- Finding
- lua/runtime#input-streams
Finding: Input streams in lua: calls, states and the collector
The compiler (compiler) reads its input through a stream record: a count n at +0, the next byte p
at +4, the reader function at +8, its data at +0xc and the chunk name at +0x10. luaZ_init
fills it and luaZ_fill calls the reader with a null state, the data and the address of a size,
keeping the block it returns. luaZ_lookahead peeks at the next byte, luaZ_read copies a number
of bytes out. luaZ_openspace grows the lexer's work buffer to at least 32 bytes.
| function | name | decided by |
|---|---|---|
0x6fb480 | luaZ_fill | reader called through [esi+8] (0x6fb490), null or empty block gives -1 (0x6fb4b2), count minus 1 (0x6fb4a0) |
0x6fb4c0 | luaZ_lookahead | luaZ_fill when the count is 0 (0x6fb4c8), the byte put back (0x6fb4db, 0x6fb4dc) |
0x6fb4f0 | luaZ_init | stores at +8, +0xc, +0x10 (0x6fb4f6, 0x6fb4fc, 0x6fb4ff), count and pointer zeroed (0x6fb502, 0x6fb508) |
0x6fb520 | luaZ_read | luaZ_fill (0x6fb548), rep movs (0x6fb573, 0x6fb57d), 0 when all bytes were read (0x6fb59e), the bytes still wanted at the end of the stream (0x6fb5a8) |
0x6fb5c0 | luaZ_openspace | size test (0x6fb5cd), floor 32 (0x6fb5d1), luaM_irealloc in lzio.c (0x6fb5e6) |
The derivation is in the doc.
Callers 1
- ezread lua
Callees 1
- luaZ_fill lua
Calls and jumps by a bare address, from tables/calls.tsv.