 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
Ice745 Newbie cheater
Reputation: 0
Joined: 19 Jul 2005 Posts: 16
|
Posted: Tue Apr 22, 2008 2:35 pm Post subject: Question regarding custom scan. |
|
|
Edited: Answered some of my own questions with trial and many error
I am going to make my first custom scan, unfortunately I am unable to say what it is for.
However, it will be based on a text search; therefore, I must use scantext to get the user input request.
Which memory space does the custom scan execute in, Cheat Engine's, or the target application's?
Second question (if the custom scan is run in Cheat Engine's memory space), how much of the target applications memory after the current address in the scan is copied to the pointer given?
Third question, is the scantext 8-bit or 16-bit characters?
Fourth question, is it at all possible to allow Cheat Engine to debug our search routines? I program it, get an error, then have to cut out code blocks until I find where. It'd be nice if we could step through the assembled scan routine in action so we can see what's going on.
Thank you for your time!
Edit 2:
I figured out most of my access errors were due do my assumption that registers were free for use. Like a sloppy programmer I just altered eax, ebx, esi, and edi without pushing and popping. I assumed CE had a pushad before it ran my search routine.
Now using pushad, and popad I have an almost working routine. The weird error I get now though is "Out of memory." I sometimes get this when I set the variablesize to 000000FF. If I set it to 7f, scan. Edit it back to FF, do a new scan and repeat, the error doesn't appear. And closing CE and reloading it allows the FF size without any problems until it appears again. So far the first occurance of this error seems to be at random.
I have 2GB RAM. CE is taking 50mb at the time, and the target app about 100 mb.
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25807 Location: The netherlands
|
Posted: Tue Apr 22, 2008 5:03 pm Post subject: |
|
|
| Quote: |
Which memory space does the custom scan execute in, Cheat Engine's, or the target application's?
|
It is executed in Cheat Engine's memory space.
The pointers you get to the memory blocks are copies of the target process's memory
| Quote: |
Second question (if the custom scan is run in Cheat Engine's memory space), how much of the target applications memory after the current address in the scan is copied to the pointer given?
|
The buffersize provided in settingfs->scansettings.
But "DO NOT USE THAT" in your checkroutine, use variablesize to make sure the pointer you get has the proper size.
Every single address it'll call your checkroutine
e.g with a stepsize of 1 or no fastscan:
00400000, 00400001, 00400002, 00400003, ... (so when it doesn't match the first character, immediately exit, don't waste time confirming the other bytes, or reading ahead)
| Quote: |
Third question, is the scantext 8-bit or 16-bit characters?
|
8-bit
| Quote: |
Fourth question, is it at all possible to allow Cheat Engine to debug our search routines? I program it, get an error, then have to cut out code blocks until I find where. It'd be nice if we could step through the assembled scan routine in action so we can see what's going on.
|
Currently not possible.
Well, it is possible if you get the CE sourcecode and run it with delphi.
and then in your script write "int 3" , delphi'll break at that point and lets you debug from there.
But with CE itself, not yet possible (an app debugging itself is kinda tricky)
| Quote: |
Now using pushad, and popad I have an almost working routine. The weird error I get now though is "Out of memory." I sometimes get this when I set the variablesize to 000000FF. If I set it to 7f, scan. Edit it back to FF, do a new scan and repeat, the error doesn't appear. And closing CE and reloading it allows the FF size without any problems until it appears again. So far the first occurance of this error seems to be at random.
|
Do you have a multicore cpu? If so, try setting the process affinity to only 1 cpu. It is a known (fixed in svn) bug that it sometimes messes up memory allocation on multicore cpu's
Also, check your script, and make sure you don't read or write to memory regions outside the assigned memory regions.
_________________
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 |
|
 |
Ice745 Newbie cheater
Reputation: 0
Joined: 19 Jul 2005 Posts: 16
|
Posted: Tue Apr 22, 2008 7:24 pm Post subject: |
|
|
Thank you for your reply, and of course for making Cheat Engine.
The information was very helpful.
I do have a dual core processor, so I will try setting the affinity.
On a final thought, I have a question/suggestion:
Is it possible to set a value, maybe in AH, that would tell Cheat Engine which basic type (no type, int, float, double, text, hex array, etc) to show the results in the result window (which would then automatically be assigned when adding each result to the cheat table). It's more of a convenience than necessity. Otherwise it just lists the address found.
In example, say (no type) is 0; and the search ends with ax = 0001, the result would be added with just the address, like it is now.
But if say (DWORD) is 4; and the search ends with ax = 0401, the result would be added with the address, and the value would interpret what's at the address as a DWORD.
In the case of text/hex array, variablesize could be used as the length.
Again, thank you for your time and patience!
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25807 Location: The netherlands
|
Posted: Tue Apr 22, 2008 7:40 pm Post subject: |
|
|
yes, for next version i'll do something like that.
Give a option to show as a default type, OR provide the option to let the writer of the custom script to provide a routine that converts the address given to a specific notation (So convert the bytes to a string yourself)
_________________
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 |
|
 |
|
|
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
|
|