home *** CD-ROM | disk | FTP | other *** search
/ Beijing Paradise BBS Backup / PARADISE.ISO / software / CRACK / TR195.ZIP / README.ENG < prev    next >
Encoding:
Text File  |  1997-10-21  |  25.2 KB  |  791 lines

  1.                           README OF TR
  2.                           ============
  3.  
  4.                     - Translated by Che Ming -
  5.  
  6.    If you have used DEBUG,SYMDEB,TD(TURBO DEBUG),CV(CODE VIEW) OR
  7. SoftICE, You should try TR which has more powerful functions than
  8. debuggers mentioned above.
  9.  
  10.    TR(tracer) is a debugger which based on the simulation CPU technology.
  11.  
  12.    The main features are:
  13.  
  14. 1. Interpret Mode
  15. =================
  16.  
  17.   TR runs a program by interpret its code as the same as it is run under
  18.   a REAL Intel CPU. Yes, TR is just like a CPU. TR can understand every
  19.   CPU code and do it correctly, need no INT1, INT3, DR0-DR8, or protect
  20.   mode. Theorytically, TR will never be found by any program which is
  21.   traced, and you can never find a program can't be traced :-)
  22.  
  23.   When a program runs, it must be interpreted by CPU! TR can understand
  24.   all codes CPU understands. TR will imagine what CPU will do at that
  25.   time, and do it just well.
  26.  
  27.   Traditional debuggers or tracers have too many shortages:
  28.  
  29.   (1) Using INT1 and TF(trap flag) 
  30.       
  31.       Because they use INT1 and TF to step the program, so it's so easy
  32.       to cheat and detect it!
  33.  
  34.   (2) Using INT3 
  35.   
  36.       They must insert code INT3(CCh) into user's code. If the program
  37.       destoried the INT3 vector or tested themselves, the tracer would not
  38.       work well :-(
  39.  
  40.   (3) SoftICE doesn't use above two methods, but use 386 hardware
  41.       interrupt instead. SoftICE is very strong but so easy to be
  42.       found :(
  43.  
  44.   Overall, traditional debuggers & tracers trace the program use standard
  45.   tracing methods which can be found in INTEL's CPU manual. They could
  46.   only trace those programs which have no any anti-debug code. If the
  47.   program won't cooperate, they all cannot work well :-( But TR will
  48.   trace all the programs that CPU can deals with, even another TR
  49.   session.
  50.  
  51.   On the other hand, traditional debuggers or tracers are simply insert a
  52.   breakpoint into the program and GO it, all remain work is waiting for
  53.   the control back. They don't know whether the control would be back
  54.   or what the program intent to do. TR run the program in interpret mode,
  55.   it controls all things absolutely. Just because of it, TR can set more
  56.   and more complex breakpoints.
  57.  
  58.   Interpret Run is the main difference between TR and all other
  59.   debuggers, and also is why TR has high-performance.
  60.  
  61. 2.Batch File
  62. ============
  63.  
  64.   Although batch is not a new word to you, but you can find no one use it
  65.   in a debugger. In TR, you can put all your commands in a text file and
  66.   do it just like you execute the DOS batch file.TR also has a special
  67.   batch file named "AUTORUN.TR". Just like its name, this file can be
  68.   executed automatically every time you start TR.
  69.  
  70. 3.Magic Offset
  71. ==============
  72.            
  73.   Everyone is similar with "G 100" command which means run and stop at
  74.   address CS:100. In general, the debuggers do it as this: insert a
  75.   breakpoint(INT3/CC) at CS:100 and GO the program, so when CPU meets the
  76.   INT3, the program will be stopped. So,the debuggers can only set a
  77.   breakpoint at current CS and offset 100! But, the important, TR not
  78.   work like this. TR can stop the program at every offset 100! What does
  79.   it mean? It means when IP=100, the program will be stopped! We call
  80.   this Magic Offset. What does it use? Too many! Think by yourself :-)
  81.   One simplest and direct usage is use "G 100" you can *UNPACK* all .COM
  82.   files!
  83.  
  84. 4.Assembly Language Command
  85. ===========================
  86.  
  87.   It's a good idea that you can use ASM opcode in your debug environment.
  88.   You can accomplish your wish in TR! You may use either "R AX 001A" or
  89.   "MOV AX, 001A". Both do the same thing. Remember all Assembly opcode
  90.   can be use in TR, e.g. "CLI", "MOV [WORD 1234], 4567", "IN AL,21"...
  91.  
  92.  
  93. 5.Add Comments During Tracing
  94. =============================
  95.  
  96.   "CALL 7FDE" is not good as "CALL OPEN_FILE". But most tracers must face
  97.   many these opcode. Even if you have known what the procedure would do,
  98.   you could only write it down into the paper. Now TR can write your
  99.   comments direct into the program and saved them into anoter file
  100.   automatically. So, all programs is easy for understand. TR can also
  101.   display the comments for most INT21 function call automatically for
  102.   you.
  103.  
  104. 6.Automatic Jump
  105. ================
  106.  
  107.   Many protecters use many JMP codes to make the program under thier
  108.   protection unreadable. In most situation, you can only see some JMPs in
  109.   code window, but at the target address, in general, you can't see the
  110.   correct disassemble opcode because the protect programs likely insert
  111.   some DATA in front of that address, so, it's difficult to understand
  112.   these programs. With Automatic Jump feature, TR displays the correct
  113.   code at the JMP address in code window instead of displaying a "JMP
  114.   xxxx". So you can see the correct codes sequence but not lots of JMP!
  115.   So, the code is easy to read!
  116.    
  117.  
  118. 7.Log
  119. =====
  120.  
  121.   TR could save all CS:IP it interpret-run. This makes it possible to
  122.   analyise program easily. If the program get error, you can find the
  123.   problem by backtrace your LOG. Command 'LOGPRO' can get all the key
  124.   opcode program run. The program will have no secret after you LOG it.
  125.   Refers to command: LOG, LOGS, VLOG, LOGPRO
  126.  
  127. 8.Write EXE file from memory
  128. ============================
  129.  
  130.    Although you can find many universal unpackers on the net, but what
  131.    would you do if they told you "I can't unpack it"? Unpack function
  132.    should be in debuggers. TR's MKEXE function let you make EXE file
  133.    easy!
  134.  
  135. 9.Various Complex breakpoints, OneTime breakpoints
  136. ==========================================
  137.  
  138.   All other debuggers' breakpoint are what INTEL prepared. They cannot
  139.   fit the need of modern trace technology. TR has many revolutionary
  140.   breakpoint:
  141.  
  142.    (1) BP conditions
  143.        Conditional break-point. ex.:
  144.        
  145.        BP IP>4000 
  146.        BP ah=2 dl=80 ch>30
  147.  
  148.    (2) BPINT intnum [conditions]
  149.        Interrupt break-point.
  150.        
  151.    (3) BPXB bytes [conditions]
  152.        Break-point if encounter ??? code. For example, "MOV AX,????" 
  153.        in HEX code is "B8????", you can use
  154.   
  155.        BPXB b8
  156.        
  157.        to break all "mov ax,????" opcode. Other:
  158.        
  159.        BPXB cd          ;all interrupt
  160.        BPXB 33 c0       ;xor ax,ax
  161.  
  162.    (4) BPREG REG|SEG [conditions]
  163.        Break-point if given register change. You can use
  164.  
  165.        BPREG cs
  166.  
  167.        to get all code segment change(jmp far,retf...). Also you can
  168.        use something like
  169.  
  170.        BPREG cs ax=0 es=#    ;# means PSP seg
  171.  
  172.        to get the kernel of a shelled program.
  173.  
  174.    (5) BPM [seg:]offset
  175.        Break-point if access specified memory.
  176.  
  177.        BPM 20
  178.  
  179.        will stop at 'mov ax,[20]'.
  180.  
  181.    (6) BPW SEG:OFFSET
  182.        Break-point if memory change. Some opcode's changing memory
  183.        could only be found by repeatedly compare.
  184.  
  185.    (7) BPIO port [conditions]
  186.  
  187.    (8) BPKNL [count]
  188.        Break-point to find new program kernel.
  189.  
  190.   The most important is, if you only use one break-point onetime,
  191.   you can change the break-point command 'BP???' to 'GO???' to run.
  192.   By using this one-time break-point, ???ly you need not to set any
  193.   break-point.
  194.  
  195.   These break-point function make it more and more easy to track a
  196.   program. You need not to do any hard work!
  197.  
  198.   TR is a real tracing,tracking,debug program. We have DEBUG,SYMDEB,
  199.   TD,CV,S-ICE, but they are all not a real tracing debug program.
  200.   DEBUG & SYMDEB isn't, because I think a real debug software should
  201.   be full screen. TD cannot process command line input. No mouse
  202.   clicks could replace a command line like 'F CS:DX,DX+CX 00'. In
  203.   DEBUG you can use 'L 100 0 0 1' to check floopy boot, and use 
  204.   'L 400' or 'W 400' to load a program to memory or write memory to
  205.   file. In SYMDEB you could use '>' to save the unassemble result.
  206.   All these useful functions cannot be found in other debug program.
  207.   I think TD & CV are not standalone debug program. They just debug
  208.   their C program. S-ICE is great! But it seem look like that 386CPU's
  209.   debug function is for S-ICE, and S-ICE is just for demo of this
  210.   function. Only TR do what you think, rise 9 great new ideal in 
  211.   tracing technology, for the first time make TRACING a easy work.
  212.   TR is a real tracing debug program!
  213.  
  214.   All the time I work hard to make TR perfect. TR make progress
  215.   everyday. Please contact with me, you can get the lastest version.
  216.  
  217.         My name : Liu Taotao
  218.         Address : AnYang Henan, China
  219.         Tele    : 0372 3932916 2273
  220.         Email   : ayliutt@hotmail.com
  221.               ayliutt@nease.net
  222.         HomePage: http://www.nease.net/~ayliutt
  223.         ICQ UIN : 3434573
  224.  
  225.                 1997.10.21
  226. ---------------------------------------------------------------------
  227.             Preface
  228.     1. If you use TR to trace a program having Turbo Debug infor-
  229. mation, you can use 'g _main' to begin.
  230.     2. Support 32bit register. Refers command: R32
  231.     3. After TR terminate, all int vectors hooked by user program
  232. will be restored, all memory freed.
  233.     4. TR can auto use XMS to free more convetion? memory.
  234.     5. All num input are hex.
  235.  
  236. TR needs 80386 CPU or above to run. TR can run under simple DOS,
  237. WINDOWS or WINDWOWS 95 dos box ( but will be even slow ), with
  238. himem.sys or emm386.exe or any other XMS/EMS memory manager programs.
  239. TR can work with Soft-ICE. TR can only trace DOS programs running
  240.  in real mode. TR know nothing about Protect Mode or Windows programs.
  241.  
  242. ---------------------------------------------------------------------
  243.         TR's Screen
  244. EAX=00003000  EBX=00000000  ECX=00000000  EDX=00002755  SP=007E
  245. EBP=00000000  ESI=00000000  EDI=00000000  FS=0000  GS=0000
  246. DS=2640  ES=2640  SS=2785  CS=2650  IP=000A  o d I s z a p c t
  247. 2640:0000  CD 20 FF 9F 00 9A F0 FE-1D F0 1E 44 FD 07 6D 01  ............
  248. 2640:0010  13 06 78 01 13 06 13 06-01 01 01 00 02 FF FF FF  ..x.........
  249. 2650:0000  BA5527          MOV       DX,2755
  250. 2650:0003  2E89168B02      MOV       [CS:DGROUP@],DX
  251. 2650:0008  B430            MOV       AH,30
  252. 2650:000A  CD21            INT       21 Get MS-DOS Version Number
  253. 2650:000C  8B2E0200        MOV       BP,[0002]
  254. 2650:0010  8B1E2C00        MOV       BX,[002C]
  255. 2650:0014  8EDA            MOV       DS,DX
  256. 2650:0016  A37D00          MOV       [007D],AX
  257. 2650:0019  8C067B00        MOV       [__psp],ES
  258. 2650:001D  891E7700        MOV       [__envseg],BX
  259. 2650:0021  892E9100        MOV       [0091],BP
  260. 2650:0025  E85101          CALL      0179
  261. 2650:0028  A17700          MOV       AX,[0077]
  262. 2650:002B  8EC0            MOV       ES,AX
  263. 2650:002D  33C0            XOR       AX,AX
  264. Super Program Trace (test version), Written by Ld. 06/16/97
  265. Press '?' for Help
  266. r32
  267.  
  268.  Welcome !!!   Tel:0372-3932916-2273   EMAIL: ayliutt@hotmail.com
  269.  
  270.   This is TR's typical screen, consist of register area,memory area,
  271. code area,command line area and status line.
  272.  
  273. 1. register area
  274. Register area ia at the top of the screen. The default mode is 16-bit
  275. register display. You can use 'R32' command to change to 32-bit 
  276. register display mode.
  277. Use 'R' command to change value of register:
  278.          R AX 1234
  279.          R ebx 12321456
  280.          R ch 87
  281.          R dl ah
  282.          R ip ip+1
  283.          R fl z
  284. Use 'ODISZAPCT' to change the flag register. All changed register are
  285. display in different color.
  286.  
  287. 2. Memory area
  288. In memory area, data are displayed in HEX and ASCII mode. You can use
  289. 'E' command to edit data in memory area, and use left,right,up,down,
  290. pgup,pgdown key to move cursor. Key <tab> to change between HEX and
  291. ASCII area.
  292. Use 'WD num' the change memory area's lines.
  293.  
  294. 3. Code area
  295. Code area display program's code, assembly language,labels and comments.
  296. Auto comment some frequently used interrupt functions.Support 386 opcode
  297. to unassemble.
  298.  
  299. 4. Command area
  300. Use to key in TR command.
  301. If you want to do one command repeatly, move to that line and press <enter>.
  302.  
  303. 5. Status line
  304. Display some status information.
  305.  
  306. 6. Other 
  307. You can use <F4> to display user's screen, VIEW command to view file,
  308. STACK command to view the stack information,VLOG command to view log 
  309. information, etc.
  310. --------------------------------------------------------------------------
  311.             KEYS
  312.     <F8>     one step, same as command 'T'
  313.     <F10>     one procedure, same as 'P'
  314.     <F4>    user screen, same as 'RS'
  315.     <F6>    command area <-> code area
  316.     <F7>    if cursor in code area, run to here
  317.     <F5>    zoom current area
  318.     <F9>    set break-point
  319.     Ctrl+D    pause program's run. Attention: TR will only stop at user
  320.         program's code, not system code. So sometimes TR will not
  321.         return in time after you press <Ctrl+D>.
  322. --------------------------------------------------------------------------
  323.         Symbols
  324. <$>:
  325.     In TR's command, you can use '$' to mean current CS:IP.
  326.  
  327. <*>:
  328.     means current opcode's process memory address. If current opcode
  329.     is 'Mov ax,[di]', then '*' means DS:DI and 
  330.         D *
  331.     is just same as
  332.         D ds:di
  333.  
  334. <@>:
  335.     get address. if
  336.         1234:5678 11 22 33 44
  337.     then '@1234:5678' means 4433:2211. If TR just enter a CALL FAR or
  338.     INT, you can use 'G @ss:sp' to go back.
  339.  
  340. <#>:
  341.     means current PSP. For example:
  342.         D #:0
  343.  
  344. <;>:
  345.     In a command line, all characters after ';' are no use.
  346.  
  347. AUTORUN.TR
  348.     Every time TR begin, TR will do 'autorun.tr' automatically. Insert
  349.     your allways-use command in file 'autorun.tr' such as 'R32', 'AUTO
  350.     INT1 on'.
  351. ---------------------------------------------------------------------------
  352.         change TR's setting
  353.  
  354. COLOR [01 02 03 04 05 06 07 08 09 10]
  355.     If run without parameter, it will display TR's current color set.
  356.     Parameter must be 9 which mean:
  357.         1.register area        register color
  358.         2.register area        register value color
  359.         3.register area        changed register
  360.         4.code area        normal code
  361.         5.code area        current CS:IP
  362.         6.code area        label or comment
  363.         7.code area        break point
  364.         8.command area        normal command
  365.         9.command area        comment
  366.         10.status line
  367.     for example:    color 7 b e 7 e 2 4 17 36 76
  368.  
  369. MSG [x y]
  370.     display message window. Used in TR's demo. All next lines are 
  371.     message until blank. X,Y is the position of message windows,
  372.     -1 means up-right corner, -2 center.
  373.  
  374. VER
  375.     version info.
  376.  
  377. R32
  378.     switch register area between 32-bit mode and 16-bit mode.
  379.  
  380. REDRAW
  381.     Redraw screen.
  382.  
  383. WD [lines]
  384.     set lines of memory area.
  385. ------------------------------------------------------------------------
  386.         I/O Commands
  387.  
  388. A [address]
  389.   assembly. You can use 'BEGIN:' in 'A' command to define a label!
  390.     A cs:0
  391.         start:        ;define label
  392.         mov ax,bx    ;any asm code
  393.                 ;return to command mode
  394.  
  395. D [address|range] [>filename]]
  396.     display data in hex and ASCII mode, '>' to write output to file.
  397.             D cs:ip
  398.         D *
  399.         D 1234:5678>myfile.txt
  400.         D cs:0lffff>file
  401.         D >file
  402. E [[ptr] bytes]
  403.     edit data. Command 'E' with no parameter will move cursor to 
  404.     memory area. Then you can use direction keys to move cursor, <tab>
  405.     from HEX to ASCII mode. Default segment is DS.
  406.         E cs:0 12 23 45 'abc'
  407.         E b800:200 36 24
  408.         E 234 'def',0d,0a,'$'
  409.  
  410. F range bytes
  411.     Fill memory with data.
  412.         F cs:0,ffff 12 23 45 'abc'
  413.         F b800:0L200 36 24
  414.         F 234 'def',0d,0a,'$'
  415.  
  416. L [[SEG]:OFFSET] [FILENAME]
  417.     Load file to memory.
  418.             N c:\autoexec.bat
  419.         L 100
  420.         L DS:300 MYFILE.BIN
  421.  
  422. L [SEG]:OFFSET DRIVE STARTSECTER SECTERS
  423.     Load sectors from disk.
  424.  
  425. N [filename]
  426.     Set or display current filename. Refers: W,L,RELOAD.
  427.  
  428. RELOAD [filename]
  429.     reload file, reset all register, memory, interrupt vector.
  430.  
  431. U [address|range] [>filename]]
  432.     unassemble,'>' to write output to file.
  433.         u cs:ip
  434.         u $
  435.         u 1234:5678>myfile
  436.         u cs:0lffff>file
  437.         u >file
  438.  
  439. W
  440. W [SEG]:OFFSET
  441. W [SEG]:OFFSET filename
  442. W [SEG]:OFFSET length filename
  443.   write memory to file, filelength BX:CX or <length. Default segment
  444.   DS, default address DS:100. example:
  445.         N test.com
  446.         W 200
  447.         W es:300 myfile.com
  448.         W cs:ip dx test.com
  449.  
  450.  
  451. W [SEG]:OFFSET DRIVE STARTSECTER SECTERS
  452.     Write sectors to disk.
  453.  
  454. WREG filename
  455.     write register area to file.
  456.  
  457. WMEM filename
  458.     write memory area to file.
  459.  
  460. WCOD filename
  461.     write code area to file.
  462.  
  463. WCMD filename
  464.     write command area to file.
  465.  
  466. ---------------------------------------------------------------------------
  467.         RUNTIME commands
  468. DELAY [time]
  469.     use in batch file to delay. You'd better add 'DELAY 0' at the end
  470.     of batch file to restore delay status.
  471.  
  472. DO filename            *new idea*
  473.     do a batch command file. You can insert all TR's command in a file
  474.     and DO it. If a command line begin with ' ', it will not be displayed
  475.     in command area.
  476.  
  477. KEY num
  478.     use in batch file to simulate keyin. The given key num is what
  479.     returned by 'MOV AX,0\INT 16'. For example:
  480.         KEY 1C0D    ;means <enter>
  481. ---------------------------------------------------------------------------
  482.         Other commands
  483. all assemble opcode
  484.     TR support all assemble opcode as command.
  485.  
  486. define label or procedure name
  487.     input a string followed by a ':' to define label or procedure name.
  488.  
  489. .
  490.     means 'U cs:ip' or 'U $'.
  491.  
  492. ? [expresion]
  493.     Help.
  494.         ? ax    
  495.         ? cx+dx    
  496.         ? #    
  497.         ? @0:21*4
  498.         ? $+5    
  499.  
  500. CMT [SEG:]OFFSET COMMENT_STRING        *new idea*
  501.     make comment. All comments and label names will be saved in
  502.     'filename.cmt'. For example:
  503.             cmt cs:200 'This is my comment string'
  504.         PROC1:
  505.  
  506. LABEL [SEG:]OFFSET LABEL_NAME      *new idea*
  507.     define label or procedure name. for example:
  508.             LABEL cs:200 file_open
  509.  
  510. LOG [ON|OFF]                    *new idea*
  511.     If save log. If LOG ON, TR will save the CS:IP executed and you
  512.     can use VLOG to view it.
  513.  
  514. LOGS [ON|OFF]                    *new idea*
  515.     If save log. If LOGS ON, TR will save the CS:IP executed to file
  516.     'log.dat'.
  517.  
  518. LOGPRO [0|1|2|f]                    *new idea*
  519. ----------------
  520.   This function can log all key opcodes a program run. You can
  521.   analysis it later. Especially usefual to compare a GOOD running
  522.   path with a ERROR running path.
  523.  
  524.   Each parameter means:
  525.     0:    do not LOG
  526.     1:    only LOG 'CALL' and 'RET'
  527.     2:    only LOG 'CALL','RET',condition jmp,'JMP FAR'
  528.         Note: Only true condition jmp will be loged.
  529.     f:    LOG all opcode
  530.  
  531.   All log data will write to file 'LOGPRO.DAT'. Each log consists
  532.   of 16 bytes, means:
  533.  
  534.     position   size    what
  535.     0    DW    IP
  536.     2    DW    CS
  537.     4    DW    SP
  538.     6    DB    ?
  539.     7    DB    ?
  540.     8    8 byte    hex opcodes
  541.  
  542.   Then run 'LOGPRO.EXE' under DOS command prompt. This will read
  543.   'LOGPRO.DAT' and create 'LOGPRO.TXT'. 'LOGPRO.TXT' is a file
  544.   in ASM format. This is the key opcodes.
  545.  
  546. M RANGE [SEG]:OFFSET
  547.     memory copy.
  548.                 M $L200 8000:100        
  549.     will copy memory from CS:IP length200 to 8000:100. and
  550.                 M DS:0,800 ES:200       
  551.     will copy memory from DS:0 to DS:800 to ES:200.
  552.  
  553. Q
  554.     quit TR. Also you can use <Alt+X> to quit.
  555.  
  556. R REG [num]
  557.     Change value of register.
  558.             R ax 1234
  559.         R ebx 12321456
  560.         R ch 87
  561.         R dl ah
  562.         R fl z
  563.  
  564. RS
  565.     Restore user screen. Hot key: <F4>. Any key to return.
  566.  
  567. S range bytes
  568.     search data in memory.
  569.         s cs:0,ffff 12 34 45    
  570.         s ds:200l100 23        
  571.  
  572. SYM [ON|OFF]
  573.     if load file's symbol infomation. 
  574.  
  575. SYMBOLS
  576.     display all symbols.
  577.  
  578. VLOG
  579.     view log infomation. See command: LOG
  580.  
  581. VIEW filename.ext
  582.     view file.
  583.  
  584. STACK            *new idea*
  585.     view you have run how many CALL's to get here.
  586.  
  587. ---------------------------------------------------------------------
  588.         TRACING commands
  589. G [seg:]offset
  590. G conditions            *new idea*
  591.     run program. 'GO' is ok too.
  592.     Attention: 'int 3' will not stop this GO.
  593.  
  594. GO???            *new idea*
  595.     one-time break point. Any break-point setting command can be
  596.     used as this to use one-time break-point.
  597.             GOREG CS
  598.         GOINT 21 AH=30
  599.         GOW ES:DI
  600.         GOXB CD 13 AH=2
  601. T
  602.     step. Hot key: <F8>
  603.  
  604. GG [[SEG:]OFFSET]
  605.     run unconditionally. TR insert a 'call far' in user program's code
  606.     and just run it.
  607.     You can press <Ctrl+d> and wait TR to return.
  608.  
  609. P
  610.     step one procedure.
  611.  
  612. PP
  613.     go until next opcode. same as 'G $+length of this code'.
  614.  
  615. PRET
  616.     go until return.
  617.  
  618. TT
  619.     run one step use INT1.
  620.  
  621. AUTOINT1 [ON|OFF]
  622.     If ON, TR will use int1 automatically to run a unknown code.
  623.  
  624. INT1 [ON|OFF]
  625.     If ON, TR will run all opcode use INT1.
  626.  
  627. AUTOJMP [ON|OFF]            *new idea*
  628.   Many protecters use many JMP codes to make the program under thier
  629.   protection unreadable. In most situation, you can only see some JMPs in
  630.   code window, but at the target address, in general, you can't see the
  631.   correct disassemble opcode because the protect programs likely insert
  632.   some DATA in front of that address, so, it's difficult to understand
  633.   these programs. With Automatic Jump feature, TR displays the correct
  634.   code at the JMP address in code window instead of displaying a "JMP
  635.   xxxx". So you can see the correct codes sequence but not lots of JMP!
  636.   So, the code is easy to read!
  637.   Default is AUTOJMP ON.
  638.  
  639. ---------------------------------------------------------------------
  640.         Break-Point commands
  641. If you use this break-point only one time, change command from 'BP??' to
  642. 'GO??'.
  643.  
  644. BL
  645.     list break-point. You can set max 8 break-points.
  646.  
  647. BC [num]
  648.     clear specified break-point or all break-point.
  649.  
  650. BD [num]
  651.     disable specified break-point or all break-point.
  652.  
  653. BE [num]
  654.     enable specified break-point or all break-point.
  655.  
  656. BPW segment:offset            *new idea*
  657.   Monitor if memory has changed. TR will check if memory
  658.   word has changed after each step.
  659.  
  660. BP [seg:]offset            *new idea*
  661.     go until CS:IP=SEG:OFFSET or IP=OFFSET.
  662.  
  663. BP conditions                *new idea*
  664.     break-point if condition is true.
  665.         bp ax=1234        
  666.         bp ax=0 bx=0 cx=0    
  667.         bp ah=3 dx=80
  668.  
  669. BPREG REG|SEG [conditions]
  670.        Break-point if given register change. You can use
  671.  
  672.        BPREG cs
  673.  
  674.        to get all code segment change(jmp far,retf...). Also you can
  675.        use something like
  676.  
  677.        BPREG cs ax=0 es=#    ;# means PSP seg
  678.  
  679.        to get the kernel of a shelled program.
  680.  
  681. BPXB bytes [conditions]
  682.        Break-point if encounter ??? code. For example, "MOV AX,????" 
  683.        in HEX code is "B8????", you can use
  684.   
  685.        BPXB b8
  686.        
  687.        to break all "mov ax,????" opcode. Other:
  688.        
  689.        BPXB cd          ;all interrupt
  690.        BPXB 33 c0       ;xor ax,ax
  691.  
  692. BPINT intnum [conditions]
  693.     interrupt breakpoint.
  694.             BPINT 21 AH=30
  695.             BPINT 13 AX=201 CH>30 DX=1
  696.  
  697. BPKNL [count]            *new idea*
  698.     break point if AX=BX=SI=DI=BP=0ú¼DS=ES=<PSP>ú¼IP=0 or IP=100 or CS
  699.     just changed.
  700. ---------------------------------------------------------------------
  701.         other commands
  702. EXE1
  703. EXE2
  704. WEXE1
  705. WEXE2
  706. GETKNL [count]
  707.         Refer next "how to make EXE"
  708. ---------------------------------------------------------------------
  709.  
  710.         How to Make a EXE file from Memory
  711.  
  712. Somtimes we trace a shelled program. Not only we want to trace to the 
  713. real entrypoint of the program, but also we want to make the kernal a
  714. new EXE file. TR can do this. For COM files, it is very easy that we
  715. can use 'W' command to write memory to file directly. Follow is how
  716. to make a EXE file.
  717.  
  718. 1. make EXE by manual
  719. ---------------------
  720.  
  721. First, if we want to write memory to a EXE file, we need to known how
  722. long the file is. TR use 'EXE1' command to clear memory, and 'RELOAD'
  723. command to reload, and then when we write file the changed memory area
  724. is what we should write.
  725.  
  726. Second, trace the program use TR's various commands. Genaraly, we can
  727. get the real entrypoint by
  728.     goreg cs ax=0 bx=0    ;means break when cs changed and ax=bx=0
  729. or
  730.     goknl    ;this is one-time breakpoint means ...see readme
  731. for some times. Use 'WEXE1' command to save the memory image to 'MEM1.DAT'.
  732.  
  733. Third, we need to reload the program to different memory area in order to
  734. build EXE file's relocation. Use 'EXE2' to skeese some memory and clear it,
  735. then 'RELOAD.
  736.  
  737. Fourth, trace the program as the second step. 'WEXE2' save to 'MEM2.DAT'.
  738.  
  739. Fifth, use 'Q' command to quit tr session. Run 'mkexe.exe' in TR's software
  740. package, which will read file 'MEM1.DAT' AND 'MEM2.DAT' to write a EXE file
  741. 'MEM.EXE'. This is! You can try it!
  742.  
  743. 2. Make EXE automatically
  744. -------------------------
  745. After load program in TR, and then use command:
  746.     GETKNL [count]
  747. which 'count' means how many shells TR should unpack. TR will run follow 
  748. command automatic:
  749.     exe1
  750.     reload
  751.     goknl count
  752.     wexe1
  753.     exe2
  754.     reload
  755.     goknl count
  756.     wexe2
  757.     q
  758. This will make 'mem1.dat' and 'mem2.dat'. Then we use
  759.     mkexe [orgfile.exe]
  760. in DOS command prompt to make 'MEM.EXE'. This is unpacked file!
  761.  
  762. I make 'mkexe.exe' out of TR instead of include it in TR just for
  763. that I want to give user a chance to improve it. If you interested
  764. in 'mkexe', you can ask me to get 'mkexe's source (C++).
  765.  
  766. 'mem1.dat' and 'mem2.dat' include a 0x20 length file head:
  767.       offset  size  content
  768.     00    word  0xac,0xbc is flag
  769.     02    word  PSP+0x10,segment of program code in memory
  770.                 'MEM1.DAT' & 'MEM2.DAT' should be diffent in order 
  771.             to get relocation.
  772.     04    word  CS-PSP-0x10, offset of code segment, should be same
  773.     06    word  IP, should same
  774.     08    word  SS-PSP-0x10ú¼offset of stack segment, same
  775.     0a    word  SP, should same
  776.     0c    word  program memory block length(10h)
  777.               dw 09h dup(0)  
  778.  
  779. Do no imagine EXE file made is the same as origin, It is impossible.
  780. They are functional same. If the entrypoint you find not correct, you
  781. can add some code to restore all register yourself.
  782.  
  783. New EXE file may can not run if the origin file has OVERLAY, or it 
  784. check itself. 'MKEXE' can add some code to modify envirment block to
  785. fool the program. Usage:
  786.     MKEXE orgfile.exe
  787. Do not add path in orgfile. You must put new 'mem.exe' and orgin EXE file
  788. together in one directory to run it.
  789.  
  790. --------------the end--------