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 


Ins and outs of the debugger

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Source
View previous topic :: View next topic  
Author Message
VikFreeze
Newbie cheater
Reputation: 0

Joined: 14 Feb 2010
Posts: 21
Location: Basking in the warm glow of several computer monitors

PostPosted: Thu Feb 25, 2010 9:52 am    Post subject: Ins and outs of the debugger Reply with quote

Can i ask some things about how the debuggerthread works?

Am i correct in guessing that SetWriteBreakpoint places a trigger for a write event, SetReadBreakpoint places a trigger for a read event and SetReadWriteBreakpoint places a trigger for a both read and write events on a given address?

If so, then is calling SetWriteBreakpoint, SetReadBreakpoint the same as calling just SetReadWriteBreakpoint?

I want to make modifications so that i can see multiple aspects of a address at the same time, i was thinking of adding a extra listbox to the foundcodedialog and modify the foundone procedure so i have a reader and writer textbox for a given address, but i don't know what will happen if call both SetReadBreakpoint and SetWriteBreakpoint on the same address or SetReadBreakpoint and SetWriteBreakpoint on different addresses.

To make a long story short, if i call SetReadBreakpoint for multiple addresses will that monitor the read events on all these addresses or is the debugger made to monitor a single address at a time?

Ive been experimenting with these procedures and the seem to work just how i need them to, but when monitoring a address for read access all the values in CE become unreadable ( they show '??') and they flicker between '??' and the value, when i close the opcode monitoring window the values return to normal, i think the memory is fine, but the call to SetReadBreakpoint i doing something to mess up the code that refreshes the values.
Is there a way to fix this?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25788
Location: The netherlands

PostPosted: Fri Feb 26, 2010 10:26 pm    Post subject: Reply with quote

This is pretty old code and will be rewritten to the way the kerneldebugger is build up (kinda)

anyhow, SetReadBreakpoint is a completly different function from SetWrite and SetReadWrite breakpoint.

Instead of debug registers it just marks the memory region as unreadable and when it tries to read from it, it'll raise an access violation with the read reason. (thats why the memory shows up as ?? and only shows as a value during the times the application is using that memory )

It's not very fast and tends to crash when used with multithreaded games

It also has been removed from ce 5.4 and later as there's no use for it alone.

_________________
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
View user's profile Send private message MSN Messenger
VikFreeze
Newbie cheater
Reputation: 0

Joined: 14 Feb 2010
Posts: 21
Location: Basking in the warm glow of several computer monitors

PostPosted: Mon Mar 01, 2010 10:56 am    Post subject: Reply with quote

Dark Byte

It looks like the only way to monitor multiple addresses is the access violations way since the debug regs can only take 4 addresses of 4 bites length each and that is nowhere near to what i need to watch, anyway i need to modify this condition in the debugger:
Code:
if ((devent.Exception.ExceptionRecord.ExceptionInformation[1]>=findreader.Address) and
                     (devent.Exception.ExceptionRecord.ExceptionInformation[1]<findreader.Address+findreader.size))
                     or
                     ((devent.Exception.ExceptionRecord.ExceptionInformation[1]<=findreader.Address) and
                     (devent.Exception.ExceptionRecord.ExceptionInformation[1]>findreader.Address-findreader.size))
                  then...

but im not sure of what needs to be in devent.Exception.ExceptionRecord.ExceptionInformation[1] when the address im watching is accessed

For example: if im watching 0040000 witch stores a value on 4 bites, what will be in devent.Exception.ExceptionRecord.ExceptionInformation[1] when an exception occurs?
Will it always return 0040000 or will it return anything between 0040000 and 0040004?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25788
Location: The netherlands

PostPosted: Mon Mar 01, 2010 11:38 am    Post subject: Reply with quote

yes, devent.Exception.ExceptionRecord.ExceptionInformation[1]contains the address that is being accessed
and it'll return anything between 00400000 and 00400fff (you make a whole page inaccessible, not just the bytes you want)


but really, I recommend you first try to figure out what you want to look for. You're giving the impression that you want to watch all the memory changes, which is just not going to happen. (it'll be so slow that every pixel being changed on the screen will take 20 seconds each)

_________________
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
View user's profile Send private message MSN Messenger
VikFreeze
Newbie cheater
Reputation: 0

Joined: 14 Feb 2010
Posts: 21
Location: Basking in the warm glow of several computer monitors

PostPosted: Mon Mar 01, 2010 11:53 am    Post subject: Reply with quote

