Adventure Game Studio Official

User reported issues for officially released versions of AGS

Bug Issue: WriteString output is unencrypted

Pages: [1]

AGD2

  • AGSer
  • Posts: 284
« on: 26 Aug 2018, 15:43 »
WriteInt doesn't seem to write the supplied text string to an external file in encrypted format, like it's supposed to.

I'm able to open the external file in both notepad and wordpad and I can see the regular, non-encrypted text. (WriteInt, does however, continue to work properly).

Crimson Wizard

  • AGSer
  • Posts: 8,698
« Reply #1 on: 27 Aug 2018, 15:07 »
Currently neither of the File script commands write data encrypted. The manual also does not mention encryption.

WriteInt writes a non-encrypted number in binary: you should be able to read it using some hex editor. For example, WriteInt(1000) would be seen as "3E8" which is 1000 in hex.
WriteString writes array of chars also in binary, but any text editor would be able to convert it to human-readable representation.

PS. Tested 2.72 just in case, and it does all the same.
« Last Edit: 27 Aug 2018, 15:26 by Crimson Wizard »

AGD2

  • AGSer
  • Posts: 284
« Reply #2 on: 27 Aug 2018, 15:57 »
What I mean is that the AGS manual says the following for WriteString: "The string is written using a custom format to the file, which can only be read back by using File.ReadStringBack."

But if I use WriteString to write to an external file, and then open that external file in notepad or wordpad, I can see the string written in plain text. It's not written using AGS's custom format like it says in the manual.

Crimson Wizard

  • AGSer
  • Posts: 8,698
« Reply #3 on: 27 Aug 2018, 16:16 »
What I mean is that the AGS manual says the following for WriteString: "The string is written using a custom format to the file, which can only be read back by using File.ReadStringBack."

But if I use WriteString to write to an external file, and then open that external file in notepad or wordpad, I can see the string written in plain text. It's not written using AGS's custom format like it says in the manual.


The "custom format" simply means that it appends a type descriptor that lets AGS check whether scripter uses correct functions to read data fields back (ReadInt for integer, ReadStringBack for strings etc).
This may be misleading, but when it sais "can only be read back by using File.ReadStringBack" it probably means that it cannot be read with ReadRaw* functions.
« Last Edit: 27 Aug 2018, 16:18 by Crimson Wizard »

AGD2

  • AGSer
  • Posts: 284
« Reply #4 on: 27 Aug 2018, 16:43 »
I just checked an old external file from around 2006, which I had written to, and it seems you're right. Strings in the external file could be seen in plain text back then, too. I guess I was remembering things wrong. All right, thanks for the clarification, Please disregard this entry.

Issue updated by Crimson Wizard
« Reply #5 on: 27 Aug 2018, 16:50 »
  • Status changed from New to Closed

Pages: [1]

Issue Details

  • Reported
    26 Aug 2018, 15:43
  • Updated
    27 Aug 2018, 16:50
  • View Status
    Public
  • Type
    Bug
  • Status
    Closed
  • Priority
    Normal
  • Version
    AGS 3.4.1
  • Fixed in
    (none)
  • Assigned to
    (none)
  • Category
    Strings

Tags



Powered by: SMF Project Tools 0.5.4 © Niko Pahajoki 2007-2011