PDA

View Full Version : help: varptr question



DirectuX
09-02-2020, 23:34
Hi,

do varptr return real memory adress or something 'tb internal' as codeptr do ?

I didn't understand this:

I have two instance of thinbasic scripts. varptr gives me an adress for a variable in the script 1. If I peek(long, adress) at the same adress in script 2, thinbasic doesn't return the good value.

DirectuX
10-02-2020, 11:01
Here a sample to illustrate :

(launch sourcescript.tbasic)

10132

Petr Schreiber
10-02-2020, 22:39
Hi Sebastian,

by default, it is not allowed to access memory of independent process from other independent process.

VARPTR of given value in one process does not point to the same location in another process.

I don't say it is not possible to access other process memory - but if you want avoid being triggered as false positive by AV programs, I would suggest to avoid it.

If you need to exchange data between two processes, I would suggest to have a look at cMMF (thinBASIC helper for memory mapped files).


Petr

DirectuX
11-02-2020, 09:55
Hi Sebastian,

by default, it is not allowed to access memory of independent process from other independent process.

VARPTR of given value in one process does not point to the same location in another process.

I don't say it is not possible to access other process memory - but if you want avoid being triggered as false positive by AV programs, I would suggest to avoid it.

If you need to exchange data between two processes, I would suggest to have a look at cMMF (thinBASIC helper for memory mapped files).


Petr

Thanks Petr !