flat assembler
Message board for the users of flat assembler.

Index > Heap > proc , How to ?

Author
Thread Post new topic Reply to topic
HarryTuttle



Joined: 26 Sep 2003
Posts: 211
Location: Poland
HarryTuttle
Code:
proc warrning
..coment  db       'Unable to Terminate Process',0
..coment1 db       'The operation could not be completed.',10,10,'Access is denied.',0
enter
lea eax,[..coment]
lea ebx,[..coment1]

invoke MessageBox,0,ebx,eax,MB_ICONERROR
invoke ExitProcess,0
return
endp  
    


what I'm doing wrong ?

_________________
Microsoft: brings power of yesterday to computers of today.
Post 19 May 2005, 13:54
View user's profile Send private message Reply with quote
rea



Joined: 14 Nov 2004
Posts: 92
rea
The entry point of your function is in address labeled "warrning" and the processor jump there and start executing the bytes that are from that address to the end...

By the way, "Unable to Terminate Process',0" is still only bytes, and if executed Smile...

What you will do for handle that?
Post 19 May 2005, 17:33
View user's profile Send private message Reply with quote
HarryTuttle



Joined: 26 Sep 2003
Posts: 211
Location: Poland
HarryTuttle
please execute it
Code:
;program Exist 1
include '%fasminc%/win32ax.inc'

.code

start:

call warrning
invoke ExitProcess,0



proc warrning
..coment  db       'Unable to Terminate Process',0
..coment1 db       'The operation could not be completed.',10,10,'Access is denied.',0
enter
lea eax,[..coment]
lea ebx,[..coment1]

invoke MessageBox,0,ebx,eax,MB_ICONERROR
invoke ExitProcess,0
return
endp

.end star
    


how to handle the strings?

and how to hide the app from taskbar?

bvest thx,

_________________
Microsoft: brings power of yesterday to computers of today.
Post 20 May 2005, 09:48
View user's profile Send private message Reply with quote
Torrey



Joined: 12 Oct 2003
Posts: 78
Torrey
I think this topic maybe in the wrong section, but since I'm bored at work, I did something completely not related to what the original poster wanted, here is my dedication to boredom that is my job:

Code:
format PE GUI 4.0
entry start

include '%fasminc%\win32a.inc'

section '.code' import executable readable writeable

  library kernel,'KERNEL32.DLL',user,'USER32.DLL'

  import kernel,ExitProcess,'ExitProcess'
  import user,MessageBox,'MessageBoxA'

start:
        xor edx,edx
        push warning
        ret

proc warning
     enter
     lea eax,[comment]
     lea ebx,[comment1]
     push MB_ICONERROR
     push eax
     push ebx
     push edx
     call [MessageBox]
     return

     comment  db       'Unable to Terminate Process',0
     comment1 db       'The operation could not be completed.',10,13,'Access is denied.',0
endp     
Post 20 May 2005, 10:49
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7724
Location: Kraków, Poland
Tomasz Grysztar
The variables that you declare between "proc" and "enter" are the local variables allocated on stack each time the procedure is called. Therefore they are not initialized with any values (in "proc" macro they are implemented with use of the "virtual" directive), if you need them to be initialized, you have to do it manually each time the procedure is entered (since they are newly allocated from stack each time).

About hiding from taskbar: look at the USECOM example in the fasmw packages.
Post 20 May 2005, 11:05
View user's profile Send private message Visit poster's website Reply with quote
HarryTuttle



Joined: 26 Sep 2003
Posts: 211
Location: Poland
HarryTuttle
Big THX

_________________
Microsoft: brings power of yesterday to computers of today.
Post 20 May 2005, 13:41
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 can attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.