I have been at a 'godmode' script for a week now, and yesterday it finally finished.
After testing it one last time this morning before uploading, the Mono features are suddenly broken.
I have the adress called HealthHandler:sendDamage+4af. This address has worked for a week, through computer restarts, and without any problems. This morning however, it suddenly stopped working.
The script enables but doesn't inject when using the Mono-address, but DOES when I scan for the aob.
When using "go to address" in the disassembler with "HealthHandler:sendDamage+4af" takes me to a different address, not even close to where i want to be. If i use the AOB then it puts me at the right address.
Does anyone have and idea's or suggestions?
I tend not to over rely on mono, especially in my scripts. Its good for using as reference to find a specific assembly region and dissecting structures. From there you can debug as normal to see if any instruction you found would be viable. Then write your script out through a simple aob injection.
But if you're dead set on keeping it that way, try a couple things:
1.
Replace - alloc(code,$1024,0099B17F)
with
alloc(code,$1024,STRAFE.exe)
----------------------------------------------------
2.
ONE_SHOT_DAMAGE:
dd 0 //
INF_HP_ENABLED:
db 0 // Use "dq 0". Being a 64bit process.
ONE_SHOT_ENABLED:
db 0 //
----------------------------------------------------
3.
alloc(INF_HP_ENABLED,1) //
alloc(ONE_SHOT_ENABLED,1) // alloc(ONE_SHOT_ENABLED,8) //Allocate more memory.
alloc(ONE_SHOT_DAMAGE,1) //
----------------------------------------------------
4. Double check the flow of your script. I only really took a quick look at it. But make sure everything in there has a chance to execute, nothing gets skipped over (it happens easier than you might think).
thanks for the general tips, those are really helpful!
I had tried allocating to STRAFE.exe before but it would never activate, somehow it does now.
The reason i wanted to use Mono features is because it would JIT the necessary parts(?), thus not having to take damage before being able to enable the cheat. I also noticed the missing dealloc's, but apart from that i can't find any fault in the code that could trigger it not working with Mono, but working with AOBScan (unless i don't understand some intricincies.
Also another workaround would be to find an instruction that constantly updates.
That's funny, this works (for the moment). I thought USEMONO() is equal to the lua-call. Guess not?
*edit* aaaand it stopped working after a couple restarts. Guess ill keep it on aobscan :/
I thought USEMONO() is equal to the lua-call. Guess not?
For the record USEMONO is equivalent to the monoAA_USEMONO function (registered as an AA command in mono_initialize) in monoscript.lua, which mostly just calls LaunchMonoCollector with some error checking... monoAA_USEMONO
function monoAA_USEMONO(parameters, syntaxcheckonly)
--called whenever an auto assembler script encounters the USEMONO() line
--the value you return will be placed instead of the given line
--In this case, returning a empty string is fine
--Special behaviour: Returning nil, with a secondary parameter being a string, will raise an exception on the auto assembler with that string
--another example:
--return parameters..":\nnop\nnop\nnop\n"
--you'd then call it using usemono(00400500) for example
if (syntaxcheckonly==false) and (LaunchMonoDataCollector()==0) then
return nil,translate("The mono handler failed to initialize")
end
return "" --return an empty string (removes it from the internal aa assemble list)
end
I don't know mono very well, so I can't really offer any help here (though it does sound a bit like there could be multiple functions with the same name and you're getting whichever one was loaded first...)
I guess that must be it freeER.. After checking "instances of class", the list is too long to even start counting. Seems like everything (including seperate body parts) in this game has a healthHandler attached to is :/
The number of instances shouldn't directly matter, at least in theory, since they would use the same function/code, it's just if you had different functions named the same thing, aka "function overloading", and taking different arguments... IF that's the issue then this may help [Link]
@FreeER
Thanks for the info. I thought they were a bit different.
@Bakfiets
I've been working on quite a few mono games lately (not by choice lol). I'll work on some this weekend and see what I can come up with regarding this issue.
The number of instances shouldn't directly matter, at least in theory, since they would use the same function/code, it's just if you had different functions named the same thing, aka "function overloading", and taking different arguments... IF that's the issue then this may help [Link]
You are making a terrible amount of sense. It indeed has 1 overloading method (or 2, perspectives ;P)
Quick scan of the topic reveals it's an interesting one to read, thank you!
I will certainly post the progress once i can get my hands free from work projects.
@squall8 good luck! may the mono treat you gently, she's a hard mistress. But you have to give her credit for spilling al her junk on demand.
@Squall8
Unfortunately it didn't work. Even if, the assert would be true for all the overloading functions :/
I don't have the game so i can't look into. But my question is it overloaded method or shared instruction?
If it is an overloaded method you can use the lua version of mono_findMethodByDesc, but unfortunately in CE 6.7 it contains a bug. (fixed already on github)
function mono_findMethodByDescFixed(assemblyname, methoddesc)
--if debug_canBreak() then return nil end
local assemblies = mono_enumAssemblies()
for i=1, #assemblies do
local image = mono_getImageFromAssembly(assemblies[i])
local imagename = mono_image_get_name(image)
if imagename == assemblyname then
return mono_class_findMethodByDesc(image, methoddesc)
end
end
return nil
end
I also wrote me an extension to use it as aa command:
function monoAA_FINDMONOMETHODBYDESCFIXED(parameters, syntaxcheckonly)
local name, assemblyname, fullmethodnamestring, methoddesc, methodaddress
local c,d
--print(parameters)
--parse the parameters
c=string.find(parameters,",")
if c~=nil then
name=string.sub(parameters, 1,c-1)
fullmethodnamestring=string.sub(parameters, c+1, #parameters)
d=string.find(fullmethodnamestring,",")
if (d~=nil) then
assemblyname=string.sub(fullmethodnamestring, 1,d-1)
methoddesc=string.sub(fullmethodnamestring, d+1, #fullmethodnamestring)
else
return nil,"Assemblyname/Method desc missing"
end
else
return nil,translate("Invalid parameters (name could not be determined)")
end
assemblyname=assemblyname:match "^%s*(.-)%s*$" --trim
methoddesc=methoddesc:match "^%s*(.-)%s*$" --trim
if syntaxcheckonly then
return "define("..name..",00000000)"
end
if (monopipe==nil) or (monopipe.Connected==false) then
LaunchMonoDataCollector()
end
if (monopipe==nil) or (monopipe.Connected==false) then
return nil,translate("The mono handler failed to initialize")
end
--print("assemblyname: " .. assemblyname)
--print("methoddesc: " .. methoddesc)
local method=mono_findMethodByDescFixed(assemblyname, methoddesc)
--print("method: " .. method)
if (method==0) then
return nil,methoddesc..translate(" could not be found")
end
methodaddress=mono_compile_method(method)
--print("methodaddress: " .. methodaddress)
if (methodaddress==0) then
return nil,methoddesc..translate(" could not be jitted")
end
local result="define("..name..","..string.format("%x", methodaddress)..")"
--print("result: " .. result)
-- showMessage(result)
return result
end
registerAutoAssemblerCommand("FINDMONOMETHODBYDESCFIXED", monoAA_FINDMONOMETHODBYDESCFIXED)
I figured it would, I just wanted to be sure. I tried to replicate the issue to see what else I could do, but I couldn't even seem to find an overloaded function.. I might download the game later then. I'm also curious to know if any of the scripts Schnitzelmaker mentioned work out for you in this case. I don't have much knowledge in lua though.
Mono/Unity Engine and all that shit is complete garbage.. Lately most of these devs release half-assed pieces of work, make a small paycheck and abandon the game. It's ridiculous..
I figured it would, I just wanted to be sure. I tried to replicate the issue to see what else I could do, but I couldn't even seem to find an overloaded function.. I might download the game later then. I'm also curious to know if any of the scripts Schnitzelmaker mentioned work out for you in this case. I don't have much knowledge in lua though.
Mono/Unity Engine and all that shit is complete garbage.. Lately most of these devs release half-assed pieces of work, make a small paycheck and abandon the game. It's ridiculous..
Any help is deeply appreciated!
I haven't tried the lua scripts yet, I first want to read up on LUA (in combination with CE). In a few weeks I vacation so it's planned then
I'm afraid i have to disagree on your stance. The engine is and should not be responsible for hit-and-run tactics. Funny enough, this weeks Jimquisition from Jim Sterling is about this issue