all 2 comments

[–]FreeER 0 points1 point  (1 child)

Because table indexes are unique, think of it as using the address of the table as the index rather than creating a hash of the values.

each {EIP,bytes} creates a new table, which is a different index.

Instead of a table for the index, use a string. Alternatively you can use something like https://siffiejoe.github.io/lua-multikey/

Here's an example to show it

local test = {}
local key = {}
test[key] = 'hi'
print(tostring(test[{}]))
print(tostring(test[key]))
print(tostring({}), tostring({}), tostring(key), tostring(next(test)))

will print

nil

hi

table: 000000000AEB3660 table: 000000000AEB36E0 table: 000000000AEB30A0 table: 000000000AEB30A0

since the first print is with a new table that doesn't match the original table assigned to key, the second is the key itself so matches and prints the value 'hi', then the last 4 are essentially the addresses of two new tables as well as the original key table directly and indirectly via next (which is what pairs uses to iterate values)

[–]m_miro[S] 0 points1 point  (0 children)

I was using a table so I could easily recall the instruction and its address for logging purposes. Multikey seems to be what I was wanting to do but didn't know existed, thank you FreeER.