interrupts, memory, etc. HELP..HELP..HELP!

interrupts, memory, etc. HELP..HELP..HELP!

Post by ANDRE BOY » Sat, 19 Nov 1994 21:12:57



I've set up a TSR (PASCAL) which uses an ISR to trap int 21h.
I then find out which sub-function is being accesses.
If it is to do with the movement through directories I check to see if someone
is trying to move into a directory they shouldn't. This is where the problem
appears.
The name of the directory is held in DS:DX. But how do I read this into a
string. I guess I use the MEM command, but how?
I need help!

Someone please help.

Thanks everyone!
(Andre)

 
 
 

interrupts, memory, etc. HELP..HELP..HELP!

Post by Bill Mitche » Sun, 20 Nov 1994 23:53:59



>I've set up a TSR (PASCAL) which uses an ISR to trap int 21h.
>I then find out which sub-function is being accesses.
>If it is to do with the movement through directories I check to see if someone
>is trying to move into a directory they shouldn't. This is where the problem
>appears.
>The name of the directory is held in DS:DX. But how do I read this into a
>string. I guess I use the MEM command, but how?
>I need help!

>Someone please help.

>Thanks everyone!
>(Andre)

A few words of warning first:
  If you are using a TSR - then you really shouldn't be doing any
  printing to the screen using any of TurboPascal's native routines;
  you should instead use "safe" BIOS-level functions.  (at least
  be CERTAIN to not use any DOS functions!)

Having said that; what you probably want is something like the following

VAR
    someString : ^String;
    realString : String;
    i          : Integer;
BEGIN
    seg(someString) := DS;
    ofs(someString) := BX;
    (* now note that the 'STRING' probably doesn't conform to Pascal's
       format of [length/data]
    *)
    i := 0;
    while (someString^[i] <> #0) do
      begin
        realString[i] := someString^[i];   (* manually stuff into string *)
        Inc(i);
      end;
    realString[0] := chr(i);    (* store the string length *)
END

Or something like that...   The important thing to remember is that when
you're talking about looking at a chunk of memory with Pascal; you're
going to have to use a pointer - and you're going to have to change the
segment/offset of that pointer yourself to match the section of memory
you want to look at..

Oh!  Another method you could use would be:
VAR
    RealString  : String;
    WorkBX      : Word;                 (* increment BX *)
BEGIN
    WorkBX := BX;
    RealString := '';
    while (mem[DS:WorkBX]<>0) do
      begin
        RealString := RealString + chr(mem[DS:WorkBX]);
        Inc(WorkBX);
      end;
END;

(In which case you're using the function 'mem' to traverse the string
 in memory and stuff it into your local storage...)

Hope this helps...  (My knowlege of TP is a little old - there might be
more modern ways of doing this!)

Cheers!

--
Bill Mitchell                       |                    Email for PGP-key


 
 
 

1. interrupts, memory, etc. I NEED HELP!

Can anyone tell me how to read a variable which is a string from memory at
DS:DX. This will most probably have to use the MEM command, but how?
MEM will give me a BYTE type result. This must then be converted to a CHAR and
then subsequently to a string.
But EMM386 constantly throws up error messages!
WHY?

What am I doing wrong?

Someone please help me!?!

Thanks a lot!
(Andre)

2. ASQ Advice Please

3. ....................BIOS Problems ? HELP HELP HELP HELP HELP

4. Cannot install policy inside CheckPoint Firewall Cluster in AIX

5. DOS/Windows95 Help/Links, etc (LF) at the "DOS and Windows Help" Pages!

6. Non existent addresses in our domain name ...

7. Watch your financial worries disappear forever.Earn $100 - $500 daily

8. DOS/Windows Help/Links, etc (Lo) at my help pages....

9. DOS/Windows95 Help/Links, etc (LF) at the "DOS and Windows Help" Pages!

10. DOS/Windows Help/Links, etc (Lo) at my help pages....

11. DOS/Windows95 Help/Links, etc (Lo) at my help pages....

12. DOS/Windows Help/Links, etc at my help pages....