How can I edit a .prg file

Hello, How can I open a file with extention .prg. I think this is a very old program that was done on foxpro or dbase Im not sure. One of the files stored in data has a file with important information  that need to be opened to view or edit. Please any suggestion on the best way to open the file and see the information it contains.

Thankyou
 
suplyAsked:
Who is Participating?
 
pcelbaConnect With a Mentor Commented:
To keep certain level of security you should change all passwords now...
clave2.xls
0
 
tusharkanvindeCommented:
PRG files are plain text files. Notepad should open the file. There should be program code in the PRG file and not data.
0
 
jrbbldrCommented:
"that need to be opened to view or edit"

Opening a file in Notepad or some other text editor will not do you much good.

Yes, you would probably be able to read the lines of code in the file.

But then what would/could you do with it.  Nothing!

You need to have a copy of FP/VFP to actually edit and compile the prg file so that it might be usable.

Good Luck


0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
CaptainCyrilFounder, Software Engineer, Data ScientistCommented:
You can view or edit the prg file in Notepad or WordPad or any other text editor. If you have the program running from the source or from app that is run with Development Version of FoxPro it will self compile.

Or you can send the prg to someone who has the same version of FoxPro that is running or a previous one and he will compile it for you. I don't know if that is legal though.
0
 
suplyAuthor Commented:
Im trying to retrieve the password and user name to access the program. Im looking at afile that I think has the information stored. Its called password.dbf. Here is a copy of whats inside but I cant see the information I need. All I see is numbers, please help.


