Passed by value, will as you describe, passed by address ie *String will need different handling.
The TUFO int mentioned here Is there are function that tells me what the passed data type is in a ? (any) parameter? - questions - ClarionHub is quite interesting.
I’m still messing around with a class that does the procedure overloading Determing data type of passed parameter (*?) - code / Snippets - ClarionHub which can be included into an app.
If ever there was an ideal starter class, writing this procedure overloading out as one would be it imo.
It is interesting seeing what the compiler will allow and wont allow.
So the reason for things like ASLR is to prevent memory being scanned and passwords etc from being extracted from memory, so I dont see why the same technique can not be used to work out the data type linked to a memory address.
Its just I cant find anything online already built, so I’ll probably end up rolling my own.
I will add that recognising paths stored in memory is easy, passwords using a variety of alphanumerics and other symbols is harder, but when examining the memory using the debugger, its a bit like watching those old dos program defrag your hard drive. The data recovering techniques used here PhotoRec - CGSecurity could easily translate to scanning memory and be used to identify other datatypes and objects imo.
Edit2.
The point I’m trying to make is that the CPU offers up some basic data types
Data Types - Developer Help (microchipdeveloper.com)
The OS also offers up some of its own data types which might match those supported by the CPU, but it can also emulate datatypes or provided its own data types, just like we can create our own groups in clarion.
Datatypes become groups or structures, and groups or structures are also like files and tables with their difference being where they are stored or held, ie ram or disk.
Even network packets are a sort of data structure.
So with this in mind, it should possible to recognise a data type from the address and size that is supplied. Or put another way, if its possible to regex a string found on a disk, why should it be so difficult to regex a memory address?
Of course its an over simplification, but essential we are just shifting strings of data around ram, disk or over network interfaces.