This thread is for strange but working code.
I wrote this code. Now it's looking strange even for me.
format PE GUI
include "WIN32A.INC"
section ".code" code executable readable writeable
entry $
mov esp, wicked_stack
MessageBox: jmp [__imp__MessageBoxA@16]
ExitProcess: jmp [__imp__ExitProcess@4]
eax_eq_literal?_branch:
cmp eax, [esp]
pop eax
pop eax
jnz @f
mov esp, eax
@@: ret
rb 65536
section ".data" data readable writeable
wicked_stack:
dd MessageBox
dd HWND_DESKTOP, hello_world, hello_caption, MB_OK+MB_ICONEXCLAMATION
dd eax_eq_literal?_branch
dd HWND_DESKTOP, goodbye_world, hello_caption, MB_YESNO+MB_ICONQUESTION
dd IDYES, goodbye_ok
dd MessageBox
dd ExitProcess
dd HWND_DESKTOP, goto_hell_world, hello_caption, MB_OK+MB_ICONINFORMATION
dd 0
dd -1
goodbye_ok: dd ExitProcess
dd 0
dd 0
hello_caption db "Weird Hello", 0
hello_world db "Hello, World!", 0
goodbye_world db "Goodbye, World?", 0
goto_hell_world db "Go to hell, cruel World!", 0
data import
library USER32, "USER32.DLL",\
KERNEL32, "KERNEL32.DLL"
import USER32,\
__imp__MessageBoxA@16, "MessageBoxA"
import KERNEL32,\
__imp__ExitProcess@4, "ExitProcess"
end data