CE will compile both.
now if I try to jump to dothing:init, it will always jump to whichever compiled first.
So, how do I get address for each of these methods?
Last edited by TheByteSize on Sat Oct 09, 2021 10:13 pm, edited 2 times in total.
You could do this, might not be the best, but if you can see any way to improve it, go ahead.
Gets class, enumerates methods inside, then iterates between all methods and checks if the name and the parameters are the same. If so, then print.
local methods = mono_class_enumMethods(mono_findClass('','Player'))
for i = 1,#methods do
if methods[i].name == 'UnlockSticker' and mono_method_getSignature(methods[i].method) == 'string,bool' then
print(mono_method_getSignature(methods[i].method)) --Do Compile Here
end end
If getAddress('doing:init') is true, it means that the JIT compilation has already been executed, right?
Do you need mono_compile_method?
Anyway, I think it's C# method overloading.
Since the array of bytes should be different, I think it's easiest to use Auto Assembler:aobScanRegion to get the address.
unfortunately, aobscanregion(x,dothing:init,dothing:init+aaa,0xf) will jump which ever method get compiled first.
Can't methods with the same name be separated by the 0xf part (signature)?
If you can't do that, if I were you, I would consider other places to hook. Good luck.
Last edited by DhaosCollider on Sat Oct 09, 2021 11:09 pm, edited 1 time in total.
If getAddress('doing:init') is true, it means that the JIT compilation has already been executed, right?
Do you need mono_compile_method?
Anyway, I think it's C# method overloading.
Since the array of bytes should be different, I think it's easiest to use Auto Assembler:aobScanRegion to get the address.
unfortunately, aobscanregion(x,dothing:init,dothing:init+aaa,0xf) will jump which ever method get compiled first.
I'm currently word around this problem by giving the end of region address to be have stupid large address.
function findMethodBySignature(nameSpace,className,methodName,signature)
local classId = mono_findClass(nameSpace,className)
local methodTable = mono_class_enumMethods(classId)
for i = 1,#methodTable do
local currentMethod = methodTable[i]
if currentMethod.name == methodName then
local sig = mono_method_getSignature(currentMethod.method)
if sig:match(signature) then return currentMethod.method end
end
end
return nil
end
local nameSpace = ''
local className = ''
local methodName = ''
local signature = ''
local methId = findMethodBySignature(nameSpace,className,methodName,signature)
if methId ~= nil then
local methAddr = mono_compile_method(methId)
unregisterSymbol('myMethod')
registerSymbol('myMethod',methAddr)
end