Files
GaCy-GO/tools/peak_resolve_converter.lua
T

27 lines
1.2 KiB
Lua

-- One previously captured method token through reflection, not a type scan.
do
if not _G.__gacPeakResolveConverter1 then
_G.__gacPeakResolveConverter1=true
local function log(v)CS.UnityEngine.Debug.Log('[GAC_PEAK_CONVERTER] '..tostring(v))end
local ok,err=pcall(function()
local owner=typeof(CS.RPG.Client.BattleModule).Module
local flags=CS.System.Enum.ToObject(typeof(CS.System.Reflection.BindingFlags),60)
local methods=owner:GetType():GetMethods(flags)
local method=nil
for i=0,methods.Length-1 do
local m=methods[i]
if m.Name=='ResolveMethod' and m:GetParameters().Length==1 then method=m;break end
end
if not method then error('ResolveMethod is absent from Module reflection metadata')end
local typed=CS.System.Array.CreateInstance(typeof(CS.System.Int32),1)
typed[0]=101219446 -- Native converter token check 0x87c76.
local args=CS.System.Array.CreateInstance(typeof(CS.System.Object),1)
CS.System.Array.Copy(typed,0,args,0,1)
local result=method:Invoke(owner,CS.System.Enum.ToObject(typeof(CS.System.Reflection.BindingFlags),0),nil,args,nil)
log('RESULT '..tostring(result))
end)
if not ok then log('ERROR '..tostring(err))end
end
end