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 


Pointer thought

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Polynomial
Grandmaster Cheater
Reputation: 5

Joined: 17 Feb 2008
Posts: 524
Location: Inside the Intel CET shadow stack

PostPosted: Mon Aug 10, 2009 6:40 am    Post subject: Pointer thought Reply with quote

Would it be possible to create a looped pointer in C++?

For example, a series of pointers such as the following:
Pointer A -> Pointer B -> Pointer C -> Pointer D -> Pointer B

Would the compiler recognise this as a problem and remove it? What would be the consequences of trying to access this pointer?

Just a thought...
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Mon Aug 10, 2009 6:44 am    Post subject: Reply with quote

wouldn't really be a huge problem. 'looped pointers' exist in code 'naturally' in abstract data types such as doubly linked lists. it would loop for as many times as you tried to dereference the pointer. it's not a problem really so no, the compiler shouldn't complain since as i said 'looped pointers' exist legitly in code anyway
Back to top
View user's profile Send private message
Polynomial
Grandmaster Cheater
Reputation: 5

Joined: 17 Feb 2008
Posts: 524
Location: Inside the Intel CET shadow stack

PostPosted: Mon Aug 10, 2009 7:10 am    Post subject: Reply with quote

I suppose. I was looking at it from a view of "give application ptr1 and it'll go through the pointer list until it reaches the data", though this doesn't actually happen since it'd just look at what the pointer went to once and that would be that.

How would CE's pointer scanner handle such a structure? Would it be limited by the depth parameter?
Back to top
View user's profile Send private message
Deltron Z
Expert Cheater
Reputation: 1

Joined: 14 Jun 2009
Posts: 164

PostPosted: Mon Aug 10, 2009 7:18 am    Post subject: Reply with quote

It's called a Circularly Linked-List:
en.wikipedia.org/wiki/Linked_list#Circularly-linked_list
Back to top
View user's profile Send private message
Polynomial
Grandmaster Cheater
Reputation: 5

Joined: 17 Feb 2008
Posts: 524
Location: Inside the Intel CET shadow stack

PostPosted: Mon Aug 10, 2009 7:44 am    Post subject: Reply with quote

Thanks Smile

I actually knew about circularly linked lists, but had forgotten that they worked by having a list of looped pointers.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming 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