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 


Did anyone ever ported pointer scanner to any other la ... ?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Source
View previous topic :: View next topic  
Author Message
H4x0rBattie
Advanced Cheater
Reputation: 0

Joined: 10 Nov 2016
Posts: 58

PostPosted: Tue Apr 04, 2017 11:04 am    Post subject: Did anyone ever ported pointer scanner to any other la ... ? Reply with quote

... such as C# or C++? I am working on CE .NET port. After using CE for two years, I pretty much understood and can code any other feature expect debugger part.

I do this port mainly for learning purposes and because I barely can understand Pascal; therefore I did not fully understood DarkByte's pointer scanner implementation.

I do have a "working" pointer scanning solution in .NET BUT I do have a looping issue that starts annoying on a higher levels (level 4+). The issue I have is probably something retarded and easy to fix but I just did not figured it out yet.

There is a power in custom scans that you can do when you work with a project like this.

PS. Thanks for releasing the source code though I barely can read it.

Anyway all I need is a little hint to fix the issue.

_________________


Last edited by H4x0rBattie on Wed Apr 05, 2017 11:56 am; edited 1 time in total
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

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

PostPosted: Tue Apr 04, 2017 1:11 pm    Post subject: Reply with quote

to prevent looping pointers ce checks if a pointer with a specific value is already in the lust of the current path, and if so stop processing the path any further
_________________
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
H4x0rBattie
Advanced Cheater
Reputation: 0

Joined: 10 Nov 2016
Posts: 58

PostPosted: Tue Apr 04, 2017 1:37 pm    Post subject: Reply with quote

I already implemented that feature from your source but it did not fixed the major looping issue for me. When I use the code below, it results approx. to -10% less recursive calls, this means only some seconds faster scanning in terms of execution time.

I've a serious looping issue (it occurs when every pointer is pointing to each others) that's why I need someone to check my code who actually understand something. Someone like you?

When the issue occurs, the higher the level, the more serious the issue becomes. I've tried fix it in many ways for a long time but every attempt to fix it resulted in loss of results compared to CE's pointer scanner.

That's why I think I missed something obvious or I am just a retard.

C#
Code:

// no looping pointer allowed in a path
            if (noLoopingPointers)
            {

                for (Int16 z = 0; z < iterationLevel - 1; z++)
                {

                    // Console.WriteLine("{0} pointer path address: {1} level: {2}", Program.TimeNow(), pointerPath[z].ToString("X"), z);
                    // Thread.Sleep(1000);

                    Int64 tmpAddr = pointerPath[z];

                    if (pPointer == tmpAddr)
                    {
                        testMatches++;                       
                        return; // --> this makes the recursion to stop (exit) just like in your source ...
                    }

                }

                pointerPath[level] = pPointer;               

            }           


PS. I was able to install Lazarus and compile CE source and actually code a bit in Pascal so I was able to debug it a bit. But still I miss something obvious from my logic.

What I tested CE source, the pointer scanner in CE is single threaded unless you try to scan for something big like a level 8 and max offset 0x800.

I mean my tool has nearly the same CPU usage when you are scanning for say a level 1 static pointer path.

A screenshot of the issue: http://forum.cheatengine.org/download.php?id=121419

The code above does not catch loops like that and as I said every attempt so far to fix it resulted in a loss of results. Is that ReClass output clear to you or do I need to explain it better?

If we look at your source: https://github.com/cheat-engine/cheat-engine/blob/master/Cheat%20Engine/pointerscanworker.pas#L650

My C# NoLoop is exactly the same as I posted above.

If you can explain what lines 753 and 754 does in https://github.com/cheat-engine/cheat-engine/blob/master/Cheat%20Engine/pointerscanworker.pas

You call after that at line 771:

Code:

rscan(plist.list[j].address,level+1);


Why in two places level+1? In my implementation I just use 771 method because I did not fully understood your implementation. Maybe this is where my issue occurs.



pointer_scan_looping_issue.png
 Description:
 Filesize:  148.46 KB
 Viewed:  15888 Time(s)

pointer_scan_looping_issue.png



_________________
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

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

PostPosted: Tue Apr 04, 2017 4:37 pm    Post subject: Reply with quote

753 and 754 setup a workitem in the work queue so other threads(and other computers on the network) can resume with the same state as it's in now.

771 only gets executed if the queue is full (or not worth to add to the queue)

but seeing you are limiting to 1 thread it's nothing you should worry

perhaps you are storing the wrong values in your pointervalue list. (it has to be the value, not the address the pointer is at)

_________________
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
H4x0rBattie
Advanced Cheater
Reputation: 0

Joined: 10 Nov 2016
Posts: 58

PostPosted: Wed Apr 05, 2017 1:23 pm    Post subject: Reply with quote

Dark Byte wrote:

perhaps you are storing the wrong values in your pointervalue list. (it has to be the value, not the address the pointer is at)


Thanks. I knew it was something like this. The looping issue is pretty much solved in my pointer scanner implementation.

PS. If I ever decide release my tool. Is it OK to you if i name it to CE.NET or do you want me to use a different name?

It won't be exactly the same, there are always room for improvement in terms of user friendliness. To mention one, copy/pasteable offsets from the pointer scanner and so forth.

I am not limited to one thread but I rather fix the code first using just one thread rather than trying to fix issues like this using multiple threads ...

_________________
Back to top
View user's profile Send private message
H4x0rBattie
Advanced Cheater
Reputation: 0

Joined: 10 Nov 2016
Posts: 58

PostPosted: Sun Aug 06, 2017 8:32 pm    Post subject: Reply with quote

Dark Byte wrote:

perhaps you are storing the wrong values in your pointervalue list. (it has to be the value, not the address the pointer is at)


My first implementation was doing it from each each static pointer e.g reading forward from each pointer ...

It works fairly fast up to level 4 and maximum offset 0x0400 but any bigger level and/or offset is more or less a no go.

I never needed to read Pascal source code until now. I mean my knowledge is nearly "noob" when it comes to Pascal coding ...

I figured out that the scan needs to be done backwards. My implementation is not a copy/paste from your source.

I figured pretty much all out while implementing it.

Thanks anyway for the source code, with it I was able to debug the issues and pretty much fully understood how you implemented it. It's a smart way.

I've attached image of several months work. The highlighted option is the main reason for .NET version.

I haven't yet decided will I even ever release my tool to the public but as you can see, I was after more user-friendly solution.



my_pscan.png
 Description:
My .NET implementation of pointer scanner
 Filesize:  50.05 KB
 Viewed:  10649 Time(s)

my_pscan.png



_________________
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