I know im making an entire page inaccessible but the question was what is in devent.Exception.ExceptionRecord.ExceptionInformation[1] when the opcode im looking for accessed the address im interested in (ie the exact address: 00400000 or anything from the address 00400000 to the address + address size 00400004 in this example)

I cant think of any othere way to continue tracing the pointer i need after level 3 when the scan for the address witch made the change returns 25-30 addresses, i don't intend to watch the whole memory becaz i know it wouled slow down terribly but i'm aiming to watch those 25-30 ones
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25788
Location: The netherlands

PostPosted: Mon Mar 01, 2010 3:41 pm    Post subject: Reply with quote

it contains the address that is causing the exception

so if 00400000 is made unreadable then a 4 byte read at 003ffffd, it will return 003ffffd

But why not check them one by one? And have you tried the pointerscan ?

_________________
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
View user's profile Send private message MSN Messenger
VikFreeze
Newbie cheater
Reputation: 0

Joined: 14 Feb 2010
Posts: 21
Location: Basking in the warm glow of several computer monitors

PostPosted: Mon Mar 01, 2010 4:03 pm    Post subject: Reply with quote

The pointer scanner wouled be really usefull is i knew what level the pointer is all im 100% sure of right now is the first(or last) offset is 110 the next is probably 78 and the next is probably 8.

It starts out simple, my target address is written to by a single address (i set up the code window to filter down the opcodes by the address witch i need to search for), anyway, scanning for the first address returns 4 results 3 of witch are dead so this mean address #4 is the right one, correct? now it is beeing written to by 2 addresses boght of witch have an offset of 78 but heres the deal the opcodes pop up imedeately after the code window opens (not when i modify the score, like the first level) so one of these two addresses lead into a dead end, the othere returns about 28 results (actualy 100 but after several rescans it narrous down to about 25-30) now one of them is accessed by a opcode witch pops up when i modify the score and hase a offset of 8, once more the scan returns about 25-30 results but this time no opcode pops up when i modify the score on any of these so im asuming its "hidden" in the opcodes witch pop up imediately when the code window opens or im doing something wrong.

Is there any othere way to bypass this problem?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25788
Location: The netherlands

PostPosted: Mon Mar 01, 2010 5:06 pm    Post subject: Reply with quote

to use the pointerscanner you don't need to know the level of the pointer, just make sure the level is at least equal or bigger than the actual pointer (the bigger, the better, but each level increases the diskspace and time requirements exponentially)

