LOCAL lpCacheEntry[24]:LPINTERNET_CACHE_ENTRY_INFO

Ok, I have there 24 "variables" with the LPINTERNET_CACHE_ENTRY_INFO Structure.
If I want to access to any member of the first one, it's very easy:

mov lpCacheEntry.member, eax

Now, what if I wanna access the same member but in the second or third variable ?

mov lpCacheEntry[2].member, eax ; Wrong !! :(

How then ? I mean, a simple way without doing stack manipulation, I want MASM
do it for me ... :)


Thank a lot.

-MagicMac. :)
Posted on 2001-10-06 17:10:44 by magicmac
Hi magicmac

LEA eax,lpCacheEntry ;eax points to the first struct

add eax,size of lpCacheEntry * x ;eax points to strucy x (x= 0 to 23)

mov eax,(LPINTERNET_CACHE_ENTRY_INFO ptr ).struct_item

KetilO
Posted on 2001-10-06 17:41:55 by KetilO
Hi mi amigo!
Once again our commond friend MASM provides yet another user-friendly way to do our tasks.
Let's suppose we have to access the members of a MSG structure:

.CODE

......

ASSUME EDI:ptr MSG
MOV EAX,MSG.hwnd


That's it!
Very practical!
Sometimes coders do a 'ASSUME EDI:nothing' once they have finished. I don't know if this is 'compulsory' though.

Btw..you never rest don't you?! :)

Ciao amigo, till wednesday.

Larigus
Posted on 2001-10-06 18:06:34 by latigo
psst, latigo. I think that should be mov eax,edi.hwnd

Posted on 2001-10-06 18:20:39 by Eóin
I don't know what i'd do without E?in, my comrade. Hehe
Thanks mate ! :alright:

No need to correct it :). Let's instead post the revisited version:



.CODE

......

ASSUME EDI:ptr MSG
MOV EAX,EDI.hwnd
Posted on 2001-10-06 18:26:57 by latigo
Hi latigo & E?in

I am quiet sure it shoul be:

ASSUME EDI:ptr MSG
MOV EAX,.hwnd


KetilO
Posted on 2001-10-06 18:40:32 by KetilO
I love this madafaca board !! :=) Problem Solved :)

Credits in Order: :tongue:

KetilO: thanx a lot !! Your answer (once again) solved my problem.
How many times did u answer my questions ? I dunno.

Larigus: thanx just because you are my old friend, I want you to leave this board for a while and pick up a girl !! Please, next Wednesday tell me that you f***ed one :)

E?in: thanx a lot fellow. thanx. thanx. thanx. Thanx for answering and answering and answering my questions.


Have a good night, fellows.


-MagicMac. :alright:
Posted on 2001-10-06 22:51:54 by magicmac
Hey you punk mutha fuckha don't tell all the board members 'bout my lack of women. :)

Cya !

Latigus


Btw..No luck tonite, maybe tomorrow...hehehe
Posted on 2001-10-07 03:20:54 by latig0
Hey you bitch, now that i remember i told you 'bout the last two!!
What else do you expect? a pixa? an mpeg?

Heheheiiiiiirass.

Latigo
Posted on 2001-10-07 03:23:02 by latig0
Ok, Ok ... I'm kidding guys ... Latigo is even better than Bratt Pitt and Antonio Banderas ... He's always surrounded by girls .. :)
Please Latigo, leave the madafaca girls for a while and come home !! :) Are u forgetting your friends ?

-Baesterlls.
Posted on 2001-10-07 21:45:20 by magicmac