Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Coded Images
#5
A quick and simple example of this:

Code: (Select All)
CHDIR "z:"
photo$ = "steve.png"
'AppendData photo$, "This is Steve, back before he graduated from high school."

text$ = GetData(photo$)

SCREEN _NEWIMAGE(480, 640, 32)
image = _LOADIMAGE(photo$)
_PUTIMAGE (0, 0)-(480, 600), image
_PRINTSTRING (0, 610), text$
SLEEP

SUB AppendData (image$, text$)
    DIM AS LONG f, l
    f = FREEFILE
    PRINT image$, _FILEEXISTS(image$)
    OPEN image$ FOR BINARY AS #f
    PUT #f, LOF(f) + 1, text$
    l = LEN(text$)
    PUT #f, , l
    CLOSE #f
END SUB

FUNCTION GetData$ (image$)
    DIM AS LONG l, f, l2
    f = FREEFILE
    OPEN image$ FOR BINARY AS f
    l = LOF(f)
    GET #f, l - 3, l2
    text$ = SPACE$(l2)
    GET #f, l - 3 - l2, text$
    CLOSE #f
    GetData$ = text$
END FUNCTION


   

Note that I'm commented out the line which appends the data to the image in the code above.  This is because I've already appended it to the image here, so all I have to do is GetData back from the image, to showcase it working for us.  Wink

And if you open that file up in any text editor, you'll see a bunch of jibberish like the following:
Quote:...stuff before this...
ӁϾ  _  ` ݻ>       7  s =  B~  o       _   5A    @Ϩ  ' N>ȧ  7    :{  !         X  ? !م 1b3:^ џ
3 Q&D;  "<     h ^ - r  /}i= ?hC Ա    @ɞ ~<l\  K..c | K 4 Y
i0h W\  ܹ } Mwv U 7  p >  9mC0  +  ={  L^  '&   #cN8C g ֭ f,  c   lx[;  a h $:  ti-> }  *] 
    7 8  ӷ ߄yy֬' f _'9c}`  ﮷ o    t K 3  oyq  ֤vmx 2Q    Y  _r      v i 1;  : 
H  ڳļ  }Reҙ  `ͭ  }+ \' |W = y  f{6e       S    pn㫭 :  {  ʵ [r
oő)  ̇    ^e        ?      ߧm    rS  `\ Kd   G<
>u X x  [  o-'  ^    Ե ᜕  ^%`  l4  @ 4 Ar` r%     tV  Ӯ K2G  W 뿴 K G  Ŵ  ; g  J;H    Y0  f 8 o    '>     v  ٸ d    h  ۉ 1 䛿
.  W=9X3 R Wd A c   
H\x [ { 0 C<  W~ $z  m  u  ~  K_    ,  gz   
    i w`  S+ " q n   (^   5  3 w    7WG6  J|  ?8  wOo    y ՗׃  3o?xp  w s  Og ǿu{v  y ־Ÿ}{~q  dۛ ~
˕ cr  \ -  |   ux y Zw  z־  d K 6]    \   n 2 k 9 {  z A  = X >  p 8  >_ %ѦC[ \u d   z  / `^ ը- | :  :>yv  + RrO    eXIfMM *          S    IEND B` This is Steve, back before he graduated from high school.9 

I deleted a bunch of this image data as it's irrelevant to any text editor.  The main thing here to pay attention to is what's at the END of that file...  Plain text, which can be easily read by anyone who wants to open it up and look at it.  No decoding or ninja skills required.  Wink
Reply


Messages In This Thread
Coded Images - by TerryRitchie - 02-23-2024, 05:25 PM
RE: Coded Images - by a740g - 02-23-2024, 05:31 PM
RE: Coded Images - by TerryRitchie - 02-23-2024, 05:44 PM
RE: Coded Images - by SMcNeill - 02-23-2024, 06:40 PM
RE: Coded Images - by SMcNeill - 02-23-2024, 07:50 PM
RE: Coded Images - by Dimster - 02-23-2024, 07:56 PM
RE: Coded Images - by SMcNeill - 02-23-2024, 07:58 PM
RE: Coded Images - by Dimster - 02-23-2024, 09:15 PM
RE: Coded Images - by NakedApe - 02-24-2024, 12:37 AM
RE: Coded Images - by Dimster - 02-24-2024, 01:56 PM
RE: Coded Images - by Pete - 02-25-2024, 07:25 AM
RE: Coded Images - by OldMoses - 02-27-2024, 02:47 AM
RE: Coded Images - by a740g - 02-27-2024, 03:10 AM
RE: Coded Images - by TerryRitchie - 02-27-2024, 03:13 AM
RE: Coded Images - by Pete - 02-28-2024, 09:07 PM



Users browsing this thread: 1 Guest(s)