Sunday, November 05, 2006

Twisted way to loop!!

Hey there ,
Today I was messing around with esp (again) and found a funny way to create an infinite loop :)

call @f
@@:
sub dword ptr [esp],5 ;where call @f takes five bytes!
invoke Sleep,1000
ret

Of course an infinite loop could be something like this :

@@:
invoke Sleep,1000
jmp @b

I put the Sleep() so as not to consume 100% cpu resources ,so you can simply ommit it, any other thoughts and code snippets I would be glad to see placed comments

*The above code snippets was tested on masm32

-------------------------------------------------------------------
[Note: The @f will point to the next @@ ,and @b will point to the previous @@]

Labels:

Smilar pages

0 Comments:

Post a Comment

<< Home