How to determine the passed Data Type in a ? (any) parameter?

So when Bruce refers to Reflectors, he’s not referring to road safety reflectors or bike reflectors but to this definition Reflective programming - Wikipedia

So this now makes sense

Well the approach I was going to do was to try to do a regex on the memory layout, abit like overlay can fit over data in memory. I know the address and the size, so I was going to start there.

What other things are people looking to get out of the language? It mentions the dictionary properties, what sort of dct properties?

See use of the TUFO in the debuger classes

See .getVarType

So _Type is returning the datatype.

Line 1286 RETURN UFO._Type( ADDRESS(xaVar) )

and then the value returned can be looked up in
Debuger.DescribeDataType

Does anyone know where the TUFO method/interface names originate from?

For example, I’m guessing _8ValueUfo__Type@CF is the _Type referred to in the TUFO interface?

Did someone reverse engineer this, leak it or sit there painstakingly going through the shipping dll’s?

It looks like TUFO is linked to the procedures seen in the libmaker using ClaRun.dll with names like
_6VarUfo__ToMem@CFR4vmem
_8ValueUfo__ToMem@CFR4vmem
_9StringUfo__ToMem@CFR4vmem
_11PictureUfoD__ToMem@CFR4vmem
_11PictureUfoL__ToMem@CFR4vmem
_11PictureUfoR__ToMem@CFR4vmem

Edit.

I’m also wondering if this _Type is like the typeid mentioned here.
typeid operator - cppreference.com

I think I’ve figured it out, ie getting the datatype from the ? (any) parameter passed by value.

Picture says a million lines of code…

Well this turned out to be a red herring. Back to the drawing board.

You’re welcome to play with my PrivateClass. It will get data types of passed *? parameters. https://github.com/jslarve/PrivateClass

I’ve already written one which works for the params passed by address, but I was trying to get the data type for those passed by value and thought I was onto something but I wasnt!

GETTYPE.CLW (26.7 KB) GetType.inc (19.4 KB)

This TUFO.int is what is stumping me, I think I’ll have to use this in C11 and try to see what its fitting with and how, I’m assuming its fitting with something in the runtime.

So having loaded your app in C11, would I be correct in saying TUFO.int is a data structure, in the same sense as a Group, where the elements of the group are methods/procedures OVERed a part of the clarion runtime in memory, which is located and fixed over the runtime using Address() and What()?

If so, I can see why the comment exists that state this can change with future updates of the runtime.

This is what I thought I was looking at the other night which my GetType class but was stupidly looking back at the variable contents in memory of the procedure, aka my red herring.

Anyway I’m right, I’ll have a go at backporting this to C6 and see what differences exist in the two runtimes I have here.

This is why ASLR and other methods exists to jumble up the memory…

Its also why Astrings could perhaps be viewed as the haystack in which to hide a needle.

1 Like

An interface is kind of just a set of methods that a class will support.

In c6, there was a different interface, where the methods appeared in a different order

Yeah its a bit like a vertical key, so for now, my interface in C6 looks like this, and then I’ll see what happens with each method, so I should end up with the correct number of methods, the one’s that accept input and the one’s that have output including the datatype.

Its a bit like picking a barrel lock if you have ever watched LockPickingLawyer - YouTube! :roll_eyes:

iWTF    Interface,Type
p1      Procedure(long),long
p2      Procedure(long),long
p3      Procedure(long),long
p4      Procedure(long),long
p5      Procedure(long),long
p6      Procedure(long),long
p7      Procedure(long),long
p8      Procedure(long),long
p9      Procedure(long),long
p10     Procedure(long),long
p11     Procedure(long),long
p12     Procedure(long),long
p13     Procedure(long),long
p14     Procedure(long),long
p15     Procedure(long),long
p16     Procedure(long),long
p17     Procedure(long),long
p18     Procedure(long),long
p19     Procedure(long),long
p20     Procedure(long),long
p21     Procedure(long),long
p22     Procedure(long),long
p23     Procedure(long),long
p24     Procedure(long),long
p25     Procedure(long),long
p26     Procedure(long),long
p27     Procedure(long),long
p28     Procedure(long),long
p29     Procedure(long),long
p30     Procedure(long),long
p31     Procedure(long),long
p32     Procedure(long),long
p33     Procedure(long),long
p34     Procedure(long),long
p35     Procedure(long),long
        End

I think there are a couple of renditions on the news server somewhere.

I’m not going on the newsgroups, I’ll work this out myself, even if it becomes the death of me!

In C6:
Interface method 6 = DataType
Interface method 17 = Memory locations
Interface method 18 = Memory locations
Interface method 24 = Size

Its an interesting technique for extracting otherwise private class data! Kind of makes a mockery of what we get taught about computer security though.

Once I have my class writing template working properly, I’ll finish off the class I’ve written which I wrote to determine the above interface types, that way, TUFO is no longer an unknown, when a new runtime comes out.

So far, I’ve limited the class to only 50 interface methods, but as I dont know what it interface’s over although I suspect its parts of the runtime, I dont know if that is enough or not? Anyone know?

Just a reminder that the TUFO interface changed at one point (I think pre C7 and post C7)
Notice the two versions I have in TUFO.int

ClarionCommunity/TUFO.INT at master · MarkGoldberg/ClarionCommunity (github.com)

I think I found a tiny bit more on the origins of TUFO
www.attryde.com/clarion/binary/tswd.txt

(*  new types for clarion *)

    Decimal,
    Pdecimal,
    Bfloat,
    UFO,
    DynDecimal,
    DynPdecimal,

UFOs had been completely rewritten for future versions of Clarion. Any program bound to some particular implementation of ANY can become unusable. The same is for binding to other RTL internal structures, e.g. so called “type descriptor string” for GROUPs/QUEUEs/CLASSes/RECORDs.

1 Like

Can we please get UFOs and the TUFO interface documented.
I asked Z for that at a recent Florida CIDC, and he agreed it would be a good idea.

How should one define recent?

I believe it was the most recent Florida CIDC

2019? Recent seems so long ago.