flat assembler
Message board for the users of flat assembler.

Index > Main > How to make my own DOS STUB????

Author
Thread Post new topic Reply to topic
jhonny6721



Joined: 07 Aug 2014
Posts: 26
jhonny6721 26 Aug 2014, 03:58
Hello, I, m trying to build my own DOS STUB, for example, a DOS Version of a Win32 executable. I don, t know how to do kt using fasm. I am looking for this feature around the net but i can, t find it.

Please, give a step by step guide, or a short code fragment. Thanks for your answers.

_________________
Мне нравится программирование.
Post 26 Aug 2014, 03:58
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 26 Aug 2014, 04:31
Here is some very BasicStub.asm code which you can expand to your needs:
Code:
format MZ
segment zz
entry zz:entry
stack 128
heap 0

entry:
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,'$'    
And for the Win32 portion you can use something like this:
Code:
format PE GUI 4.0 on 'BasicStub.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    
Notice the format directive tells fasm which file to use for the stub.
Post 26 Aug 2014, 04:31
View user's profile Send private message Visit poster's website Reply with quote
jhonny6721



Joined: 07 Aug 2014
Posts: 26
jhonny6721 27 Aug 2014, 20:42
revolution Thanks for your answer. It was very useful to fix my problem.

_________________
Мне нравится программирование.
Post 27 Aug 2014, 20:42
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.