function utils.PrintTable()

in ransomware/artifact.lua [354:388]


function utils.PrintTable(t)
    local printTable_cache = {}

    local function sub_printTable(t, indent)

        if (printTable_cache[tostring(t)]) then
            utils.DebugLog(indent .. '*' .. tostring(t))
        else
            printTable_cache[tostring(t)] = true
            if (type(t) == 'table') then
                for pos, val in pairs(t) do
                    if (type(val) == 'table') then
                        utils.DebugLog(indent .. '[' .. pos .. '] => ' .. tostring(t) .. ' {')
                        sub_printTable(val, indent .. string.rep(' ', string.len(pos) + 8))
                        utils.DebugLog(indent .. string.rep(' ', string.len(pos) + 6) .. '}')
                    elseif (type(val) == 'string') then
                        utils.DebugLog(indent .. '[' .. pos .. '] => "' .. val .. '"')
                    else
                        utils.DebugLog(indent .. '[' .. pos .. '] => ' .. tostring(val))
                    end
                end
            else
                utils.DebugLog(indent .. tostring(t))
            end
        end
    end

    if (type(t) == 'table') then
        utils.DebugLog(tostring(t) .. ' {')
        sub_printTable(t, '  ')
        utils.DebugLog('}')
    else
        sub_printTable(t, '  ')
    end
end