View previous topic :: View next topic |
Author |
Message |
toto92 How do I cheat?
Reputation: 0
Joined: 20 Jul 2023 Posts: 5
|
Posted: Sat Jul 22, 2023 6:51 pm Post subject: Conditional Breakpoint and Script em loop |
|
|
Hello!
[RDI + 18] --> POINTER A (8 BYTES ADDRESS) --> POINTER A + OFFSET 0x20 --> VALUE (for instance: value = 0x4DA)
How can I make a conditional breakpoint where [RDI+18] contains an 8 byte address and that address added to 0x20 results in a certain value.
How would a script that would be in a loop checking the instruction game.exe + 232F0D1 and when the 4DA value was written
in memory would make a breakpoint.
|
|
Back to top |
|
 |
ParkourPenguin I post too much
Reputation: 152
Joined: 06 Jul 2014 Posts: 4702
|
Posted: Sat Jul 22, 2023 9:25 pm Post subject: |
|
|
What type is the value? 4 byte?
toto92 wrote: | [RDI + 18] --> POINTER A (8 BYTES ADDRESS) --> POINTER A + OFFSET 0x20 --> VALUE (for instance: value = 0x4DA) | This is confusingly worded. Normally an arrow `->` means "this pointer points to...", but you seem to be using "POINTER A" twice...?
If that's supposed to be a level 1 pointer w/ base address RDI+0x18 and 1 offset of 0x20, then use this simple condition:
Code: | readInteger(readPointer(RDI+0x18)+0x20) == 0x4DA |
toto92 wrote: | How would a script that would be in a loop checking the instruction game.exe + 232F0D1 and when the 4DA value was written
in memory would make a breakpoint. | That's not how conditional breakpoints work. You set a breakpoint on an instruction. It always gets triggered every time it's run. If the condition is false, tell the game to continue running. If the condition is true, then collect debug information and present it to the user.
Select an instruction and set a breakpoint in the memory viewer using the "Debug" menu or by pressing F5. Right click the instruction after it's set and set a condition.
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
Back to top |
|
 |
toto92 How do I cheat?
Reputation: 0
Joined: 20 Jul 2023 Posts: 5
|
Posted: Sun Jul 23, 2023 9:46 am Post subject: |
|
|
ParkourPenguin wrote: | What type is the value? 4 byte?
toto92 wrote: | [RDI + 18] --> POINTER A (8 BYTES ADDRESS) --> POINTER A + OFFSET 0x20 --> VALUE (for instance: value = 0x4DA) | This is confusingly worded. Normally an arrow `->` means "this pointer points to...", but you seem to be using "POINTER A" twice...?
If that's supposed to be a level 1 pointer w/ base address RDI+0x18 and 1 offset of 0x20, then use this simple condition:
Code: | readInteger(readPointer(RDI+0x18)+0x20) == 0x4DA |
toto92 wrote: | How would a script that would be in a loop checking the instruction game.exe + 232F0D1 and when the 4DA value was written
in memory would make a breakpoint. | That's not how conditional breakpoints work. You set a breakpoint on an instruction. It always gets triggered every time it's run. If the condition is false, tell the game to continue running. If the condition is true, then collect debug information and present it to the user.
Select an instruction and set a breakpoint in the memory viewer using the "Debug" menu or by pressing F5. Right click the instruction after it's set and set a condition. |
Thank you very much!
The game has the following instruction:
game.exe+232F0D1 - 48 8B 77 18 - mov rsi,[rdi+18]
I would like to make a script in lua similar to the example below, and that would check all the time at the address game.exe + 232F0D1 and when y = 0x00000000000004DA, a breakpoint would be made. I would like an automatic check to be made until finding the value recorded in memory. The game is 64-bit and the saved value can be 8 bytes.
It's possible?
debugProcess()
debug_setBreakpoint("game.exe+232F0D1")
x = readQword(RDI+0x18) -- x stores an 8-byte address.
y = readQword (x + 0x20) -- the address (8 bytes) contained in x + offset 20 stores the value of y
|
|
Back to top |
|
 |
ParkourPenguin I post too much
Reputation: 152
Joined: 06 Jul 2014 Posts: 4702
|
Posted: Sun Jul 23, 2023 11:14 am Post subject: |
|
|
Code: | local addr = getAddress'game.exe+232F0D1'
debug_removeBreakpoint(addr)
debug_setBreakpoint(addr, function()
if readQword(readPointer(RDI+0x18)+0x20) == 0x4DA then
return 1
else
return 0
end
end) |
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
Back to top |
|
 |
toto92 How do I cheat?
Reputation: 0
Joined: 20 Jul 2023 Posts: 5
|
Posted: Sun Jul 23, 2023 6:06 pm Post subject: |
|
|
ParkourPenguin wrote: | Code: | local addr = getAddress'game.exe+232F0D1'
debug_removeBreakpoint(addr)
debug_setBreakpoint(addr, function()
if readQword(readPointer(RDI+0x18)+0x20) == 0x4DA then
return 1
else
return 0
end
end) |
|
Thank you very much for your help.
|
|
Back to top |
|
 |
|