Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > MSDOS Programmer > =?iso-8859-1?q?...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 433 of 494
Post > Topic >>

=?iso-8859-1?q?Read_another_program=B4s_memory?=

by "gerotica" <pgerotica@[EMAIL PROTECTED] > Dec 7, 2006 at 04:27 AM

Ok.
I need to read a block of memory from another program every time this
program reachs a certain location in its code. I dont have its source
code so my idea is to write a isr (60h) and change the location i want
to be warned to cd 60. Here is the piece of the program=B4s code
disassemled. THE location is 071a:0d3c:

071A:00000D37 50                     PUSH    AX
071A:00000D38 51                     PUSH    CX
071A:00000D39 52                     PUSH    DX
071A:00000D3A 56                     PUSH    SI
071A:00000D3B 57                     PUSH    DI
071A:00000D3C 33 DB                  XOR     BX,BX        <<<<LOCATION
071A:00000D3E B9 F0 03               MOV     CX,03F0           Change
it to CD 60
071A:00000D41 BA 83 07               MOV     DX,0783
071A:00000D44 B3 03                  MOV     BL,03
071A:00000D46 E8 E7 00               CALL    (+00E7)
071A:00000D49 8A 1C                  MOV     BL,[SI]
071A:00000D4B E8 E2 00               CALL    (+00E2)
;071A:00000E30
071A:00000D4E 02 FB                  ADD     BH,BL
071A:00000D50 46                     INC     SI
071A:00000D51 E2 EE                  LOOP    (-12)
;071A:00000D41
071A:00000D53 5F                     POP     DI
071A:00000D54 5E                     POP     SI
071A:00000D55 5A                     POP     DX
071A:00000D56 59                     POP     CX
071A:00000D57 58                     POP     AX
071A:00000D58 C3                     RET

071A:00000E30 50                     PUSH    AX
071A:00000E31 53                     PUSH    BX
071A:00000E32 51                     PUSH    CX
071A:00000E33 52                     PUSH    DX
071A:00000E34 E8 C5 FF               CALL    (-003B)
;071A:00000DFC
071A:00000E37 E8 9F FF               CALL    (-0061)
;071A:00000DD9
071A:00000E3A BA 80 07               MOV     DX,0780
071A:00000E3D EC                     IN      AL,DX
071A:00000E3E A8 08                  TEST    AL,08
071A:00000E40 74 F5                  JZ      (-0B)
;071A:00000E37
071A:00000E42 A8 02                  TEST    AL,02
071A:00000E44 75 F1                  JNZ     (-0F)
;071A:00000E37
071A:00000E46 BA 83 07               MOV     DX,0783
071A:00000E49 8A C3                  MOV     AL,BL
071A:00000E4B EE                     OUT     DX,AL
071A:00000E4C 5A                     POP     DX
071A:00000E4D 59                     POP     CX
071A:00000E4E 5B                     POP     BX
071A:00000E4F 58                     POP     AX
071A:00000E50 C3                     RET

Analysing this piece I see that SI points data in the buffer. At that
location, SI is already set to the correct address. My question is what
do i have to do to have that address in my isr? I tried this:

void interrupt int60(void)
 {
  void *pt;
  unsigned ids, isi;

  asm{
   mov ax, word ptr[bp+6];
   mov ids, ax
   mov ax, word ptr[bp+4];
   mov isi, ax;
  }

   pt =3D MK_FP(ids, isi);

  ......

  asm mov word ptr[bp+14], 0x61;  //To satisfy bx value in the main
program
}
I know those stack locations are correct because I disassembled my isr
code and saw the pushes and pops.

My knowledge in 8086 assembly is limited, and probably im wrong about
the registers Im using. If someone could help me I=B4d appreciate very
much.




 1 Posts in Topic:
=?iso-8859-1?q?Read_another_program=B4s_memory?=
"gerotica" <  2006-12-07 04:27:42 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon May 12 8:29:00 CDT 2008.