News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

DebugHeap updated

Started by jj2007, January 12, 2022, 11:44:48 AM

Previous topic - Next topic

jj2007

RichMasm users can insert OPT_Debug 1 somewhere in their source to run the executable via \Masm32\MasmBasic\Res\DebugHeap.exe

If you have a suspicion that your proggie does not respect the rules, DebugHeap.exe will detect it, and show you where it happens. It's one of the most useful tools in my repertoire, I use it a lot.

Attached a new version, with one minor change. The old version did create a console if an error occurred and there was no console present (which is the case for most GUI programs). However, I had a case (SSD saver) where a console was present but hidden. The new version detects that and restores the console to make sure the output becomes visible. Example:

## HEAP[DebugHeapTest.exe]:
## Heap block at 00286AE0 modified at 00286B22 past requested size of 39
*
## HEAP[DebugHeapTest.exe]:
## Invalid address specified to RtlFreeHeap( 00280000, 00286AE8 )
*
** DebugHeap found errors **

jj2007

To avoid misunderstandings: you don't need RichMasm or MasmBasic to use this tool. Just drag any suspicious executable over DebugHeap.exe to find out where it corrupts the heap. Source is included btw :cool: