flat assembler
Message board for the users of flat assembler.

Index > Windows > error:out of memory

Author
Thread Post new topic Reply to topic
yinke



Joined: 07 Jan 2010
Posts: 7
yinke
what happen?
Code:
format pe gui 
include 'win32ax.inc' 
include 'context.inc' 
entry start 

section '.code' code readable executable 
start: 
push _MeAddress 
lea edx,[esp-8] 
xchg edx,[fs:0] 
push _Exception 
push edx 
int 3 
ret 

_MeAddress: 
pop dword[fs:0] 
add esp,8 
xor edx,edx 
invoke MessageBox,0,"aaa","bbb",0 
ret 




proc _Exception pExcept,pSeh,pContext,pDisPatch 
pushad 
mov edi,[pContext] 
mov edx,[pSeh] 
push dword [edx+8] 
pop dword [edi+CONTEXT.regEip] 
popad 
xor eax,eax 
ret 
endp 

section '.import' import data readable 
library user32,'user32.dll' 
include 'api\user32.inc'    
Post 07 Jan 2010, 12:01
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
Next time please use [code] [/code] tags around your code, and don't use tags in thread title
Post 07 Jan 2010, 12:21
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
sinsi



Joined: 10 Aug 2007
Posts: 696
Location: Adelaide
sinsi
Code:
include 'context.inc'    
Good one that.

>what happen?
Shit happen. Or not.
Post 07 Jan 2010, 12:38
View user's profile Send private message Reply with quote
yinke



Joined: 07 Jan 2010
Posts: 7
yinke
if haven't
Code:
include 'context.inc'    

then error
its says:error
Code:
pop dword [edi+CONTEXT.regEip]     
This type is not defined
So I put this structure into the file
but Tips error:out of memory
Post 07 Jan 2010, 12:56
View user's profile Send private message Reply with quote
yinke



Joined: 07 Jan 2010
Posts: 7
yinke
cintext.inc Contains the following
Code:
struct CONTEXT 
  ContextFlags  dd ? 
  iDr0          dd ? 
  iDr1          dd ? 
  iDr2          dd ? 
  iDr3          dd ? 
  iDr6          dd ? 
  iDr7          dd ? 
  FloatSave     FLOATING_SAVE_AREA 
  regGs         dd ? 
  regFs         dd ? 
  regEs         dd ? 
  regDs         dd ? 
  regEdi        dd ? 
  regEsi        dd ? 
  regEbx        dd ? 
  regEdx        dd ? 
  regEcx        dd ? 
  regEax        dd ? 
  regEbp        dd ? 
  regEip        dd ? 
  regCs         dd ? 
  regFlag       dd ? 
  regEsp        dd ? 
  regSs         dd ? 
  ExtendedRegisters rb 512 
Ends 
    
Post 07 Jan 2010, 13:07
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
User-defined macros in FASM are case sensitive. Use "ends" instead of "Ends"
Post 07 Jan 2010, 15:23
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
yinke



Joined: 07 Jan 2010
Posts: 7
yinke
thank you very much
Post 07 Jan 2010, 22:57
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
you're welcome Smile
Post 08 Jan 2010, 12:17
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number 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. Also on YouTube, Twitter.

Website powered by rwasa.