flat assembler
Message board for the users of flat assembler.
Index
> Projects and Ideas > win32ax.inc powerful macro basic to advance guide |
Author |
|
sleepsleep 02 Aug 2011, 22:48
how win32ax.inc looks like
Code: include '%fasminc%\win32ax.inc' TITLE_TO_FIND equ 'Untitled - Notepad' proc start invoke PostMessage, <invoke FindWindow, NULL, TITLE_TO_FIND>, WM_CLOSE, 0, 0 invoke ExitProcess, 0 endp .end start based on post 132212 by LocoDelAssembly, |
|||
02 Aug 2011, 22:48 |
|
sleepsleep 02 Aug 2011, 23:29
how to add extra library .dll under win32ax.inc
thanks to LocoDelAssembly, revolution & edfed. Code: format PE console 4.0 include '%fasminc%\WIN32AX.INC' .code start: cinvoke printf, hello invoke ExitProcess,0 .data hello db "hello world!" section '.idata' import data readable writeable library kernel32, 'kernel32.dll',\ msvcrt, 'msvcrt.dll' include '%fasminc%\API\kernel32.inc' import msvcrt, printf, 'printf' Last edited by sleepsleep on 03 Aug 2011, 18:36; edited 4 times in total |
|||
02 Aug 2011, 23:29 |
|
sleepsleep 02 Aug 2011, 23:30
.if
.endif example |
|||
02 Aug 2011, 23:30 |
|
LocoDelAssembly 03 Aug 2011, 14:47
The "won't work" example the problem you have is that the ".end" macro already built the import table, so "library" and "import" macros won't work.
|
|||
03 Aug 2011, 14:47 |
|
sleepsleep 03 Aug 2011, 16:53
i change it to be like this,
assembled but crashed. Code: include '%fasminc%\WIN32AX.INC' .code start: cinvoke printf, hello invoke ExitProcess,0 .data hello db "hello world!" library msvcrt, 'msvcrt.dll', \ kernel32, 'kernel32.dll' import msvcrt, printf, 'printf' include '%fasminc%\API\kernel32.inc' this display what intended Code: format PE console 4.0 include '%fasminc%\WIN32AX.INC' .code start: cinvoke printf, hello invoke ExitProcess,0 .data hello db "hello world!" section '.idata' import data readable writeable library kernel32, 'kernel32.dll',\ msvcrt, 'msvcrt.dll' include '%fasminc%\API\kernel32.inc' import msvcrt, printf, 'printf' but does this mean, when user start using etc DLLs, they must code their idata section on their own? |
|||
03 Aug 2011, 16:53 |
|
revolution 03 Aug 2011, 16:57
The current import and library macros cannot be extended. If you want to add more imports then currently you must code a custom section.
I did write some macros for this some time ago. libraryonce and some others. Perhaps the search will find them? |
|||
03 Aug 2011, 16:57 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.