View previous topic :: View next topic |
Author |
Message |
SleepiDreamer Cheater Reputation: 0
Joined: 27 Aug 2021 Posts: 41
|
Posted: Mon Aug 30, 2021 1:02 am Post subject: Code executed every frame |
|
|
I'm trying to understand the code from forum post "Find out what accesses/writes to this address" in (sorry, not allowed to send links yet), specifically this part:
Code: | function waitTillWritten(address, timeout)
local written=false
local lastaccess=nil
local stoptime=nil
if timeout~=nil then
stoptime=getTickCount()+timeout
end
debug_setBreakpoint(address, 1, bptWrite, function()
lastaccess=RIP
print(string.format("%X accessed %X", RIP, address))
written=true
debug_continueFromBreakpoint(co_run)
return 0
end)
while (not written) and ((stoptime==nil) or (getTickCount()<stoptime)) do
checkSynchronize()
if not written then sleep(10) end
end
debug_removeBreakpoint(address)
if timeout then
return written,lastaccess
else
return lastaccess
end
end |
I have slightly modified it by adding
Code: | address1 = '[Minecraft.Windows.exe+Minecraft.Windows.exe+0x4030538]+0x3CA51F0
print(waitTillWritten(address1, 1)) |
When I execute this script, it runs every frame, crashing my game, and practically freezing Cheat Engine.
How exactly would I go about fixing this?
My goal is to have a range of addresses that all automatically get NOPed once they are written to for the first time.
_________________
Hope you're having a great day! |
|
Back to top |
|
|
Frouk Master Cheater Reputation: 5
Joined: 22 Jun 2021 Posts: 489 Location: mov dword ptr [Ukraine]
|
Posted: Mon Aug 30, 2021 2:28 am Post subject: |
|
|
run this function in new thread:
Code: |
thisThread = createThread(function()
address1 = '[Minecraft.Windows.exe+Minecraft.Windows.exe+0x4030538]+0x3CA51F0
print(waitTillWritten(address1, 1))
end)
|
while function is looping
_________________
void(__cdecl *Haxing)(HWND hGameWindow) |
|
Back to top |
|
|
SleepiDreamer Cheater Reputation: 0
Joined: 27 Aug 2021 Posts: 41
|
Posted: Mon Aug 30, 2021 6:40 am Post subject: |
|
|
Code: | thisThread = createThread(function()
address1 = '[Minecraft.Windows.exe+0x4030538]+0x3CA51F0'
print(waitTillWritten(address1, 5))
end) |
Code: | Error in native thread called Unnamed::CheckSynchronize called from non-main thread "$76DC" |
Everytime I execute the last part of the error is different.
_________________
Hope you're having a great day! |
|
Back to top |
|
|
Frouk Master Cheater Reputation: 5
Joined: 22 Jun 2021 Posts: 489 Location: mov dword ptr [Ukraine]
|
Posted: Mon Aug 30, 2021 7:01 am Post subject: |
|
|
Try to use this
Code: | createNativeThread(function()
address1 = '[Minecraft.Windows.exe+0x4030538]+0x3CA51F0'
print(waitTillWritten(address1, 5))
end)
|
If error still appears, search up this error in Search[/code]
_________________
void(__cdecl *Haxing)(HWND hGameWindow) |
|
Back to top |
|
|
SleepiDreamer Cheater Reputation: 0
Joined: 27 Aug 2021 Posts: 41
|
Posted: Mon Aug 30, 2021 8:56 am Post subject: |
|
|
Can't seem to find any forum posts about this.
Any suggestions?
EDIT for clarification: no, the new code does not work.
_________________
Hope you're having a great day! |
|
Back to top |
|
|
Frouk Master Cheater Reputation: 5
Joined: 22 Jun 2021 Posts: 489 Location: mov dword ptr [Ukraine]
|
Posted: Mon Aug 30, 2021 9:05 am Post subject: |
|
|
Code: |
function waitTillWritten(address, timeout)
local written=false
local lastaccess=nil
local stoptime=nil
if timeout~=nil then
stoptime=getTickCount()+timeout
end
debug_setBreakpoint(address, 1, bptWrite, function()
lastaccess=RIP
print(string.format("%X accessed %X", RIP, address))
written=true
debug_continueFromBreakpoint(co_run)
return 0
end)
timer = createTimer
timer.Enabled = true
timer.Interval = 10 --You can change interval
timer.OnTimer = function()
if (not written) and ((stoptime==nil) or (getTickCount()<stoptime)) then
if not written then sleep(10) end
end
end
debug_removeBreakpoint(address)
if timeout then
return written,lastaccess
else
return lastaccess
end
function disableTimer()
timer.destroy() --To make sure that timer will be destroyed
end
|
Try this
_________________
void(__cdecl *Haxing)(HWND hGameWindow) |
|
Back to top |
|
|
SleepiDreamer Cheater Reputation: 0
Joined: 27 Aug 2021 Posts: 41
|
Posted: Mon Aug 30, 2021 10:40 am Post subject: |
|
|
Thank you so much for helpig me with this!
How would I get an output through this? Following example doesn't work:
Code: | print(waitTillWritten('[Minecraft.Windows.exe+0x4030538]+0x3CA51F0',100))( |
It doesn't crash or give me an error, just no output.
_________________
Hope you're having a great day! |
|
Back to top |
|
|
Frouk Master Cheater Reputation: 5
Joined: 22 Jun 2021 Posts: 489 Location: mov dword ptr [Ukraine]
|
Posted: Mon Aug 30, 2021 10:46 am Post subject: |
|
|
idk, because i can't use pc rn
_________________
void(__cdecl *Haxing)(HWND hGameWindow) |
|
Back to top |
|
|
|