Rewrite of the loop with inner loops with comments to main fixed issues (one mistake and one statement misplacement):
local executable = {}
for i = 1, #exe do
local stringBytes = {}
local startAddress = strPointer[i].value - 1
for j = 1, 150 do
stringBytes[j] = {address = startAddress + j, flags = gg.TYPE_BYTE}
end
stringBytes = gg.getValues(stringBytes)
local stringChars = {}
for index, byte in ipairs(stringBytes) do
local value = byte.value
if value == 0 then -- comparison to string "0" is a mistake since value field is a number
break
end
stringChars[index] = string.char(value & 0xFF)
end
local str = table.concat(stringChars) -- get final string only once after construction of table with characters is finished
executable[i] = {address = exe[i].address, flags = gg.TYPE_DWORD, name = str}
end
gg.addListItems(executable)