View previous topic :: View next topic |
Author |
Message |
Artykalamata Cheater
Reputation: 0
Joined: 21 Mar 2016 Posts: 32 Location: Germany
|
Posted: Fri Feb 24, 2017 11:24 am Post subject: write register value to file with auto assembler |
|
|
This function reads the tooltip text:
Code: | movzx ecx,byte ptr [rdx] |
Now i want to write every char to a text file.
Whats the smartest way doing that?
Code: | globalalloc(_text,8)
code:
movzx ecx,byte ptr [rdx]
mov rbx,rdx
jmp copy
copy:
push rax
mov rax,_text
mov [rax],ecx
pop rax
jmp return |
|
|
Back to top |
|
 |
panraven Grandmaster Cheater
Reputation: 62
Joined: 01 Oct 2008 Posts: 958
|
Posted: Fri Feb 24, 2017 1:46 pm Post subject: |
|
|
A possible https://en.wikipedia.org/wiki/Circular_buffer
AA write/produce at head and Lua read/consume at tail then write to ui/file.
Should minimize the workload on target process, ie you don't want to make extra io in target process I guess.
It can make easier to change the process on how to write/display logged data, eg. CE Lua side can check if the register represent an Address has already been seen so no further action need, which might be complicated if done on AA script.
Needless to say, Lua can format your register data nicely before output.
btw,
@ main.lua @ ce directory
Code: |
...
function debugger_onBreakpoint():
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)
...
|
and
ParkourPenguin's Track Changes to Addresses
http://forum.cheatengine.org/viewtopic.php?t=598509
has option "breakpoints to track all writes to the addresses" may meet your need.
bye~
_________________
- Retarded. |
|
Back to top |
|
 |
Artykalamata Cheater
Reputation: 0
Joined: 21 Mar 2016 Posts: 32 Location: Germany
|
Posted: Fri Feb 24, 2017 5:17 pm Post subject: |
|
|
Thanks for your help, but i think something like "circular buffer" is to hard for me with my current xp.
I made myselfe this little script:
Code: | debugProcess()
myaddress=getAddress("game.exe")+0xC2428
function log_TT(char)
f = io.open(getCheatEngineDir() .. "TTLog.txt", "a");
if char == "\0" then
f:write("\n")
else
f:write(char)
end
f:close()
end
function debugger_onBreakpoint()
myvar=RCX
log_TT(string.char(myvar))
print(string.char(myvar))
return 1
end
debug_setBreakpoint(myaddress) |
It might not be the fastest way of doing it but im pretty happy with my first LUA script. ^^
|
|
Back to top |
|
 |
|