flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
Vortex 24 Apr 2004, 09:24
Practically, this is not an error. An executable which doesn't import even a single API function has not much use in normal life.
![]() _________________ Code it... That's all... |
|||
![]() |
|
Daemon 24 Apr 2004, 10:44
Have looked at win32ax.inc file:
Code: macro .end label { entry label section '.idata' import data readable writeable library kernel32,'KERNEL32.DLL',\ user32,'USER32.DLL',\ gdi32,'GDI32.DLL',\ advapi32,'ADVAPI32.DLL',\ comctl32,'COMCTL32.DLL',\ comdlg32,'COMDLG32.DLL',\ shell32,'SHELL32.DLL',\ wsock32,'WSOCK32.DLL' include '%fasminc%/apia/kernel32.inc' include '%fasminc%/apia/user32.inc' include '%fasminc%/apia/gdi32.inc' include '%fasminc%/apia/advapi32.inc' include '%fasminc%/apia/comctl32.inc' include '%fasminc%/apia/comdlg32.inc' include '%fasminc%/apia/shell32.inc' include '%fasminc%/apia/wsock32.inc' } I.e. if you use an '.end' macro the import section adds you want it or not... Code: include 'win32ax.inc' .code start: xor eax, eax ret This produces a 1024bytes code. (don't know how is it with entry point... maybe it is set to 1st byte of '.flat' section...) Other, it's possible to make smaller file if you put import data and code in same section, but first place imports!!! : Code: format pe gui entry start include 'win32a.inc' section '.flat' data code import readable writeable executable library kernel32,'KERNEL32.DLL',\ user32,'USER32.DLL' import kernel32, ExitProcess,'ExitProcess' import user32, MessageBox,'MessageBoxA' message db 'Hell0w!',0 caption db 'Message',0 start: invoke MessageBox, HWND_DESKTOP, message, caption, MB_OK invoke ExitProcess, eax Greetz, Daemon. |
|||
![]() |
|
Dunduk 26 Apr 2004, 03:02
Hi
Daemon wrote:
You can put import data, export data and code in one section and it will work. Code: format PE GUI 4.0 DLL entry DllEntryPoint include '%fasminc%\win32a.inc' proc DllEntryPoint, hinstDLL,fdwReason,lpvReserved xor eax,eax inc eax return endp proc Proc1 ... return endp proc Proc2 .local_var dd ? enter ... return endp data import ... end data data export export 'TEST.DLL',\ Proc1,'Proc1',\ Proc2,'Proc2' end data data fixups end data |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.