For show the code I'm using a fictional object:
Object Test, , Primer
...
Embed puntosP, LinkedList
...
VirtualMethod LoadPuntito,qword,qword
VirtualMethod LookPuntito
ObjectEnd
For link a new object to the list there is no problem:
Method Test.LoadPuntito, uses esi, x:qword, y: qword
SetObject esi
New Puntito
OCall eax::Puntito.Init, x, y ;Initialize Puntito instance values
OCall [esi].puntosP::LinkedList.Append, eax
MethodEnd
Retrieve the object from the list work very well:
SetObject eax, LinkedList, [esi].puntosP
mov ecx , [eax].pCurrentNode
SetObject ebx, Puntito, [ecx+8]
But perhaps there is a way more direct (without using a register, in this case ecx), or at least the same thing can be written in a more meaninfull way (thinking in indirect access from structures more complex than LINKED_NODE, or that could be modified).
edited later:
[ecx].LINKED_NODE.pObject work fine, obviously I was making something wrong.
That code seems usefull for travelling along the entire list:
Method Test.LookPuntito, uses esi
SetObject esi
OCal [esi].puntosP::LinkedList.GetFirst
SetObject eax, LinkedList, [esi].puntosP
push eax
mov ecx , [eax].pCurrentNode
.if ecx == NULL
.else
.repeat
SetObject ebx, Puntito, [ecx+8]
DbgFloat [ebx].x
DbgFloat [ebx].y
OCall [esi].puntosP::LinkedList.GetNext
pop eax
push eax
mov ecx , [eax].pCurrentNode
.until ecx == NULL
.endif
pop eax
MethodEnd
Thanks, HSE