Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


how to retrieve an address by hwbp

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
reverser69
Cheater
Reputation: 0

Joined: 03 Sep 2014
Posts: 47

PostPosted: Sat Dec 30, 2017 3:11 pm    Post subject: how to retrieve an address by hwbp Reply with quote

hi all

i tried alot but i cant

015648564:
cmp [rcx+54],x

how can i get rcx+54 and mov my own vlue into it?
Back to top
View user's profile Send private message
OldCheatEngineUser
Whateven rank
Reputation: 7

Joined: 01 Feb 2016
Posts: 762

PostPosted: Sat Dec 30, 2017 4:02 pm    Post subject: Reply with quote

what is hwbp?

what do you mean with how can i get rcx+54?

about moving your own value into it, you can basically mov [rcx+54],19
19 is imm hex-value, its up to you whether you wanna move imm value or register.
laso you can specify whether it should be moved into lower 8-bit, 16-bit, or 32-bit by "byte ptr" word ptr and "dword ptr"

mov accept:

reg,reg
reg,mem
reg,imm
mem,reg
mem,imm

in your case:
you can choose:

mov [mem],imm
mov [mem],reg

_________________
About Me;
I Use CE Since Version 1.X, And Still Learning How To Use It Well!
patched cheat engine tutorials


Last edited by OldCheatEngineUser on Sat Dec 30, 2017 4:05 pm; edited 2 times in total
Back to top
View user's profile Send private message Visit poster's website
TheyCallMeTim13
Wiki Contributor
Reputation: 7

Joined: 24 Feb 2017
Posts: 194
Location: Right Here Buddy.

PostPosted: Sat Dec 30, 2017 4:02 pm    Post subject: Reply with quote

I'm thinking you will need to post more then that. I have no idea what you're trying to do.

Are you just replacing code, or are you trying to inject.

To get the address stored is "RCX", an injection is most likely the best bet.

If you are injecting then with the instruction line selected in the memory view for press Ctrl+A then press Ctrl+Shift+F (in the auto assembler from) and start with that to write your script.

_________________
A: What manner of man are you that can summon up fire without flint or tinder?
T: I... am an enchanter.
Back to top
View user's profile Send private message
reverser69
Cheater
Reputation: 0

Joined: 03 Sep 2014
Posts: 47

PostPosted: Sat Dec 30, 2017 7:56 pm    Post subject: Reply with quote

my bad
I'm explaining the best I can

the game is heavily protected against memory change.so no injections.
now with help of LUA, i want to put a BP on the comparing code: cmp [rcx+54],0 and get the address of rcx.

something like this .......
debugProcess()

function debugger_onBreakpoint()
debug_continueFromBreakpoint(co_run)
return 1
end
Back to top
View user's profile Send private message
TheyCallMeTim13
Wiki Contributor
Reputation: 7

Joined: 24 Feb 2017
Posts: 194
Location: Right Here Buddy.

PostPosted: Sat Dec 30, 2017 8:30 pm    Post subject: Reply with quote

This may be what you're looking for.

debugger_onBreakpoint

Quote:
When a breaking breakpoint hits (that includes single stepping) and the lua function debugger_onBreakpoint() is defined it will be called and the global variables EAX, EBX, .... will be filled in
Return 0 if you want the userinterface to be updated and anything else if not (e.g You continued from the breakpoint in your script)


Quote:
Example:

function debugger_onBreakpoint()

local value=EAX
if (value ==0x0C93E004 ) then -- break condition
return 0 --break
else
return 1 -- continue without breaking
end
end

debug_setBreakpoint(0x0040CEA6) -- called if the above condition is true. And it will set breakpoint at 0x0040CEA6


So just store the R?? registry in a variable to use latter.

_________________
A: What manner of man are you that can summon up fire without flint or tinder?
T: I... am an enchanter.
Back to top
View user's profile Send private message
OldCheatEngineUser
Whateven rank
Reputation: 7

Joined: 01 Feb 2016
Posts: 762

PostPosted: Sat Dec 30, 2017 9:18 pm    Post subject: Reply with quote

reverser69 wrote:
my bad
I'm explaining the best I can

the game is heavily protected against memory change.so no injections.

what does memory protection have to do with debugging?

hwbp = hardware break-point

assuming the developers are using the hwbp in their executable to prevent anyone else putting hwbp, then in this case make sure you have veh debugger enabled and check the page-exceptions option.

by these options you will be able to debug that instruction.

