Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Rescue5 v1.0 CA-Clipper 5 decompiler . - <b>change aptfiler.var</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Change APTFILER.VAR


 If you changed the .UDF extensions to .PRG, delete the .UDF
 files.

 Rescue aptFiler.exe again with the new APTFILER.GRP file (if
 you don't want to type the changes yourself, copy SAMPLE.GRP
 over the current APTFILER.GRP file).

    rescue aptfiler /ofiler

 Examine the code in the recovered APTFILER.PRG:

 FUNCTION APTFILER(cStr)

 05) LOCAL oTbCol, oTb, nPos, nNum, nNum1, nNum2, nChoice, cStr1 := SUBSTR(;
           GETARGV(0), 1, RAT("\", GETARGV(0)))
  
 01) cStr := IF(cStr == NIL, "*.*", cStr )
     PUSHSCR(0, 0, MAXROW(), MAXCOL())
     SETBLINK(.F.)
     SETCURSOR(0)
     csPath := NORMPATH(cStr1)
     nPos := APTBOX(37, 13, NIL, NIL, NIL, TRIMPATH(csPath, 35), NIL, .T., .F.)
 02) nNum := INT(nPos / MAXCOL())
 03) nNum1 := INT(nPos % MAXCOL())
  
     DO WHILE .T.
  
       nNum2 := 1
  
       IF LEN(asDir := APTDIRECTO(cStr, "D")) == 0
  
         IF APTALERT("No matching files!;Set specification set to all?", {;
           "YES", "NO"}, "w+/b,b+/w,w+/b,b/b,w+/b", " ") == 2
  
           csStr := "."
           EXIT
  
         ENDIF
  
         cStr := "*.*"
         LOOP
  
       ENDIF
  
       oTb := TBROWSENEW(nNum + 1, nNum1 + 4, nNum + 9, nNum1 + 19)
 06)   oTb:SKIPBLOCK := {|_bDef,nbNum,nbNum1|nbNum1 := nNum2, nbNum := ;
         nNum2 + _bDef, nNum2 := IF(nbNum > nsLen, nsLen, IF(nbNum < 1,;
         1, nNum2 + _bDef ) ), nNum2 - nbNum1}
 04)   oTb:GOTOPBLOC := {||nNum2 := 1}
       oTb:GOBOTTOMB := {||nNum2 := nsLen}
       oTb:COLORSPEC := "rg+/b"
       oTb:CARGO := ARRAY(31)
       oTb:CARGO[4] := .F.
       oTb:CARGO[12] := .T.
       oTb:CARGO[13] := .F.
       oTb:CARGO[20] := .F.
       oTb:CARGO[25] := {|_bDef|APTSTABILI(_bDef)}
       oTb:CARGO[22] := " "
 07)   oTb:CARGO[1] := {{27, {|_bDef|TBQUIT(_bDef)}}, {5, {|obObj|obObj:UP(),;
         obObj}}, {24, {|obObj|obObj:DOWN(), obObj}}, {3, {|obObj|;
         obObj:PAGEDOWN(), obObj}}, {18, {|obObj|obObj:PAGEUP(), obObj}},;
         {1, {|obObj|obObj:HOME(), obObj}}, {6, {|obObj|obObj:END(), ;
         obObj}}, {31, {|obObj|obObj:GOTOP(), obObj}}, {30, {|obObj|;
         obObj:GOBOTTOM(), obObj}}, {13, {|_bDef|SELECTFILE(_bDef, ;
         cStr)}}, {9, {|_bDef|TBQUIT(_bDef)}}}
  
       IF ISMOUSE()
  
         oTb:CARGO[23] := {||PUSHHOT(nNum, nNum1 + 21, nNum + 8, nNum1 ;
           + 33, {||APTPUTKEY(9)})}
  
       ENDIF
  
       oTbCol := TBCOLUMNNE("", {||asDir[nNum2, 1]})
       oTbCol:WIDTH := 15
       oTb:ADDCOLUMN(oTbCol)
       APTBUTTONS(.F., {"WCARD", "OK", "CANCEL"}, nNum + 1, nNum1 + 23, 0,;
         "w+/b,b+/w,w+/b,b/b,w+/b", .F.)
       oTb := TBKEYHANDL(oTb, .F.)
  
  
       IF LASTKEY() == 9 .OR. LASTKEY() == 27
  
         IF LASTKEY() == 27 .OR. (nChoice := APTBUTTONS(.T.)) == 3
  
           CHDIR(SUBSTR(cStr1, 1, LEN(cStr1) - 1))
           csStr := "."
           EXIT
  
         ELSEIF nChoice == 1
  
           cStr := GETWCARD(cStr)
  
         ELSE
  
           EXIT
  
         ENDIF
  
       ELSEIF LASTKEY() == 13
  
         EXIT
  
       ENDIF
  
     ENDDO
  
     APTBOX()
     POPSCR()
     SETCURSOR(1)

 08) RETURN IF(csStr == ".", "", csPath + csStr )

 Looking at the variables in context helps in assigning more
 meaningful names:

   cStr   # P1   cWildCard // The parameter is a DOS wildcard (ref 01)
   nNum0  # L5   nRow      // (ref 02)
   nNum   # L6   nCol      // (ref 03)
   nNum1  # L7   nFile     // Array index (ref  04)
   cStr1  # L9   cHome     // Starting directory (ref 05)
   _bDef  # BL1  nToSkip   // Standard first parameter to skipBlock (ref 06)
   nbNum  # BL2  nSkipped  // Calculated in skipBlock (ref 06)
   nbNum1 # BL3  nOldI     // Assigned in skipBlock (ref 06)
   _bDef  # BL1  oSelf     // An array of code blocks is a commonly used
   obObj  # BL1  oSelf     //  way of encapsulating methods in a TBrowse
                           //  object using procedural code. (ref 07)
   csStr  # STATIC cFile   // (ref 08)


 To make these changes in the source code, edit APTFILER.VAR.
 Being careful to maintain the order of the entries, substitute
 the names above for the suggested name in the left column.  A
 fragment of the completed file is reproduced below.  If you
 prefer, copy SAMPLE.VAR over APTFILER.VAR.

   #----------APTFILER
   APTFILER:
   (LOCAL)
      cWildCard  # P1
      oTbCol     # L2
      oTb        # L3
      nPos       # L4
      nRow       # L5
      nCol       # L6
      i          # L7

 Rescue aptFiler.exe again with the new APTFILER.VAR file and
 examine the output.  This time use some of the formatting
 switches:

   rescue aptfiler /ts2 /pl /kl /g /r0 /ofiler

 You can run Rescue5 as many times as you wish to change
 formatting, grouping and variable names.

 Try compiling the original APTFILER.SRC with the CA- Clipper /b
 switch and then linking it with SAMPLE.LIB.  If you Rescue the
 result you should find that the local and static variable names
 for the procedures in APTFILER.PRG are recovered as per the
 original source, and that there is no entry for any of these
 procedures in the APTFILER.VAR file.

 Note that to recover the code from SAMPLE.LIB alone you could
 use a linker to produce a .EXE file specifically for the
 purpose:

   RTlink fi sample.lib

 The resulting .EXE file cannot be run, but Rescue5 can recover
 any CA-Clipper code from it.




Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson