flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > how to pass struc to proc?

Author
Thread Post new topic Reply to topic
nazha



Joined: 05 Mar 2009
Posts: 40
Location: Beijing, China
nazha
How to pass struc to proc and access its member field? thanks!
Post 17 Mar 2009, 04:32
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17270
Location: In your JS exploiting you and your system
revolution
Code:
Structure STRUCTURE

stdcall MyCoolFunction, [Structure.member1], [Structure.member2]
...
proc MyCoolFunction value1,value2
  mov ecx,[value1]
  mov edx,[value2]
...    
Or:
Code:
Structure STRUCTURE

stdcall MyCoolFunction Structure
...
proc MyCoolFunction pointerToStructure
  mov eax,[pointerToStructure]
  mov ecx,[eax+STRUCTURE.member1]
  mov edx,[eax+STRUCTURE.member2]
...    
Post 17 Mar 2009, 04:48
View user's profile Send private message Visit poster's website Reply with quote
nazha



Joined: 05 Mar 2009
Posts: 40
Location: Beijing, China
nazha
Thanks.
Post 17 Mar 2009, 05:19
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.