Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Question about Pointers and Addressing

Author
Message
Algae Man
22
Years of Service
User Offline
Joined: 11th Nov 2002
Location: Canada
Posted: 30th Dec 2005 19:21
I've been experimenting with pointers to display the memory contents (bytes) at any arbitraty address. The problem is that I seem to be limited to certain ranges in memory. Ie, when my program tries to read from a certain address, the program will silently crash and exit. Does anyone know about the limitations with memory access?

Here's my example program. Scroll through memory with keys q, a ,w, s, e, d, r, f, t, g at varying speeds. Change "max" and "min" variables, and above address 1191932 and below 48790 (on my computer) it crashes. However other isolated areas of memory seem to work also.

IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 30th Dec 2005 21:32
Quote: "Does anyone know about the limitations with memory access?"


Yes. You may not access any memory that your program has not specifically allocated or requested access to from the OS. Not even to just read it.

For free Plug-ins and source code http://www.matrix1.demon.co.uk
Algae Man
22
Years of Service
User Offline
Joined: 11th Nov 2002
Location: Canada
Posted: 31st Dec 2005 23:36
Thanks IanM. This is a bit off topic from DarkBASIC Pro, but is this limitation true with other languages? For example in C++, pointers can only access addresses within a certain allocated range (or so I've found out the hard way). But is there some way around this? Eg. a variant of PEEK/POKE (as in basic) to look at any address. Can any program other than the operating system itself access the entire memory range?
NeX the Fairly Fast Ferret
20
Years of Service
User Offline
Joined: 10th Apr 2005
Location: The Fifth Plane of Oblivion
Posted: 31st Dec 2005 23:50
Cheat Engine, used as an action replay for PCs

IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 1st Jan 2006 13:51 Edited at: 1st Jan 2006 13:52
It's a deliberate limitation of the OS. The NT versions of windows all do this to stop programs accessing and potentially crashing other programs. This way, your program can only crash itself ... at least that's the theory

@Nex, Yes, as I said, 'or request access from the OS'. This is how cheaters/trainers work.

For free Plug-ins and source code http://www.matrix1.demon.co.uk

Login to post a reply

Server time is: 2025-06-09 04:51:59
Your offset time is: 2025-06-09 04:51:59