The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Shooter on December 15, 2010, 04:36:09 PM

Title: DialogBoxParam causes excessive CPU usage??
Post by: Shooter on December 15, 2010, 04:36:09 PM
I'm not sure where to put this problem. I've taken a MASM32 demo project and have attempted to convert it to a GoASM demo project using RadASM 3.x.

Using OllyDbg I've found that the program never exits from this line (it gets stuck between kernel32 and ntdll if I use Animate Trace):


invoke DialogBoxParam,[hInstance],IDD_DLG1,0,ADDR DlgProc,0


The entire project is attached.

I'm thinking it could be either a problem with my command line switches, or possibly a glitch in a dll on my computer.

Any help would be greatly appreciated.

Thanks,
-Shooter
Title: Re: DialogBoxParam causes excessive CPU usage??
Post by: dedndave on December 15, 2010, 04:51:55 PM
i am running XP
it crashes immediately with c0000005
Title: Re: DialogBoxParam causes excessive CPU usage??
Post by: Shooter on December 15, 2010, 04:58:37 PM
Quote from: dedndave on December 15, 2010, 04:51:55 PM
i am running XP
it crashes immediately with c0000005


It actually crashes on you? I'm running XP Pro SP3 and all it does is chew up my CPU usage, +90%.

-Shooter
Title: Re: DialogBoxParam causes excessive CPU usage??
Post by: Neil on December 15, 2010, 05:02:36 PM
Runs on Win 7 (64 bit) with 24 % CPU usage

Edit, that's on one core of a quad core.
Title: Re: DialogBoxParam causes excessive CPU usage??
Post by: dedndave on December 15, 2010, 05:03:32 PM
sounds a little unstable - lol
i don't use GoAsm - hard to read the code   :P
Title: Re: DialogBoxParam causes excessive CPU usage??
Post by: jj2007 on December 15, 2010, 05:10:55 PM
Replace the FF at 40104E with 90, and it will run fine...
Title: Re: DialogBoxParam causes excessive CPU usage??
Post by: Shooter on December 15, 2010, 05:13:16 PM
Quote from: Neil on December 15, 2010, 05:02:36 PM
Runs on Win 7 (64 bit) with 24 % CPU usage

Edit, that's on one core of a quad core.

Neil,
Does the tabstrip operate correctly on Win 7?

Quote from: jj2007 on December 15, 2010, 05:10:55 PM
Replace the FF at 40104E with 90, and it will run fine...

JJ,
I'm not sure what you mean... is that in the debugger itself and not in the .asm?

-Shooter
Title: Re: DialogBoxParam causes excessive CPU usage??
Post by: Neil on December 15, 2010, 05:14:44 PM
Tabs do nothing.

Sorry, I meant they operate OK but nothing happens.
Title: Re: DialogBoxParam causes excessive CPU usage??
Post by: jj2007 on December 15, 2010, 05:17:59 PM
Quote from: Shooter on December 15, 2010, 05:13:16 PM
JJ,
I'm not sure what you mean... is that in the debugger itself and not in the .asm?

Seen from Olly. The point where it chokes is FF - replace with nop (90) or set new origin, and the dialog works.
Sorry that I can't tell you where it is in the asm code, but I have an allergy against archives with many files...
Title: Re: DialogBoxParam causes excessive CPU usage??
Post by: dedndave on December 15, 2010, 05:27:37 PM
doesn't fix it here, Jochen
maybe i am mashing the buttons wrong
Title: Re: DialogBoxParam causes excessive CPU usage??
Post by: Shooter on December 15, 2010, 05:34:49 PM
Quote from: dedndave on December 15, 2010, 05:32:48 PM
well - you may be able to play it in a regular DVD player
but, that doesn't help you get the files off

Huh?
Title: Re: DialogBoxParam causes excessive CPU usage??
Post by: jj2007 on December 15, 2010, 05:54:44 PM
OK, I'll give you a hint:
      invoke GetDlgItem,[hWin],[IDD_TAB1]
In standard Masm, we use them strange brackets only in rare cases :toothy
Title: Re: DialogBoxParam causes excessive CPU usage??
Post by: Shooter on December 15, 2010, 06:09:16 PM
And what rare cases might those be?
Title: Re: DialogBoxParam causes excessive CPU usage??
Post by: Shooter on December 15, 2010, 06:21:23 PM
Update:

The high CPU usage only appears to occur if the .exe is launched from within RadASM. It operates normally, albeit not correctly at the moment, from Explorer. However, it's still causing issues within OllyDbg.

Btw, I went back and replaced those fancy bracket thingies with numbers. :green

-Shooter
Title: Re: DialogBoxParam causes excessive CPU usage??
Post by: Farabi on December 16, 2010, 05:46:54 AM
I bet you access a wrong memory address. Maybe you should replace the "[variable]" with "variable".
Title: Re: DialogBoxParam causes excessive CPU usage??
Post by: jj2007 on December 16, 2010, 08:14:00 AM
Quote from: Farabi on December 16, 2010, 05:46:54 AM
I bet you access a wrong memory address. Maybe you should replace the "[variable]" with "variable".
See replies #12 and #14 ("Btw..").
Title: Re: DialogBoxParam causes excessive CPU usage??
Post by: MichaelW on December 16, 2010, 05:32:17 PM
Quote from: Shooter on December 15, 2010, 04:36:09 PM
Using OllyDbg I've found that the program never exits from this line (it gets stuck between kernel32 and ntdll if I use Animate Trace):

invoke DialogBoxParam,[hInstance],IDD_DLG1,0,ADDR DlgProc,0


DialogBoxParam, like the other functions that create modal dialogs, does not return until the dialog is destroyed.
Title: Re: DialogBoxParam causes excessive CPU usage??
Post by: Shooter on December 16, 2010, 06:49:45 PM
Quote from: MichaelW on December 16, 2010, 05:32:17 PM
DialogBoxParam, like the other functions that create modal dialogs, does not return until the dialog is destroyed.

Oh, that makes sense. Thanks.

I still haven't figured out why when I launch it from within RadASM the CPU usage is so high, and the dialog box never appears; yet from Windows Explorer it launches just fine. Strange. I wonder if it changed RadASM somehow.

-Shooter