_________________
About Me;
I Use CE Since Version 1.X, And Still Learning How To Use It Well!
patched cheat engine tutorials
Back to top
View user's profile Send private message Visit poster's website
reverser69
Cheater
Reputation: 0

Joined: 03 Sep 2014
Posts: 47

PostPosted: Sun Dec 31, 2017 5:09 am    Post subject: Reply with quote

OldCheatEngineUser wrote:
reverser69 wrote:
my bad
I'm explaining the best I can

the game is heavily protected against memory change.so no injections.

what does memory protection have to do with debugging?

hwbp = hardware break-point

assuming the developers are using the hwbp in their executable to prevent anyone else putting hwbp, then in this case make sure you have veh debugger enabled and check the page-exceptions option.

by these options you will be able to debug that instruction.

theres mem protectio so no inject.
i need fill rcx by lua not injection

TheyCallMeTim13 wrote:
This may be what you're looking for.

debugger_onBreakpoint

Quote:
When a breaking breakpoint hits (that includes single stepping) and the lua function debugger_onBreakpoint() is defined it will be called and the global variables EAX, EBX, .... will be filled in
Return 0 if you want the userinterface to be updated and anything else if not (e.g You continued from the breakpoint in your script)


Quote:
Example:

function debugger_onBreakpoint()

local value=EAX
if (value ==0x0C93E004 ) then -- break condition
return 0 --break
else
return 1 -- continue without breaking
end
end

debug_setBreakpoint(0x0040CEA6) -- called if the above condition is true. And it will set breakpoint at 0x0040CEA6


So just store the R?? registry in a variable to use latter.


what i want to do is to retrieve rcx when 1408541E2 address is being executed and fill [rcx+54] with 1 every time it is being executed
Back to top
View user's profile Send private message
TheyCallMeTim13
Wiki Contributor
Reputation: 7

Joined: 24 Feb 2017
Posts: 194
Location: Right Here Buddy.

PostPosted: Sun Dec 31, 2017 10:31 am    Post subject: Reply with quote

So some thing like this if you're juct checking "RCX":
Code:

SavedBase = nil
function debugger_onBreakpoint()
   if RCX == 0x1408541E2 then
      SavedBase = RCX
      writeInteger(RCX+0x54, 1)
   end
   return 1
end


If you need to check "RCX+54" then maybe this:
Code:

SavedBase = nil
function debugger_onBreakpoint()
   if RCX+0x54 == 0x1408541E2 then
      SavedBase = RCX
      writeInteger(RCX+0x54, 1)
   end
   return 1
end


If "RCX+54" is a float then just use "writeFloat" instead of "writeInteger".

You just need to use "debug_setBreakpoint" to set the break point.

EDIT: "wrieFloat" to "writeFloat"

_________________
A: What manner of man are you that can summon up fire without flint or tinder?
T: I... am an enchanter.


Last edited by TheyCallMeTim13 on Sun Dec 31, 2017 1:27 pm; edited 2 times in total
Back to top
View user's profile Send private message
reverser69
Cheater
Reputation: 0

Joined: 03 Sep 2014
Posts: 47

PostPosted: Sun Dec 31, 2017 12:58 pm    Post subject: Reply with quote

I'm not checking it for a certain value.
I just wanna get the rcx+54 every time it gets executed
Back to top
View user's profile Send private message
TheyCallMeTim13
Wiki Contributor
Reputation: 7

Joined: 24 Feb 2017
Posts: 194
Location: Right Here Buddy.

PostPosted: Sun Dec 31, 2017 1:21 pm    Post subject: Reply with quote

Is RCX+54 instruction to be "executed" or just an address that some instruction "accesses".

If instruction, then I am not sure what you are trying to do.

If it's just a value then you would need to hook every instruction that accesses it.

But if you mean that you just want to store the address every time the break point is hit, then just cut out the check and store the base + offset.
Code:

SavedAddress = nil
function debugger_onBreakpoint()
    SavedAddress = RCX+0x54
    writeInteger(SavedAddress, 1)
    return 1
end
debug_setBreakpoint({address of intruction to set break point at})


Note that if the address is a symbol it needs to be in single quotes.
Code:
debug_setBreakpoint('someSymbol')

_________________
A: What manner of man are you that can summon up fire without flint or tinder?
T: I... am an enchanter.
Back to top
View user's profile Send private message
reverser69
Cheater
Reputation: 0

Joined: 03 Sep 2014
Posts: 47

PostPosted: Mon Jan 01, 2018 8:37 am    Post subject: Reply with quote

I think that's what I want
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites