Convert a table's hexadecimal memory address to a table

Hello Developers!

I’m trying to find out how I could possible take a table’s hexadecimal address and convert it back to it’s original table format.

local ABC = {"hi", "hello", "hey"}
print(tostring(ABC))

--// table: 0x67643fee05eb0991

I’ve been searching for a while and I’m completely uncertain on how to do this - help would be greatly appreciated.

If you go to the output, and click the 3 dots, you should see an option labelled ‘Log Mode’. Turn it off.

I know how to turn Log Model on/off, I’m asking how I can convert the table’s original hexadecimal address to its original table format.

In other words, taking table: 0x67643fee05eb0991, and converting it back to: {"hi", "hello", "hey"}.

You don’t. That’s the address in memory where the table is stored, you can’t make a function from it.

1 Like

Unfortunately, in order to get a table from a memory location, you would need memory pointers which Lua dose not have. However …

You could make a dictionary which stores the string memory addresses as a key and the table as a value. You could also use a metamethod so when the table is garbage collected, it will remove itself from this dictionary