News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

debug with dr7

Started by korte, January 17, 2008, 11:35:12 AM

Previous topic - Next topic

korte

want to trace point betwen two memory address, write operation


DOS 6.22  ml 6.11


_DR7 proc

     mov eax,cr4 ; ask debug facilities in CR4
     add eax,18h
     mov cr4,eax

      mov eax,ebx; start address
      mov dr0, eax

      add ebx,50000
      mov eax,ebx;   ; end address
      mov dr1, eax


        ; enable DR0 and DR1 for memory access

         mov eax,00000000000100010000001000001010b
        mov dr7,eax
      push ds
      push cs
      pop ds
      mov ax,02501h ; Set new Int_1
     mov dx,offset NewInt1
     int 021h
     pop ds

    ret
_DR7 endp


work but only start address. Not full area betwen start address and end address.

Possible?

Please help?

I want to check 50000 byte in code segment.



evlncrn8

then drx is not the way to go.. if you want to monitor a memory / code / whatever area, virtualprotect (PAGE_GUARD) + seh are most likely your best bet....

korte

ok.

detecting my problem.
My program not bad.

Error in dos loader.

program code segment size 40K, data segment size 40K

datasegment loading after code segment.
Dos loader writing some byte cs:fff0.
this address in my data area, my program crashed.

work around:
data segment inserting 20k 0

but uggly and ....


korte

dos loader writing 4 byte cs:0fffch.
writing my program entry point address (offset and segment)
But this area my program data area.

???????

MichaelW

For a COM file, after the loader has created a stack, it pushes a zero word onto the stack for compatibility with programs designed for early versions of MS-DOS (where a COM program could terminate itself by executing a near return with the stack in its initial state). Assuming the loader was able to allocate at least 64KB, SP would have been initialized to zero, and the pushed zero would end up at offset address FFFCh.
eschew obfuscation

evlncrn8

didnt realise post was for 16 bit... eew...
:dazzled:

what is it you're trying to do exactly?