Y.A.K.E Advanced Cheater
Reputation: 0
Joined: 15 Jul 2019 Posts: 56
|
Posted: Sat Feb 04, 2023 11:14 pm Post subject: How to get mono (il2cpp) static field address ? |
|
|
| Code: |
local cId = mono_findClass('', 'PlayerManager')
return mono_class_getStaticFieldAddress(mono_enumDomains()[1], cId)
|
return null:
I found a new way, but I don't know how to get the address.
| Code: |
local mea=mono_enumAssemblies()
local all_static = {}
if mea~=nil then
for i=1, #mea do
local iid = mono_getImageFromAssembly(mea[i])
local iname = mono_image_get_name(iid)
if ('Assembly-CSharp.dll' == iname) then
local classes = mono_image_enumClasses(iid)
if classes~=nil then
for j=1, #classes do
--print(classes[j].classname)
if('PlayerManager' == classes[j].classname)then
local fields=mono_class_enumFields(classes[j].class, true)
for l,v in ipairs(fields) do
--print(fields.name)
if v.isStatic == true and v.name == [[Owner]] then
table.insert(all_static,v)
end
end
end
end
end
end
end
end
return all_static
|
return :
| Code: |
1:table
[
1 = table
[
flags = 22
offset = 0
isConst = false
monotype = 18
field = 2899850670568
parent = 2899841166912
name = Owner
typename = PlayerManager
isStatic = true
type = 140737344506736
]
]
|
| Description: |
|
| Filesize: |
136.54 KB |
| Viewed: |
2307 Time(s) |

|
|
|