How to put commands at the beging of a allready existing exe
How to put commands at the beging of a allready existing exe
How do you put commands at the beging of a allready existing exe file with qbasic?
Evan Hurd
Re: How to put commands at the beging of a allready existing
First of all, you can't modify an existing exe file unless you know assembler well and know how to use Debug.Evan wrote:How do you put commands at the beging of a allready existing exe file with qbasic?
What are you trying to do?
*****
Re: How to put commands at the beging of a allready existing
I am trying to attach a password field or something to keep people off of the program with out some sort of verification to the beginning of a program. I do not have any pacific program to do attach it to but I but I am asking for educational purposes.
Evan
Thanks
Evan
Thanks
Evan Hurd
Re: How to put commands at the beging of a allready existing
There is a way to attach data to the end of an exe file. However, for storing a password, this would not be a very secure solution.Evan wrote:I am trying to attach a password field or something to keep people off of the program with out some sort of verification to the beginning of a program. I do not have any pacific program to do attach it to but I but I am asking for educational purposes.
Evan
Thanks
Why don't you just encrypt the password and write it to a file? Then when the user enters the password, you read the encrypted password from the file, decrypt it, and compare to the user password.
Here's the code for an encryption or decryption function. It won't get passed the CIA, but it's pretty secure otherwise.
Code: Select all
FUNCTION Crypt$ (Password$, X$)
rem X$ is the text to be encrypted or decrypted.
DIM i AS INTEGER
DIM Pass AS INTEGER
DIM X AS INTEGER
DO
FOR X = 1 TO LEN(Password$)
i = i + 1: IF i > LEN(X$) THEN EXIT DO
Pass = ASC(MID$(Password$, X, 1))
MID$(X$, i, 1) = CHR$(ASC(MID$(X$, i, 1)) XOR Pass)
NEXT X
LOOP
Crypt$ = X$
END FUNCTION