flat assembler
Message board for the users of flat assembler.

Index > Windows > Problems using FASM in new vista computer

Author
Thread Post new topic Reply to topic
AlexP



Joined: 14 Nov 2007
Posts: 561
Location: Out the window. Yes, that one.
AlexP
When I try to use FASM in my new vaio vista computer (32-bit), it doesn't want to compile any API calls, such as this simple little program.
Code:
format PE console
include '%fasminc%\win32ax.inc'


section '.data' data readable writeable

        ;Default Key for testing
        CipherKeyWord0   DD 0x2b7e1516
        CipherKeyWord1   DD 0x28aed2a6
        CipherKeyWord2   DD 0xabf71588
        CipherKeyWord3   DD 0x09cf4f3c

        ExpandedKey128Bit    RW 44

        ;WriteConsole
        NumWritten RB 2
        ;ReadConsole
        NumRead    RB 2
        ReadChar   RB 100
        ;GetStdHandle
        hStdIn     RD 1
        hStdOut    RD 1

        ;Main Screen
        MainScreen DB 'Rijndael Key Schedule',0x0D,0x0A,0
                   DB 'Expanded key is:',0x0D,0x0A,0


section '.code' code readable executable

   CrypterMain:
   ;Expands the key, prints to console

        ;Save all, just for debug
        pusha

        ;Get Input Buffer Handle
        push -0x0A
        call [GetStdHandle]
        mov [hStdIn],eax

        ;Get Output Buffer Handle
        push -0x0B
        call [GetStdHandle]
        mov [hStdOut],eax

        ;Write startup screen
        push 0
        push NumWritten
        push 42
        push MainScreen
        push [hStdOut]
        call [WriteConsole]

        ;ReadConsole Debug
        push 0
        push NumRead
        push 2
        push ReadChar
        push [hStdIn]
        call [ReadConsole]

        ;End process
        popa
        push 0
        call [ExitProcess]


   ;End of Key Expansion                                
    


The file win32ax was found, but it does not recognize the symbols for the API's. All earlier programs I made with FASM still work, and I just downloaded and tried the newest version of fasm. Can anyone tell me why none of the API's are recognized?
Post 16 Dec 2007, 01:08
View user's profile Send private message Visit poster's website Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
Do you have defined fasminc environmental variable? Additionally I see no imports anywhere so if that is all the source then your problem is that (but it always was like this, only with .end macro you get the import table automatically created with all the USED functions declared on win32 headers).

Using ".end CrypterMain" perhaps will fix the problem (note that also creates a separated section for imports only). If this not solve the problem check what I've said about environmental variables. If still all fails please provide exact error output plus full or minimal code that is supposed to compile fine.
Post 16 Dec 2007, 01:26
View user's profile Send private message Reply with quote
AlexP



Joined: 14 Nov 2007
Posts: 561
Location: Out the window. Yes, that one.
AlexP
Yes, I had the .end CrypterMain on, but that was flagged down by fasm every time I tried to compile also. I'm working on the envir variable right now, I just got this computer a few hours ago. Vista 32-bit, everything works fine except when I try to compile programs.

-EDIT- I just attached the .end CrypterMain on, and for some reason it's working now. Thank you Loco, I will most likely have more questions that I will post here while I try to get the Rijndael cipher up and working.
Post 16 Dec 2007, 01:36
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 GitHub, YouTube, Twitter.

Website powered by rwasa.