`   ‚ H                     USUARIO ÂQåCö_  ( ×~2  åT  ö_j[PASSWORD QåCö_   ×~2  åT  ö_j[MODULO D QåCö_   ×~2  åT  ö_j[
  8987896986778353                        756078788274776344            + 7673828693368683786987                  446068772727272727272727272727+ 7883766982823671698169867583            696243505145272727272727272727+ 7883766982823671698169867583            696243505145272727272727272727, 7673828693368683786987                  446068772727272727272727272727, 7673828693368683786987                  446068772727272727272727272727- 7673828693368683786987                  446068772727272727272727272727. 7673828693368683786987                  446068772727272727272727272727/ 7883766982823671698169867583            696243505145272727272727272727- 7883766982823671698169867583            696243505145272727272727272727. 7883766982823671698169867583            696243505145272727272727272727/ 76738286933681368683786987              4443464752434850              + 7686                                    43505145                      + 7883766982823671698169867583            45515043                      + 7883766982823671698169867583            45515043                      , 7883766982823671698169867583            45515043                      - 7883766982823671698169867583            45515043                      . 7883766982823671698169867583            45515043                      /                                                                       * 80778770738876                          505052522727272727272727272727-

****************************************************************************
Below, is the  menupassword.prg file reads this:

Local Respuesta := "N"
MemVar CaminoDeDatos,CTextos,Clectura
Public CaminoDeDatos
Public CTextos
Public Clectura
If .Not. Clave(1)
   Respuesta = "S"
Endif

Do While  (Respuesta <> "S")
   Clear Screen
   @ 1,1 to 22,79 Double
   @ 7,2 to 7,78
   @ 7,1 say chr(199)
   @ 7,79 say chr(182)
   Set color to U
   @ 2,20 say "C O M P A N Y "
   Set color to (CTextos+","+Clectura)
   @ 3,20 say "DEPARTMENT."
   @ 4,20 to 6,60
   @ 5,21 say "                 CLAVES (password)"
   Set wrap on
   Set Message to 23 Center
   @ 10,20 Prompt "Agregar Usuarios"    Message "Incorporar Usuarios (new users)"
   @ 12,20 Prompt "Borrar Usuarios"     Message "Eliminar Usuarios (eliminate users"
   @ 14,20 Prompt "Modificar Claves"    Message "Modificar PassWord(moify users"
   @ 16,20 Prompt "Retornar"            Message "Retornar al menu anterior return "
   * Captura la opcion del menu
   Menu to Opcion
   Respuesta = "N"
   * Seleccion de la opcion

   Do Case
      Case Opcion = 1
           Do AgreClav
      Case Opcion = 2
           Do BorrClav
      Case Opcion = 3
           Do ModiClav
      Case Opcion = 4
           Respuesta="S"
   EndCase
EndDo
Return


0
 
pcelbaCommented:
The PRG is neither dBase nor Fox... But it is very similar. The sample code does not handle passwords, it just shows a menu with four options. DBF contains passwords encrypted by some unknown algorithm. You should find some other PRG file which encrypts/decrypts passwords stored to this DBF. The PRG name will be ModiClav.PRG or another PRG having PROCEDURE ModiClav text inside.

FYI, to post a file it is better to add one more extension .TXT and attach it as a file to the posted message.
0
 
suplyAuthor Commented:
Hello, I found the prg name modiclav.prg (a copy is attached). How can I decrypt or get the user and password information inside the dbf file.

Thanks,
MODICLAV.txt
0
 
pcelbaCommented:
Do you have FoxPro installed?
0
 
suplyAuthor Commented:
I have foxpro 7 installed.
0
 
pcelbaCommented:
Looking at the code, encryption and decryption is easy:
*-- encryption:
Usuario_1  = "USERNAME"
PassWord_1 = "PASSWORD"

   For i = 1 to Len(Usuario_1)
       Cadena_1 = Cadena_1 + AllTrim(Str(Asc(substr(Usuario_1,i,1))+4))
   Next
   i = 0
   For i = 1 to Len(PassWord_1)
       Cadena_2 = Cadena_2 + AllTrim(Str(Asc(substr(PassWord_1,i,1))-5))
   Next
? "Original  user and password"
? Usuario_1, PassWord_1
? "Encrypted user and password"
? Cadena_1, Cadena_2

*-- decryption from database
USE YourDBF
   For i = 1 to Len(TRIM(Usuario)) STEP 2
       Cadena_1 = Cadena_1 + CHR(VAL(SUBSTR(Usuario, i, 2))-4)
   Next
   i = 0
   For i = 1 to Len(PassWord)
       Cadena_2 = Cadena_2 + CHR(VAL(SUBSTR(Usuario, i, 2))+5)
   Next

? "Database user and password"
? Usuario, PassWord
? "Decrypted user and password"
? Cadena_1, Cadena_2

Open in new window

0
 
suplyAuthor Commented:
Sorry, I have foxpro installed but have no idea how to decrypt it. I havent used foxpro before, dont what to do.

Thanks,
0
 
pcelbaCommented:
One bug, sorry. The decryption of password should be

   For i = 1 to Len(TRIM(PassWord)) STEP 2
       Cadena_2 = Cadena_2 + CHR(VAL(SUBSTR(Password, i, 2))+5)
   Next
0
 
pcelbaCommented:
OK, write the following command in FoxPro Command Window:

MODIFY COMMAND decrypt

Edit window appears and inside this window copy the following code (you have to enter correct DBF name). When you finish then you may run the program by CTRL+E.

CLEAR
CLOSE DATA ALL
USE D:\path\YourDBF

BROWSE FIELDS Usuario, Password, User=DecryptUser(Usuario), Pwd=DecryptPwd(Password)

PROCEDURE DecryptUser
LPARAM lcUser
LOCAL Cadena_1
Cadena_1 = ""

   For i = 1 to Len(TRIM(lcUser)) STEP 2 
       Cadena_1 = Cadena_1 + CHR(VAL(SUBSTR(lcUser, i, 2))-4) 
   Next 

RETURN Cadena_1

PROCEDURE DecryptPwd
LPARAM lcPwd
LOCAL Cadena_2
Cadena_2 = ""

   For i = 1 to Len(TRIM(lcPwd)) STEP 2
       Cadena_2 = Cadena_2 + CHR(VAL(SUBSTR(lcPwd, i, 2))+5) 
   Next 

RETURN Cadena_2

Open in new window

0
 
suplyAuthor Commented:
Im unable to run foxpro7 on my machine. Im trying to install in a different machine but I get a message when I insert the installation  CD...."windows setup x This version on windows cannot be installed on this machine". Im not sure if 7 runs on XP Pro.

Thankyou,
0
 
pcelbaCommented:
And did you read my answer here: http://www.experts-exchange.com/Microsoft/Applications/FoxPro/Q_25522988.html  ?

VFP 7 is able to run under XP. If you apply all XP service packs the Setup error should be fixed most probably.
0
 
pcelbaCommented:
Optionally you may send the DBF and I'll add two columns to it.
0
 
suplyAuthor Commented:
Ok, Im sending the dbf...had to save it as .xls; unable to upload dbf by this post.

Thankyou,
0
 
suplyAuthor Commented:
dbf file
CLAVE.xls
0
 
pcelbaCommented:
It would be better to send it via e-mail from my profile.
0
 
suplyAuthor Commented:
I apreciate your help, thankyou.
0
 
pcelbaCommented:
Just FYI, you may post any file when you add .TXT extension. The original ext can remain.

Thanks for points! Used encryption was really easy. To make password more secure it is better to store just some hash calculated from it.
0
All Courses

From novice to tech pro — start learning today.