flat assembler
Message board for the users of flat assembler.

Index > Windows > can't get anything to work

Author
Thread Post new topic Reply to topic
c0mputer-fr0d



Joined: 02 Oct 2012
Posts: 4
c0mputer-fr0d 02 Oct 2012, 21:03
the compiler has been fighting me every line of code and I can't get anything to work. I just want to open a console window on windows.Heres what I have so far
Code:
 format PE GUI 4.0
  entry Main

 include "C:\Program Files (x86)\FASM\INCLUDE\win32ax.inc" ;
 include "C:\Program Files (x86)\FASM\INCLUDE\MACRO\PROC32.inc";

section  '.data' data readable writeable
 inchar     DB ?
 numread    DD ?
 inhandle   DD ?

section '.code' code readable executable

 Main:

 invoke MessageBox, 0, "Enter 1:Push\n2:Pop\n3:PrintStack\n4:Peak", "l33t",0,;
 invoke  AllocConsole;
 invoke ExitProcess, 0 ;
    ;                  
    

oh yea and invoking messagebox doesn't work either
they both say undefined symbol when I thought those macros were defined in win32ax and proc32 I'm trying to make a stack data structure example in fasm just to learn assembly a little bit. I need to be able to get single numbers as input for the menu but I can't do this without invoking console . I suppose I can try http://www.hackforums.net/archive/index.php/thread-341865.html
because that seems to be the real deal stuff and not just calling macros.
but to be easy on myself I want to try this
Code:
 invoke  AllocConsole;
        invoke  GetStdHandle,STD_INPUT_HANDLE;
        mov [inhandle],eax;
        invoke  ReadConsole,[inhandle],inchar,1,numread,0;
        invoke ExitProcess, 0;       
    

Please help.
Post 02 Oct 2012, 21:03
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20299
Location: In your JS exploiting you and your system
revolution 02 Oct 2012, 21:07
c0mputer-fr0d wrote:
... I thought those macros were defined in win32ax ...
If you want to use the macros like invoke then you have to actually include win32a[x][p].inc. See the EXAMPLES folder in the download for how it works:
Code:
include 'win32ax.inc'

.data

;...

.code

;...

invoke ...    
Post 02 Oct 2012, 21:07
View user's profile Send private message Visit poster's website Reply with quote
c0mputer-fr0d



Joined: 02 Oct 2012
Posts: 4
c0mputer-fr0d 02 Oct 2012, 21:47
in the source code I posted it is being included
I also tried win32xp and win32w with no luck either they still whine about my invoke call to messagebox
Post 02 Oct 2012, 21:47
View user's profile Send private message Reply with quote
c0mputer-fr0d



Joined: 02 Oct 2012
Posts: 4
c0mputer-fr0d 02 Oct 2012, 21:56
Got it to work by getting rid of white space before lines and commenting out a label I wasn't using , not really sure how that fixed it
Post 02 Oct 2012, 21:56
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20299
Location: In your JS exploiting you and your system
revolution 02 Oct 2012, 22:23
What I meant was that you need to set your environment variable so that you can include win32ax.inc as in the sample code I posted without specifying the entire path, then al the macros and equates will be properly found without generating errors.

Note that your inclusion of PROC.INC is redundant; and that white spacing is ignored.
Post 02 Oct 2012, 22:23
View user's profile Send private message Visit poster's website Reply with quote
c0mputer-fr0d



Joined: 02 Oct 2012
Posts: 4
c0mputer-fr0d 02 Oct 2012, 22:58
yea I had the environment variable set for the include folder and then even tried having 2 vars for includes and macro folder but it works now thanks anyway I think it was that label that was floating around I commented it out.
Post 02 Oct 2012, 22:58
View user's profile Send private message Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2909
Location: 0x77760000
typedef 07 Oct 2012, 17:31
wow, so "l33t"
Post 07 Oct 2012, 17:31
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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.