How to put commands at the beging of a allready existing exe
Posted: Wed Dec 27, 2006 6:11 pm
How do you put commands at the beging of a allready existing exe file with qbasic?
Discuss QBasic, Freebasic, QB64 and more
http://petesqbsite.com/phpBB3/
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?
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
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