home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / seedump.zip / SAMPLES / R7.BAG < prev    next >
Text File  |  1995-08-18  |  990b  |  50 lines

  1. /* */
  2. trace o
  3. p1 = "aaa10"
  4. struct "dum"
  5.  
  6. if ( struct.1 = "STRUCT.1" )
  7. then do
  8.   say "No structure found with the name dum"
  9.   exit 1;
  10. end
  11.  
  12. say struct.1
  13. parse value struct.1 with a b slen .
  14. globvar p1
  15. addr = d2x(rc)
  16. slen=  d2x(slen)
  17. say p1 " at " addr " length "slen
  18.  
  19. Fetchaddr addr slen
  20. data = rc
  21. do until addr=0
  22.    Fetchaddr addr slen
  23.    data=rc
  24.    do i=0 to struct.0
  25.      parse value struct.i with a b c .
  26.      if a == "next" then do
  27.         addr = intel(data,b,c)
  28.      end
  29.      if a == "nn" then do
  30.         if substr(data,b+1,7) = "nntext1" then
  31.         do
  32.           say '>>'a 'at ' b ' name is 'substr(data,b+1,c)
  33.           sform( addr, data )
  34.           return 0
  35.         end
  36.      end
  37.    end
  38.    addr=c2x(addr)
  39. end
  40. return 0
  41.  
  42. sform: procedure expose struct.
  43.    say c2x(arg(1))
  44.    do i=2 to struct.0
  45.       parse value struct.i with a b c .
  46.       if substr(a,1,4) <> 'rest' then
  47.         say a " : " c2x(substr(arg(2),b+1,c ))
  48.    end
  49. return 0
  50.