Author Topic: Infinite loop wanted (for real :-)  (Read 4662 times)

Magnum

  • Member
  • *****
  • Posts: 2399
Infinite loop wanted (for real :-)
« on: November 27, 2012, 04:15:30 AM »
Does Olly trap this infinite loop automatically ?
I even used jnz.

invoke IsDebuggerPresent ; running in the context of a debugger, the return value is nonzero

jz      short continue_initialization_1

jmp     short infinite_loop_1


infinite_loop_1:
   
jmp infinite_loop_1

continue_initialization_1:

---------------------------------------------

Take care,
                   Andy

Ubuntu-mate-18.04-desktop-amd64

http://www.goodnewsnetwork.org

qWord

  • Member
  • *****
  • Posts: 1475
  • The base type of a type is the type itself
    • SmplMath macros
Re: Infinite loop wanted (for real :-)
« Reply #1 on: November 27, 2012, 04:22:34 AM »
Once started, Olly runs an application until an exception occurs or you paused it.
Also, it is not specified whether IsDebuggerPresent (or any other API) set or clear the zero flag ;-)
MREAL macros - when you need floating point arithmetic while assembling!

dedndave

  • Member
  • *****
  • Posts: 8828
  • Still using Abacus 2.0
    • DednDave
Re: Infinite loop wanted (for real :-)
« Reply #2 on: November 27, 2012, 04:23:48 AM »
invoke IsDebuggerPresent ; running in the context of a debugger, the return value is nonzero
test eax,eax

infinite_loop_1:
jnz infinite_loop_1

Magnum

  • Member
  • *****
  • Posts: 2399
Re: Infinite loop wanted (for real :-)
« Reply #3 on: November 27, 2012, 06:39:04 AM »
Thanks, the prog works but I am confused.

EAX has zero when run under Olly ?

Take care,
                   Andy

Ubuntu-mate-18.04-desktop-amd64

http://www.goodnewsnetwork.org

dedndave

  • Member
  • *****
  • Posts: 8828
  • Still using Abacus 2.0
    • DednDave
Re: Infinite loop wanted (for real :-)
« Reply #4 on: November 27, 2012, 01:47:51 PM »
i just went by your comment   :P
Quote
invoke IsDebuggerPresent ; running in the context of a debugger, the return value is nonzero

here is the MSDN doc...
Quote
Return value

If the current process is running in the context of a debugger, the return value is nonzero.

If the current process is not running in the context of a debugger, the return value is zero.

Tedd

  • Member
  • ***
  • Posts: 377
  • Procrastinor Extraordinaire
Re: Infinite loop wanted (for real :-)
« Reply #5 on: November 28, 2012, 02:19:10 AM »
The call to IsDebuggerPresent is easily patched to always return false; it could even be considered standard practice.

Stop wasting your time ::)
Potato2

ragdog

  • Member
  • ****
  • Posts: 609
Re: Infinite loop wanted (for real :-)
« Reply #6 on: November 28, 2012, 05:15:53 AM »
Right Tedd

IsDebuggerPresent is only an api the get the BeingDebuged from the Peb