flat assembler
Message board for the users of flat assembler.

Index > DOS > Inverse stub

Author
Thread Post new topic Reply to topic
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8367
Location: Kraków, Poland
Tomasz Grysztar 26 Apr 2019, 08:32
I just had this idea (not very serious):
Code:
format PE GUI on 'myfrmprg.exe'
entry start

  start:

        push    0
        push    0
        push    _message
        push    0
        call    [MessageBoxA]

        push    0
        call    [ExitProcess]

  _message db 'This program must be run in DOS mode.',0

  align 4

  data import

    dd 0,0,0,RVA kernel_name,RVA kernel_table
    dd 0,0,0,RVA user_name,RVA user_table
    dd 0,0,0,0,0

    kernel_table:
      ExitProcess dd RVA _ExitProcess
      dd 0
    user_table:
      MessageBoxA dd RVA _MessageBoxA
      dd 0

    kernel_name db 'KERNEL32.DLL',0
    user_name db 'USER32.DLL',0

    _ExitProcess dw 0
      db 'ExitProcess',0
    _MessageBoxA dw 0
      db 'MessageBoxA',0

  end data

  data fixups
  end data    
Post 26 Apr 2019, 08:32
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20516
Location: In your JS exploiting you and your system
revolution 26 Apr 2019, 09:52
Heh.
Code:
_message db "This program doesn't understand your fancy newfangled graphical OS. Only the one true OS will live forever, DOS!",0    
Post 26 Apr 2019, 09:52
View user's profile Send private message Visit poster's website Reply with quote
CandyMan



Joined: 04 Sep 2009
Posts: 414
Location: film "CandyMan" directed through Bernard Rose OR Candy Shop
CandyMan 26 Apr 2019, 15:36
These works only with old MZ exe but not with for example LE/NE. Rolling Eyes
Post 26 Apr 2019, 15:36
View user's profile Send private message Reply with quote
FlierMate11



Joined: 13 Oct 2022
Posts: 94
FlierMate11 06 Feb 2023, 12:23
Nice idea! This idea also crossed my mind after I replied to my own thread in "How to insert code in DOS stub of a PE", but I am late for about 4 years. Smile
Post 06 Feb 2023, 12:23
View user's profile Send private message Visit poster's website 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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.