flat assembler
Message board for the users of flat assembler.

Index > Main > Leave and Retn

Author
Thread Post new topic Reply to topic
shism2



Joined: 14 Sep 2005
Posts: 248
shism2
Code:
proc tls_callback DllHandle, Reason, Reserved 
.if [entry1],e,1
invoke ExitProcess,0
.else
mov [entry1],1h
.endif

 start3:
     call @@Set_SEH

    
    mov eax,[esp+12]
    add dword [eax+CONTEXT_Eip],2   ;
    mov dword [eax],CONTEXT_FULL
    xor eax,eax
    ret

@@Set_SEH:    


The xor eax,eax and ret..... COmpile to xor eax,eax
leave
retn 0C.

Is there anyway to make it not add the leave ?
Post 16 Sep 2006, 22:41
View user's profile Send private message Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7724
Location: Kraków, Poland
Tomasz Grysztar
Perhaps you shouldn't use "proc" macro, since it appears you definitely don't need its features here.

However, if you keep using the macros, use RETN or RETF mnemonics to get the pure instructions, the "ret" in context of "proc" is a macroinstruction.
Post 16 Sep 2006, 22:44
View user's profile Send private message Visit poster's website Reply with quote
RedGhost



Joined: 18 May 2005
Posts: 443
Location: BC, Canada
RedGhost
Is the reserved parameter of DllMain a pointer to the thread's CONTEXT?

_________________
redghost.ca
Post 16 Sep 2006, 22:50
View user's profile Send private message AIM Address MSN Messenger Reply with quote
shism2



Joined: 14 Sep 2005
Posts: 248
shism2
It's for a tls callback
Post 17 Sep 2006, 02:54
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 cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.