Files
GaCy-GO/tools/cw_resolve_token_probe.lua
T

26 lines
1.2 KiB
Lua

-- One previously captured method token through reflection, not a type scan.
do
if not _G.__gacCwResolveToken1 then
_G.__gacCwResolveToken1=true
local function log(v)CS.UnityEngine.Debug.Log('[GAC_CW_RESOLVE_TOKEN] '..tostring(v))end
local ok,err=pcall(function()
local owner=typeof(CS.RPG.Client.GridFightModule).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]=101276529 -- Captured GridFightModule.GetSeason.
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