flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
revolution 25 Jan 2023, 07:28
Stubs are only valid for MZ formats within PE files.
Stubs can be any length up to, IIRC, 64kb. |
|||
![]() |
|
revolution 25 Jan 2023, 07:31
A stub:
Code: format MZ segment zz entry zz:0 stack 128 heap 0 push cs pop ds mov ah,9 mov dx,message int 21h mov ax,4cffh int 21h message: db 'Windows 95 or higher required for this program!',0dh,0ah,'$' db 256+128 dup 0xaa ; random data to make the stub bigger for testing Code: format PE GUI 4.0 on 'BigStub-Stub.exe' include 'win32ax.inc' .code start: invoke MessageBox,HWND_DESKTOP,"Hi! I'm the example program!","Win32 Assembly",MB_OK invoke ExitProcess,0 .end start |
|||
![]() |
|
FlierMate11 25 Jan 2023, 07:48
revolution wrote: A stub: Aww... I like this, tested OK on my PC. I didn't know can insert DOS stub into PE output like that. Thanks. |
|||
![]() |
|
revolution 25 Jan 2023, 08:23
The stub can be any MZ format program. It doesn't have to be only a stub, it can be a full application.
|
|||
![]() |
|
Tomasz Grysztar 25 Jan 2023, 12:17
revolution wrote: Stubs can be any length up to, IIRC, 64kb. Code: ; alteration in source\ide\fasmw\fasmw.asm: format PE GUI 4.0 large NX on '..\fasmd\fasmd.exe' |
|||
![]() |
|
revolution 25 Jan 2023, 15:44
Tomasz Grysztar wrote: MZ files can be larger. You can, in fact, assemble FASMW.EXE on top of FASMD.EXE, and it works. I wonder if it is possible to have a DOS TUI, Windows GUI and a CMD CLI in a single exe. Windows is weird with how to detect and use the console vs a window. The requirement to mark the exe as either GUI or CLI forces an initial choice, and leaves the app with only inferior choices about how to deal with switching to another interface. Many apps don't even try and just make two exe files. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.