Комментарии 3
Продолжение скрипта..
)
)
catch() -- игнорируем свойства, которые нельзя прочитать
)
-- customAttributes
if isProperty obj #customAttributes then
(
try
(
for ca in obj.customAttributes do
(
local caStr = ca as string
for pattern in patterns do if matchPattern caStr pattern pattern:"regex" then append findings #(obj.name, "customAttribute", pattern)
)
)
catch()
)
-- контроллеры анимации (ScriptController и ExpressionController)
-- Проверяем наиболее типичные controller-ы
local ctlProps = #(#position_controller, #rotation_controller, #scale_controller, #transform_controller)
for ctlProp in ctlProps do
(
if isProperty obj ctlProp then
(
try
(
local ctl = getProperty obj ctlProp
if ctl != undefined then
(
-- ScriptController имеет .script, ExpressionController может иметь .expression или.toString
if classOf ctl == ScriptController then
(
local scriptText = ctl.script
for pattern in patterns do if matchPattern scriptText pattern pattern:"regex" then append findings #(obj.name, ctlProp as string, pattern)
)
else
(
-- Попробуем конвертировать контроллер в строку и искать в ней
local ctlStr = ctl as string
for pattern in patterns do if matchPattern ctlStr pattern pattern:"regex" then append findings #(obj.name, ctlProp as string, pattern)
)
)
)
catch()
)
)
-- материалы и вложенные карты (приближённо: toString матрицы и карт)
if isProperty obj #material and obj.material != undefined then
(
try
(
local matStr = obj.material as string
for pattern in patterns do if matchPattern matStr pattern pattern:"regex" then append findings #(obj.name, "material", pattern)
)
catch()
)
-- XRef объекты: merge внешнюю сцену и просканировать добавленные объекты
if isProperty obj #isXRefObject and obj.isXRefObject then
(
local xrefFile = obj.xrefFile
if xrefFile != undefined then
(
-- ВНИМАНИЕ: mergeMAXFile импортирует содержимое XRef в текущую сцену.
-- Это сохраняет удобство тестирования, но изменяет сцену. Будь осторожен.
-- Используем quiet:true, чтобы не мешать интерфейсу.
try
(
local beforeObjs = for o in objects collect o
local tmpScene = mergeMAXFile xrefFile quiet:true
-- Найдём новые объекты, добавленные merge'ом
local afterObjs = for o in objects collect o
local newObjs = for o in afterObjs where findItem beforeObjs o == 0 collect o
for n in newObjs do append findings (scanObjectRecursively n)
-- (Можно дополнительно удалить merged-объекты при желании)
)
catch()
)
)
)
catch()
return findings
)
-- ===== Main function: оболочка Exorcist (не менять интерфейс вызова) =====
fn scanMaxScripts folderPath =
(
if folderPath == undefined or folderPath == "" then
(
format "Usage: scanMaxScripts \"C:\\path\\to\\folder\"\n"
return undefined
)
format "===== MaxScript Exorcist 3.1 =====\n"
format "Scanning folder: %\n" folderPath
-- Сканируем файлы
local fileFindings = scanFilesInFolder folderPath
if fileFindings.count == 0 then format "No suspicious tokens found in scanned scripts.\n"
else
(
format "FOUND % suspicious matches in files:\n" fileFindings.count
for s in fileFindings do format "⚡ - % token: % ⚡\n" s[1] s[2]
)
-- Сканируем сцену
local allObjs = objects as array
format "Scanning scene objects for scripts...\n"
local sceneFindings = #()
for obj in allObjs do append sceneFindings (scanObjectRecursively obj)
if sceneFindings.count == 0 then format "No custom attributes or scripts found in scene objects.\n"
else
(
format "FOUND % suspicious matches in scene objects:\n" sceneFindings.count
for s in sceneFindings do format "⚡ - Object: % Property: % Token: % ⚡\n" s[1] s[2] s[3]
)
return #(fileFindings, sceneFindings)
)
-- ===== Вызов проверки (измени путь по необходимости) =====
scanMaxScripts "C:\\MaxTest\\scan_samples"
Попросите другую нейронку проверить.
Кто из специалистов может посмотреть этот код?
Говорите, значит, вайб кодинг наше все, уволят всех программистов....
Зарегистрируйтесь на Хабре, чтобы оставить комментарий
Попросил GPT5 написать скрипт для приложения 3ds max, который сможет информировать об потенциальных угрозах в 3d-сцене...