flat assembler
Message board for the users of flat assembler.

Index > Main > Has struc changed?

Author
Thread Post new topic Reply to topic
chorus



Joined: 16 Mar 2004
Posts: 23
chorus
It's been awhile since I've done any coding with FASM. Has the usage of struc changed wrt register pointers? (since, oh, version 1.5)

I used to be able to do stuff like

Code:
mov [ebx+SOMESTRUCTURE.somemember],eax
    


but now I can't... I get "undefined symbol" when I assemble. The only way I can get around this is to do:

Code:
virtual at 0
  SOMESTRUCTURE SOMESTRUCTURE
end virtual
    


Didn't have to do that before...

--Chorus
Post 22 Dec 2005, 01:02
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17280
Location: In your JS exploiting you and your system
revolution
It depends on how you instantiated your structure after defining it. If you have your own "struct" macro then nothing has changed, but if you use the "struct" macro from the package then a lot has changed because of handling if the "." character. Perhaps you can show how you have defined your structure then I can help to get it working the way you want.
Post 22 Dec 2005, 01:55
View user's profile Send private message Visit poster's website Reply with quote
chorus



Joined: 16 Mar 2004
Posts: 23
chorus
I'm not using any macro. I'm using the "struc" that is built into fasm (or at least I believe it's built in... it's in the documentation).

Perhaps before I was using the macro without knowing it... probably it's in the standard includes. Thing is I was using Windows before so those includes are there and now I'm using linux and they aren't (stuff like invoke, etc)

So I should assume "struc" works the way I described and "struct" works the way I want, but it's a macro. Does that sound about right?

--Chorus
Post 23 Dec 2005, 15:39
View user's profile Send private message Reply with quote
chorus



Joined: 16 Mar 2004
Posts: 23
chorus
This is how I've defined the structure

Code:
struc BITSTREAM
{
        .lpbitstream dq ?
        .cbBuffer dq ?
        .nPosition dq ?
}
    


To get it to work I need to have

Code:
virtual at 0
  BITSTREAM BITSTREAM
end virtual
    


--Chorus
Post 23 Dec 2005, 15:47
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17280
Location: In your JS exploiting you and your system
revolution
You have two main options that I can see. If you are programming for WIN32 you can use the package macro "STRUCT" like this:
Code:
include 'win32a.inc'

struct BITSTREAM 
        lpbitstream dq ? 
        cbBuffer dq ? 
        nPosition dq ? 
ends    
Or if you want to use your own "STRUCT" you can do something like this:
Code:
macro struct name
{       virtual at 0
        name name
        sizeof.#name = $
        name#.size = $
        end virtual
}

struc BITSTREAM 
{ 
        .lpbitstream dq ? 
        .cbBuffer dq ? 
        .nPosition dq ? 
}
struct BITSTREAM    
Post 24 Dec 2005, 02:44
View user's profile Send private message Visit poster's website 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. Also on YouTube, Twitter.

Website powered by rwasa.