Files
GaCy-GO/tools/cw_wave_config_identity.lua
T
2026-10-28 18:54:43 +07:00

24 lines
2.1 KiB
Lua

-- Isolated protobuf conversion only, verified native 166b4da0 / 166b5510:
-- allocates data objects and copies scalar fields; no scene/table/game action.
do local function capture()
if _G.__gacCwWaveConfigIdentity3 then return end;_G.__gacCwWaveConfigIdentity3=true
local log=function(x)CS.UnityEngine.Debug.Log('[GAC_CW_WAVE_CONFIG_ID] '..tostring(x))end
local ok,err=pcall(function()
local flags=CS.System.Enum.ToObject(typeof(CS.System.Reflection.BindingFlags),60)
local p=typeof(CS.RPG.GameCore.BattleInstance):GetMethod('GetCurWaveParam',flags).ReturnType
local helper=p.Assembly:GetType('FKOEECADKFF');local ms=helper:GetMethods(flags);local convert
for i=0,math.min(ms.Length-1,63)do local m=ms[i];if m.ReturnType==p and m:GetParameters().Length==1 then convert=m;break end end
if not convert then error('Named converter missing')end
local sourceType=convert:GetParameters()[0].ParameterType;local raw=CS.System.Activator.CreateInstance(sourceType)
local setters=sourceType:GetMethods(flags);for i=0,math.min(setters.Length-1,95)do local m=setters[i];local ps=m:GetParameters();if m.DeclaringType==sourceType and not m.IsStatic and m.ReturnType==typeof(CS.System.Void) and ps.Length==1 and ps[0].ParameterType==typeof(CS.System.UInt32)then raw[m.Name](raw,1)end end
local args=CS.System.Array.CreateInstance(typeof(CS.System.Object),1);args:SetValue(raw,0)
local invokeFlags=CS.System.Enum.ToObject(typeof(CS.System.Reflection.BindingFlags),0)
local converted=convert:Invoke(nil,invokeFlags,nil,args,nil);local config=p:GetField('FGNHFJHBPIM',flags):GetValue(converted)
if not config then error('Isolated conversion has no config reference')end
local t=config:GetType();log('TYPE '..t.FullName..' BASE '..tostring(t.BaseType))
local fs=t:GetFields(flags);for i=0,math.min(fs.Length-1,31)do log('FIELD '..tostring(fs[i]))end
local methods=t:GetMethods(flags);for i=0,math.min(methods.Length-1,31)do local m=methods[i];if m.DeclaringType==t then log('METHOD '..tostring(m)..' HANDLE '..tostring(m.MethodHandle.Value))end end
end)
if not ok then log('ERROR '..tostring(err))end;log('END')
end;capture()end