Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .model flat, stdcall ; Simplified with Windows conventions, please.
- .radix 16 ; Hex by default, please.
- option casemap :none ; Case sensitive identifiers, please.
- ; Declarations of Windows API functions:
- extern ExitProcess@4 : proc
- extern MessageBoxW@16 : proc
- ; Declaration of this program's entry point symbol:
- public startup
- .const
- ; Data:
- titleString dw 0054, 0068, 0065, 0020, 006D, 0061, 0063, 0068, 0069, 006E, 0065
- dw 0020, 0063, 006F, 0064, 0065, 0020, 0073, 0061, 0079, 0073, 003A
- dw 0000
- helloString dw 0048, 0065, 006C, 006C, 006F, 002C, 0020, 0077, 006F, 0072, 006C
- dw 0064, 0021, 0009, 0000
- .code
- ; Call forwarders, to be able to use the API function addresses directly.
- exitProcessJump:
- db 68 ; push ...
- dd offset ExitProcess@4 ; address of ExitProcess
- db 0C3 ; ret
- messageBoxJump:
- db 68 ; push ...
- dd offset MessageBoxW@16 ; address of MessageBox
- db 0C3 ; ret
- ; Main program:
- startup:
- ; Present a message box:
- db 68, 40, 00, 01, 00 ; push flags argument 00010040
- db 68 ; push ...
- dd offset titleString ; offset titleString
- db 68 ; push ...
- dd offset helloString ; offset helloString
- db 6A, 00 ; push parent window handle, 0 = none.
- db 0E8 ; call ...
- dd (offset messageBoxJump) - ($ + 4) ; MessageBox
- ; Exit process:
- db 6A, 00 ; push exit code argument, 0 = success.
- db 0E8 ; call ...
- dd (offset exitProcessJump) - ($ + 4) ; ExitProcess
- ; This end directive has no effect, it's just required to mark the end of the source code.
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement