It's a small dll that can interrupt any program at any point and show the main cpu registers or a block of memory. Very easy to use, and saves time versus loading a bulky debugger and then trying to find where to put a breakpoint.
[attachment deleted by admin]
Larry,
Welcome to the forum.
Nice idea.
Why not to use an import library instead of calling the exported functions with LoadLibrary?
Hi Vortex. Yes, an import library is okay, and masm produces one automatically along with the *.obj. But I like the low-overhead approach: just the dll and one clever macro. I used to use a macro alone, containing just enough code to dump EAX or a bit of memory to a message box. I found it so useful that I figured it was worthwhile to do it right, with fixed pitch fonts and all. Here's the EAX part:
@dumpeax macro
.code
dumpeax:
 pushfd
 pushad
 cld
 sub esp,0Ch ;more than enough, but using an odd esp makes trouble
 mov ecx,4   ;number of bytes in eax
 mov edi,esp  ;where to assemble a text string
@@: rol eax,8
 push eax
 call _al2hexax
 stosw
 pop eax
 loop @B
 mov [edi],cl ;0
 mov eax,esp
 push 1    ;MB_OKCANCEL
 call @F
 db "dumpeax",0
@@: push eax
 push 0
 call MessageBoxA
 add esp,0Ch
 sub eax,2   ;IDCANCEL
 je short @F
 popad
 popfd
 ret
@@: invoke ExitProcess,eax
_al2hexax: mov ah,al
shr ah,4
call @F
xchg al,ah
@@: and al,0Fh
cmp al,0Ah
sbb al,69h
das
ret
endm
A lot better than nothing :)
Hi Larry,
Glad to see you back. :thumbu
Hi Larry,
OK, I understand your method.
You would like to check GoLink, it's a linker developed for GoAsm but it can link Masm object files. This tool does not require import libraries to resolve external functions.
Here's a version for debugging console apps. Simpler source code, very similar usage and output.
[attachment deleted by admin]
Hi Larry.
I tried to use Peek and the result was syntax error and undefined Symbol: WidthMemBtn.
I put peek.asm, peek.inc and peek.dll in the folder where are the files to compile to a Lib.
Inside one file i put include peek.inc and @peek and inside a proc call regs. I compiled and the result was symbol (that) not find. Why ?
RuiLoureiro
Hi
Sorry Larry, the procedure works well ! There was a problem with the definition of WidthMemBtn in my file peek.asm. It was «WidthMemBtn qu WidthMemDlg/2 ».
My thanks Larry
RuiLoureiro