TGC Codebase Backup



File Encoder and Reader by Computer Nerd

22nd Feb 2006 9:29
Summary

This is a program that writes values in binary and then converts it to human readable items.



Description

Has I said above it's a program that writes values in binary and then converts it to human readable items. It's not very advanced and great for beginner's it writes it's own ini file for configuration. It has no bugs and it works swell. Great protection against crackers although if they know binary your in trouble!

Have Fun - Jonathan



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    `Encoder Example
`By Jonathan Skinner

`Encoder Example
`By Jonathan Skinner

dim nums(3)
nums(0) = 7634773
nums(1) = 67476347
nums(2) = 81818181
nums(3) = 272717171

dim words$(1)
words$(0) = "jhasdjhjadfjkasdfjasdjk"
words$(1) = "ahajahsge3712uaah"

newnum1$ = bin$(nums(0))
newnum2$ = bin$(nums(1))
newnum3$ = bin$(nums(2))
newnum4$ = bin$(nums(3))

wordval = val(words$(0))
wordval2 = val(words$(1))

strword1$ = bin$(wordval)
strword2$ = bin$(wordval2)

if file exist("encodedfile.ini") = 1 then delete file "encodedfile.ini"
open to write 1,"encodedfile.ini"
write string 1,strword1$
write string 1,strword2$
write string 1,newnum1$
write string 1,newnum2$
write string 1,newnum3$
write string 1,newnum4$
close file 1

open to read 1,"encodedfile.ini"
read string 1,read1$
read string 1,read2$
read string 1,read3$
read string 1,read4$
read string 1,read5$
read string 1,read6$
if read1$ = strword1$ then Print words$(0)
if read2$ = strword2$ then Print words$(1)
if read3$ = newnum1$ then Print nums(0)
if read4$ = newnum2$ then Print nums(1)
if read5$ = newnum3$ then Print nums(2)
if read6$ = newnum4$ then Print nums(3)
wait key
end
`Code is pretty much useless