flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > problem with use "assume" macro

Author
Thread Post new topic Reply to topic
marcinzabrze12



Joined: 07 Aug 2011
Posts: 61
marcinzabrze12 15 Mar 2012, 01:18
Another yet problem. When i try use assume:
Code:
 
assume    eax:POINT                   ; everything ok 
assume    eax:IMAGE_OPTIONAL_HEADER32 ; everything ok

assume    eax:WIN32_FIND_DATA         ; error "illegal instruction"
assume    eax:IMAGE_NT_HEADERS32      ; error "illegal instruction"
    
Post 15 Mar 2012, 01:18
View user's profile Send private message Send e-mail Reply with quote
Mike Gonta



Joined: 26 Dec 2010
Posts: 243
Mike Gonta 12 Jul 2012, 07:39
marcinzabrze12 wrote:
Another yet problem. When i try use assume:
Code:
 
assume    eax:POINT                   ; everything ok 
assume    eax:IMAGE_OPTIONAL_HEADER32 ; everything ok

assume    eax:WIN32_FIND_DATA         ; error "illegal instruction"
assume    eax:IMAGE_NT_HEADERS32      ; error "illegal instruction"
    
The assume macro doesn't like nested structs.
A workaround is to flatten the struct.
Original includes:
Code:
struct FILETIME
  dwLowDateTime  dd ?
  dwHighDateTime dd ?
ends
struct WIN32_FIND_DATA
  dwFileAttributes   dd ?
  ftCreationTime     FILETIME
  ftLastAccessTime   FILETIME
  ftLastWriteTime    FILETIME
  nFileSizeHigh      dd ?
  nFileSizeLow       dd ?
  dwReserved0           dd ?
  dwReserved1           dd ?
  cFileName             TCHAR MAX_PATH dup (?)
  cAlternateFileName TCHAR 14 dup (?)
ends    

flattened include:
Code:
struct WIN32_FIND_DATA
  dwFileAttributes dd ?
; FILETIME
    ftCreationTime.dwLowDateTime dd ?
    ftCreationTime.dwHighDateTime dd ?
; FILETIME
    ftLastAccessTime.dwLowDateTime dd ?
    ftLastAccessTime.dwHighDateTime dd ?
; FILETIME
    ftLastWriteTime.dwLowDateTime dd ?
    ftLastWriteTime.dwHighDateTime dd ?
  nFileSizeHigh dd ?
  nFileSizeLow dd ?
  dwReserved0 dd ?
  dwReserved1 dd ?
  cFileName TCHAR MAX_PATH dup (?)
  cAlternateFileName TCHAR 14 dup (?)
ends    
Also The assume macro doesn't like comma separated data statements.

_________________
Mike Gonta
look and see - many look but few see

https://mikegonta.com
Post 12 Jul 2012, 07:39
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8359
Location: Kraków, Poland
Tomasz Grysztar 27 Sep 2012, 14:09
Today's update in 1.71.03 package fixes this bug.
Post 27 Sep 2012, 14:09
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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.