And since you know the last 2 offsets, you can already fill that in and do a level 7 scan with the speed of a level 5 (I wouldn't take that offset 8 one since it's the one you're stuck on)


anyhow, using the debugger method:

Quote:

It starts out simple, my target address is written to by a single address (i set up the code window to filter down the opcodes by the address witch i need to search for), anyway, scanning for the first address returns 4 results 3 of witch are dead so this mean address #4 is the right one, correct?

Yes, if the addresses aren't being accessed they are just values and not actually used in the pointer path. Just pick the one that is being accessed.


Quote:

now it is beeing written to by 2 addresses boght of witch have an offset of 78 but heres the deal the opcodes pop up imedeately after the code window opens (not when i modify the score, like the first level)

That's normal. The pointer base can be used by other stuff, like rendering or function calls. Just get the offset

Quote:

so one of these two addresses lead into a dead end, the othere returns about 28 results (actualy 100 but after several rescans it narrous down to about 25-30)

You're sure the pointer hasn't changed inbetween the scans ?(e.g restart/new game) Just asking what can cause a rescan for a hexadecimal value change so much in results. If the pointer path hasn't changed and you're sure of that, go on. (if you did do a new game option, then yes, it's useless and you have to start over)

Quote:

now one of them is accessed by a opcode witch pops up when i modify the score and hase a offset of 8, once more the scan returns about 25-30 results but this time no opcode pops up when i modify the score on any of these so im asuming its "hidden" in the opcodes witch pop up imediately when the code window opens or im doing something wrong.

Look at the instruction. See how it get's it's value. Perhaps the register being used as a base offset gets it's value a few instructions earlier by a "lea" instruction

Quote:

Is there any othere way to bypass this problem?

Any other way to bypass this is as I said, the pointerscan, just have patience, and after a scan, just restart the game or even better, windows, and do a rescan for the new value, and continue this a couple of times till you've left with a pointerlist that's valid almost all the time



Oh yes, I forgot to say/ask one thing. Is it a webbrowser game ? If so, give up, and just try code editing or edit the webcontent directly

_________________
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
View user's profile Send private message MSN Messenger
VikFreeze
Newbie cheater
Reputation: 0

Joined: 14 Feb 2010
Posts: 21
Location: Basking in the warm glow of several computer monitors

PostPosted: Mon Mar 01, 2010 5:41 pm    Post subject: Reply with quote

Quote:
Oh yes, I forgot to say/ask one thing. Is it a webbrowser game ? If so, give up, and just try code editing or edit the webcontent directly

Well yes and no, its a swf file played in a web browser.
Quote:
You're sure the pointer hasn't changed inbetween the scans ?(e.g restart/new game) Just asking what can cause a rescan for a hexadecimal value change so much in results. If the pointer path hasn't changed and you're sure of that, go on. (if you did do a new game option, then yes, it's useless and you have to start over)

The pointer dosen't change but the scan returns 100 or so results, but some only flash the value, i move the cursor from app to app play the game a little and do rescans until i get about 25 - 30 witch don't change theire values.
Quote:
Any other way to bypass this is as I said, the pointerscan, just have patience, and after a scan, just restart the game or even better, windows, and do a rescan for the new value, and continue this a couple of times till you've left with a pointerlist that's valid almost all the time

I did try that but after 3-4 restarts i go from 11mil valid pointers to 0
Quote:
If so, give up, and just try code editing or edit the webcontent directly
can you go into a little more delays on this?
_________________
When at first u don't succeed, blame you parents, and then try again using more POWER!!
- Jeremy Clarkson
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25788
Location: The netherlands

PostPosted: Mon Mar 01, 2010 6:06 pm    Post subject: Reply with quote

use a flash editor,decompiler or other tool. then edit the game specifically to your likings and play that.

You can not use pointers in webbrowsers. The way they build up their content is too dynamic. Even having your mouse cursor at the wrong spot while typing in the url or selecting the bookmark can already cause an extra data object to be generated before the page is generated.

causing the data object to be the first item in the list instead of the page.

Also, lag can cause pointers to not work. If an image finished loading just before the flash object it's placed in front of it, causing the index (offset) of the flash object to load further. (increased offset)

And there are million of other occasions that the dynamic array that holds the page's objects aren't always in the same order.

and not to mention that everyone is running just slightly different versions of their browser. (flash version, browser version, browser language, etc...)


You might have more success if you ran the .swf inside a standalone swf player though, as long as it isn't inside a webbrowser, and the swf itself doesn't download anything from the net

_________________
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
View user's profile Send private message MSN Messenger
VikFreeze
Newbie cheater
Reputation: 0

Joined: 14 Feb 2010
Posts: 21
Location: Basking in the warm glow of several computer monitors

PostPosted: Tue Mar 02, 2010 4:08 am    Post subject: Reply with quote

Quote:
You might have more success if you ran the .swf inside a standalone swf player though, as long as it isn't inside a webbrowser, and the swf itself doesn't download anything from the net

I do have a stand alone version to run localy and the results are the same only this time the first offset is E0 instead of 110 the next two are 78 and 8 same as the browser version.
Quote:
Also, lag can cause pointers to not work. If an image finished loading just before the flash object it's placed in front of it, causing the index (offset) of the flash object to load further. (increased offset)

The game is downloaded each time from the net then the game starts (localy) there is no lag, i am debugging a browser process but it contains the game, there is no network activity while the game is running, including score keeping, i can modifi the score, end the game and the modifyed score shows up on the server but the trouble is that the address where it is stored is different on each instance of the game although i did notice that it always ends with '1D0' or anothere termination witch is slipping my mind right now, anyway the point is if all i need to do is trace the base of the pointer to a module of the browser, its easy to find out the baseaddress where a module is loaded inside the browser process regardless in witch order this happens so all i need is the base address of the pointer witch is coming from a module and the list of offsets but id also like to give the flash editing method a try can you recomend a tool to do this or point me in the right direction?

Edit

Oh one othere think i think i neglcted to mention is that where the 100 or so result come up in the web browser version the stand alone comes up twith the 25-30 ones directly, so i belive it is possible to separate the browser activity from the game the othere 75-70 odd addresses are probably from the browser but the keep changing but the address of the score remains the same untill the game ends so i know it one of the 25-30 stable addresses i need to fallow not the flashing ones.

_________________
When at first u don't succeed, blame you parents, and then try again using more POWER!!
- Jeremy Clarkson
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 Source 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