home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / FINDSEG.ZIP / INSTRUC.TXT < prev    next >
Text File  |  1992-06-03  |  9KB  |  193 lines

  1. FINDSEG.EXE  Ver. 1.33  1992/03/18
  2. (C) Copyright IBM Corp, 1990,1991,1992.    IBM Internal Use Only
  3. Written by Takaaki Nonaka (JL08928 at YMTVM1)
  4.  
  5. 0. About 32bit applications support
  6.  I planed to make a new FINDSEG for OS/2 V2 32bit applictions. But OS/2
  7.  displays TRAP-D module name in TRAP-D dialog panel from dirver 6.304E. So
  8.  I decided to enhance FINDSEG only for OS/2 V1.X 16 bit applications.
  9.  
  10. 1. Why FINDSEG.EXE was made.
  11.  Our department developed a large application system which runs under OS/2.
  12.  It consists of many EXEs and DLLs. After shipment, some TRAP-Ds were reported
  13.  from customers. The information about them were only register values in TRAP-D
  14.  pop-up panel. And some of the problems didn't occur under our environment
  15.  because the problem depended on timing or memory size. So we had to find out
  16.  the module where TRAP-D occurred from the information of TRAP-D panel only.
  17.  "FINDSEG" was made for this reason.
  18.  
  19. 2. How to use FINDSEG.EXE
  20.  This program searches the specified segments from executable files.
  21.  The key word for this search is the length of a segment.
  22.  
  23.                          +-            -+
  24.  Usage: findseg ╒switch■ |╒drive:■╒path■|
  25.                          |╒UNC name■    |
  26.                          +-            -+
  27.  
  28.  switch:
  29.       1.Segment type
  30.           -c : Report code segments only.
  31.           -d : Report data segments only.
  32.           -b : Report code and data segments.
  33.               These three switches can't be set two or three at once.
  34.               If you do so, the last switch will be effective.
  35.               None of those is set, this program searches the specified
  36.               segments from code and data segments. (i.e. default is -b)
  37.  
  38.       2.Segment length
  39.           -l : The string after this switch is the length of the target
  40.                segment. If the length is specified as HEX format, it must
  41.                start with X (or x). Spaces aren't allowed between -l and
  42.                the string. If the string is 0 (or x0) the length is 65536.
  43.                If this switch isn't set, all segments will be reported.
  44.           -r : Report the segments whose length are between LENGTH - DELTA
  45.                and LENGTH + DELTA. (LENGTH is the specified length by -l
  46.                and DELTA is the specified length by this switch.)
  47.                Default is -r1.
  48.  
  49.       3.File type
  50.           -E : Search EXE and COM files.
  51.           -D : Search DLL, ISF and DRV files.
  52.           -S : Search SYS files only.
  53.           -B : Search EXE, COM, DLL, ISF and DRV files.
  54.           -F : Search the specific files. The file names after this switch
  55.                will be searched. These file names are separated by comma. And
  56.                wildcard characters are permitted. Spaces aren't allowed between
  57.                -F and the string.
  58.                ex. -F*.OS2,PM*.DDD     (for *.OS2 and PM*.DDD)
  59.               You may set two or more switches form these.
  60.               Default is -E -D -S.
  61.  
  62.       4.Access rights byte
  63.           -A : The string after this switch is the access right byte of
  64.                the target segment. If it is specified as HEX format, it must
  65.                start with X (or x). Spaces aren't allowed between -A and
  66.                the string.
  67.                PRESENT, ACCESSED and EXPANSION DIRECTION(data segment) bits
  68.                will not be tested.
  69.                This access rights byte is displayed as **ACC=?? in the TRAP-D
  70.                popup panel.(**:CS, DS, SS, ES, ER, ??:Access rights byte)
  71.  
  72.       5.Disassemble
  73.           -I : Output disassembled code. The string after this switch is the
  74.                IP value. If it is specified as HEX format, it must start with
  75.                X (or x). Spaces aren't allowed between -I and the string.
  76.                This switch is valid for CODE segments.
  77.                In this disassembled code, the relocation information is not
  78.                resolved.
  79.  
  80.       6.Miscellaneous
  81.           -p : Pause after a screen is full. This switch is ignored when
  82.                OUTPUT is redirected to a file.
  83.           -s : Search from sub-directories.
  84.  
  85.  drive    : Drive name. Default is the current drive.
  86.  path     : Path name. Default is the current path.
  87.  UNC name : Universal naming convention name. \\server name\net work name╒\path■
  88.  
  89.  
  90.  Example: findseg -lx6000 -rx1000 -s -D -Ix400 C:\
  91.           This searches DLL files from a root and its all sub-directories in
  92.           drive C. And it reports file names and length and attribute of
  93.           segments whose size are between 0x5000 and 0x7000 bytes.
  94.           They are output in the following format.
  95.  
  96.       Search path  : C:\ and its sub-directories
  97.       Search file  : *.DLL
  98.       Search range : 0x05000(20480)-0x07000(28672) bytes
  99.       Access rights: not specified
  100.  
  101.       C:\MYDLL\TEST.DLL
  102.           12610bytes    90-05-10    15:25:00
  103.       004 05200 DATA FIXED   NONSHARED PRELOAD    R-O NORELOC PL3 DISCARDABLE
  104.  
  105.       C:\OS2\DLL\PMGPI.DLL
  106.          265110bytes    90-03-30    01:20:00
  107.       002 05FCC CODE MOVABLE NONSHARED LOADONCALL E/R RELOC   PL2 NONDISCARDABLE
  108.         Instruction: push     es:╒bx+si■
  109.  
  110.       C:\OS2\DLL\OS2SM.DLL
  111.            64512bytes    90-03-30    01:20:00
  112.       001 05789 CODE MOVABLE NONSHARED PRELOAD    E/R RELOC   PL3 NONDISCARDABLE
  113.         IP is invalid value.
  114.  
  115.       C:\OS2\DLL\DISPLAY.DLL
  116.           342016bytes    90-03-30    01:20:00
  117.       002 067DE CODE MOVABLE SHARED    PRELOAD    E/R RELOC   PL2 NONDISCARDABLE
  118.         IP is invalid value.
  119.       00A 050BE DATA MOVABLE SHARED    PRELOAD    R/W NORELOC PL2 NONDISCARDABLE
  120.  
  121.       5 segments in 4 files
  122.  
  123.  
  124.  Note : Meaning of each value is as follows.
  125.  
  126.      C:\OS2\DLL\PMGPI.DLL <--- File name
  127.         265110bytes    90-03-30    01:20:00   <--- File size and update time
  128.      001 05FCC CODE MOVABLE NONSHARED LOADONCALL E/R RELOC   PL2 NONDISCARDABLE
  129.      (1)  (2)   (3)   (4)     (5)       (6)      (7)   (8)   (9)       (10)
  130.        Instruction: push     es:╒bx+si■  <-- Disassembled code at IP=0x400
  131.  
  132.      (1) : Entry id in segment table
  133.      (2) : Minimum allocation size for the segment
  134.      (3) : Segment type (CODE/DATA)
  135.      (4) : Fixed or Movable segment
  136.      (5) : Shared or Nonshared segment
  137.      (6) : Preload or Load on call segment
  138.      (7) : Execute/read or Execute-only if code, Read/Write or Read-only if data
  139.      (8) : Relocation table present or not
  140.      (9) : Privilege level
  141.      (10): Discardable or Nondiscardable segment
  142.  
  143. 3. Hints to find out TRAP-D module
  144.  To search TRAP-D module, you had better set CSLIM value in TRAP-D panel as
  145.  segment length(-l switch) rather than DSLIM, ESLIM or SSLIM because data
  146.  segments(DS, ES, SS) might be allocated or reallocated after the process
  147.  started.
  148.  
  149.  You had better set IP value(by -I switch). When two or more modules are found,
  150.  you can determine TRAP-D module from disassembled code. For example, TRAP-D
  151.  may not occur on the following instructions
  152.          mov   ax, 0
  153.          inc   cx
  154.             :
  155.          etc.
  156.  and the following instructions have potential of TRAP-D (or TRAP-C).
  157.                                       TRAP-D occurs on the following condition.
  158.          pop   ax                <--- sp exceeds SSLIM (In this case TRAP-C
  159.                                       will occur).
  160.          les   bx, es:╒bx+si■    <--- bx+si exceeds ESLIM or ES is invalid
  161.          rep   movs              <--- si exceeds DSLIM or di exceeds ESLIM
  162.             :
  163.          etc.
  164.  
  165. 4. Requirements and comments.
  166.  If you have some bug reports, comments or requirements, please send note to
  167.  JL08928 at YMTVM1.
  168.  
  169. 5. About disassemble function.
  170.  I use DIS386 package(version. 1.1) on PCTOOLS for disassemble function.
  171.  I could not add this disassemble function to FINDSEG.EXE without it.
  172.  The owner of this package is R.K. Abrams (ROGER at RALVM0).
  173.  
  174. 6. History
  175.  Ver 0.00   90/04/19       Initial.
  176.  Ver 0.01   90/04/23       Change default of search range to -r1.
  177.  Ver 0.02   90/06/06       Add search "OS2KRNL*.*"
  178.  Ver 0.03   90/06/14       Add check access rights byte
  179.  Ver 0.04   90/08/24       Add file size and date
  180.  
  181.  Ver 1.00   90/08/24       Release to OS2TOOLS
  182.  Ver 1.10   90/10/22       Add disassemble option
  183.  Ver 1.10A  90/12/03       Minor bug fix (output format)
  184.  Ver 1.10B  90/12/03       Bug fix. (file timestamp was wrong under OS/2
  185.                                      Ver 1.2)
  186.  Ver 1.20   90/12/11       Change a default help message to short version.
  187.                            Release to ESDTOOLS. ESDTOOLS version does not
  188.                            have disassemble function.
  189.  Ver 1.30   91/01/25       Change to accept UNC name
  190.  Ver 1.31   92/02/18       Add search "*.IFS and *.DRV"
  191.  Ver 1.32   92/03/12       Add search the specific files.
  192.  Ver 1.33   92/03/18       Bug fix. (Trap-D occurs when -F switch is not set.)
  193.