Hi there,
I am struggling with something weird. I am trying to put my byte string in .code section and after using it with MessageBox api, it works but Windows XP gives and error,
as you know bla. bla. an exception occured, SEND it DONT SEND IT bla. bla.
But if i put my byte string into .data section, it gives error...
Code is like this :
.486
.model flat,stdcall
option casemap:none
include \masm32\include\windows.inc
include \masm32\include\kernel32.inc
include \masm32\include\user32.inc
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\user32.lib
.data
.code
_start:
push 0
push offset mesaj
push offset mesaj
push NULL
call MessageBox
push 0
push offset mesaj
push offset mesaj
push NULL
call MessageBox
mesaj db 'emre',0
_end:
push 0
call ExitProcess
end _start
Does anyone have any idea?
There is a simple cure: put a
jmp _end
straight after the second
call MessageBox
I think you get the idea and can figure out yourself why your app got closed down by Windows, resulting in the mentioned error message.
If not, just ask. ;)
HTH
The fault occurs because you are trying to execute data.
mesaj db 'emre',0
Put it in the .DATA section and it will not be a problem.