View previous topic :: View next topic |
Author |
Message |
danrevella Master Cheater Reputation: 2
Joined: 11 Jun 2008 Posts: 290
|
Posted: Fri Apr 10, 2015 5:53 am Post subject: writeInteger() sometime fails |
|
|
Hi!!
suppose I have attacched the VEH debugger at program "test.exe"
This code work OK!!!
Code: |
myaddress=getAddress("test.exe")+0x1384
debug_setBreakpoint(myaddress); -- Address where to set breakpoint
ind_val_numerico=getAddress("test.exe+1d090")
writeInteger(ind_val_numerico,55)--ottenuto da getAddresses
return 1; --con 0 visualizza memory interface
|
This code does NOT work, to be more precise the line:
writeInteger(ind_val_numerico,55)--ottenuto da getAddresses
have no effect!!
Code: |
myaddress=getAddress("test.exe")+0x1384
debug_setBreakpoint(myaddress); -- Address where to set breakpoint
function debugger_onBreakpoint()
ind_val_numerico=getAddress("test.exe+1d090")
writeInteger(ind_val_numerico,55)--ottenuto da getAddresses
return 1; --con 0 visualizza memory interface
end
|
Please were is my error?
|
|
Back to top |
|
|
ZacTheSin I post too much Reputation: 6
Joined: 09 May 2006 Posts: 2657
|
Posted: Fri Apr 10, 2015 6:52 am Post subject: |
|
|
Are you calling the function somewhere not in your code displayed?
like just running debugger_onBreakpoint()
_________________
If someone helps you, why not Rep them? |
|
Back to top |
|
|
danrevella Master Cheater Reputation: 2
Joined: 11 Jun 2008 Posts: 290
|
Posted: Fri Apr 10, 2015 8:38 am Post subject: |
|
|
ZacTheSin wrote: | Are you calling the function somewhere not in your code displayed?
like just running debugger_onBreakpoint() |
Yes, as you may see at line 3 of "code NOT working" I utilize the debugger_onBreakpoint() function, as I need that every time that breakpoint happens i would like that :
Code: | writeInteger(ind_val_numerico,55) |
but it fails.
Thanks
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25287 Location: The netherlands
|
Posted: Fri Apr 10, 2015 9:23 am Post subject: |
|
|
make sure the breakpoint is after the write, else when you continue the value you wrote will be undone
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
danrevella Master Cheater Reputation: 2
Joined: 11 Jun 2008 Posts: 290
|
Posted: Fri Apr 10, 2015 9:46 am Post subject: |
|
|
Dark Byte wrote: | make sure the breakpoint is after the write, else when you continue the value you wrote will be undone |
Thanks, but in many case I get the memory location only elaborating the breakpoint output, f.e. I know that the memory location I must patch is f.e. :
memory_to_write=RAX+1258
but I need the value of Rax when the breakpoint does appears...
I need to perform this patch every time I reach breakpoint...
Any possibility?
|
|
Back to top |
|
|
Zanzer I post too much Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Fri Apr 10, 2015 1:13 pm Post subject: |
|
|
What Dark Byte was pointing out is that if you set your breakpoint on the following instruction:
mov [ebx],eax
And your code essentially writes a value into the same address of EBX...
Then your code will execute, followed by the normal game code...
Overwriting whatever you just put into [ebx] with what was in EAX.
So you should set your breakpoint on the instruction AFTER mov [ebx],eax
Also, I know LUA has access to the registers, but I don't know if it can update them.
Instead of writeInteger(), try simply "EAX = 55". Will that work Dark Byte?
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25287 Location: The netherlands
|
Posted: Fri Apr 10, 2015 2:00 pm Post subject: |
|
|
EAX=55 will work yes
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
danrevella Master Cheater Reputation: 2
Joined: 11 Jun 2008 Posts: 290
|
Posted: Fri Apr 10, 2015 2:50 pm Post subject: |
|
|
Ok, I understand the point about overwriting...
BTW, (and please excuse for my very poor english...) what I need is the follows:
I have set a "permanent" breakpoint f.e. at Test.exe+0x2120, and I want that every time breakpoint is reached, the memory location at f.e.: "test.exe+1d090" is filled with the fix value of 0x55.
I have defined this in my code with:
writeInteger(ind_val_numerico,55)
but seem to be that inside the function debugger_onBreakpoint() is possible execute many type of code, f.e. about setting register, etc, but seem to be impossible write a value to a memory location, at least in the mode I have definited the code (please look at the top of the post: code NOT working)
Thanks...
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25287 Location: The netherlands
|
Posted: Fri Apr 10, 2015 3:03 pm Post subject: |
|
|
use fullAccess(address, size) to make read only sections writable first
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
Zanzer I post too much Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Fri Apr 10, 2015 3:07 pm Post subject: |
|
|
Copy (CTRL+C) the instruction at Test.exe+0x2120 and the one after it so we can see where you're setting the breakpoint.
As we've said, chances are the game is directly overwriting the value you just wrote into that integer.
Or the instruction at Test.exe+0x2120 is not executing like you think and so your code is never run.
|
|
Back to top |
|
|
danrevella Master Cheater Reputation: 2
Joined: 11 Jun 2008 Posts: 290
|
Posted: Fri Apr 10, 2015 4:07 pm Post subject: |
|
|
here is the test prog with the (not)working table.
File is really tiny
https://www.sendspace.com/file/ac6l3u
I woul like to precise that the file test.exe was original supplied on the old cheat prog: Magic Trainer Creator by Olivier Pasqualini.
|
|
Back to top |
|
|
|