A Windows XP help forum. PCbanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » PCbanter forum » Microsoft Windows 7 » Windows 7 Forum
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

How to Edit an xml file



 
 
Thread Tools Rating: Thread Rating: 3 votes, 5.00 average. Display Modes
  #1  
Old May 13th 13, 07:30 PM posted to alt.windows7.general
Dave C[_2_]
external usenet poster
 
Posts: 67
Default How to Edit an xml file

I have been playing Win 7, Free Cell for months. I always intended to
retry a given game until I won. On game 2710, I inadvertently accepted
my First Loss.

I now know that my Free Cell stats are stored in an xml file. How
might I edit that file, to edit (delete) that one lose.

While surely minor, compared to many the REAL problems discussed here,
I am most annoyed at myself. I sure would appreciate any/all advice on
how to edit that file.

dave
  #2  
Old May 13th 13, 07:51 PM posted to alt.windows7.general
Bert[_3_]
external usenet poster
 
Posts: 217
Default How to Edit an xml file

In Dave C
wrote:

While surely minor, compared to many the REAL problems discussed here,
I am most annoyed at myself. I sure would appreciate any/all advice on
how to edit that file.


An XML file is simply an ordinary text file with a peculiar structure,
so any ordinary text editor will do, so long as you understand and don't
destroy the XML strucure while editing it.

--
St. Paul, MN
  #3  
Old May 13th 13, 07:59 PM posted to alt.windows7.general
Alias[_43_]
external usenet poster
 
Posts: 516
Default How to Edit an xml file

On 5/13/2013 8:51 PM, Bert wrote:
In Dave C
wrote:

While surely minor, compared to many the REAL problems discussed here,
I am most annoyed at myself. I sure would appreciate any/all advice on
how to edit that file.


An XML file is simply an ordinary text file with a peculiar structure,
so any ordinary text editor will do, so long as you understand and don't
destroy the XML strucure while editing it.


Which provokes the suggestion to back it up before messing with it.

--
Alias
  #4  
Old May 13th 13, 08:03 PM posted to alt.windows7.general
Gene E. Bloch[_2_]
external usenet poster
 
Posts: 7,485
Default How to Edit an xml file

On Mon, 13 May 2013 14:30:43 -0400, Dave C wrote:

I have been playing Win 7, Free Cell for months. I always intended to
retry a given game until I won. On game 2710, I inadvertently accepted
my First Loss.

I now know that my Free Cell stats are stored in an xml file. How
might I edit that file, to edit (delete) that one lose.

While surely minor, compared to many the REAL problems discussed here,
I am most annoyed at myself. I sure would appreciate any/all advice on
how to edit that file.

dave


There are free xml editors available that structure the file display for
you, or you can just use a text editor, as Bert suggests.

I was gong to link you to XML Notepad, but when I try to look for a link
in its Help-About, it crashes :-)

This is where a different part of the Help menu takes me:
http://msdn.microsoft.com/en-US/data/bb190600.aspx

I give up. Just Google for XML editors or use your text editor.

--
Gene E. Bloch (Stumbling Bloch)
  #5  
Old May 13th 13, 08:08 PM posted to alt.windows7.general
Gene E. Bloch[_2_]
external usenet poster
 
Posts: 7,485
Default How to Edit an xml file

On Mon, 13 May 2013 12:03:16 -0700, Gene E. Bloch wrote:

On Mon, 13 May 2013 14:30:43 -0400, Dave C wrote:

I have been playing Win 7, Free Cell for months. I always intended to
retry a given game until I won. On game 2710, I inadvertently accepted
my First Loss.

I now know that my Free Cell stats are stored in an xml file. How
might I edit that file, to edit (delete) that one lose.

While surely minor, compared to many the REAL problems discussed here,
I am most annoyed at myself. I sure would appreciate any/all advice on
how to edit that file.

dave


There are free xml editors available that structure the file display for
you, or you can just use a text editor, as Bert suggests.

I was gong to link you to XML Notepad, but when I try to look for a link
in its Help-About, it crashes :-)

This is where a different part of the Help menu takes me:
http://msdn.microsoft.com/en-US/data/bb190600.aspx

I give up. Just Google for XML editors or use your text editor.


I looked on the above (not very) user-friendly page and got this:
http://www.microsoft.com/en-us/downl...s.aspx?id=7973

I also have XML Explorer, which I can't fathom, so I can't recommend it.

The MS program works if you don't try Help-About :-)

--
Gene E. Bloch (Stumbling Bloch)
  #6  
Old May 13th 13, 08:03 PM posted to alt.windows7.general
Zaphod Beeblebrox
external usenet poster
 
Posts: 868
Default How to Edit an xml file

On Mon, 13 May 2013 14:30:43 -0400, "Dave C" wrote in article
...

I have been playing Win 7, Free Cell for months. I always intended to
retry a given game until I won. On game 2710, I inadvertently accepted
my First Loss.

I now know that my Free Cell stats are stored in an xml file. How
might I edit that file, to edit (delete) that one lose.

While surely minor, compared to many the REAL problems discussed here,
I am most annoyed at myself. I sure would appreciate any/all advice on
how to edit that file.

dave


As I understand it, Free Cell stats are stored in:

C:\Users\your user name\Appdata\Local\Microsoft Games\Freecell\Freecellsettings.xml

To edit it, all you need is notepad or any other text editor.
Then, find the appropriate entry and modify it, then save.

--
Zaphod

Vell, Zaphod's just zis guy, ya know? - Gag Halfrunt
  #7  
Old May 15th 13, 02:24 PM posted to alt.windows7.general
Dave C[_2_]
external usenet poster
 
Posts: 67
Default How to Edit an xml file

On Mon, 13 May 2013 15:03:55 -0400, Zaphod Beeblebrox
wrote:

On Mon, 13 May 2013 14:30:43 -0400, "Dave C" wrote in article
...

I have been playing Win 7, Free Cell for months. I always intended to
retry a given game until I won. On game 2710, I inadvertently accepted
my First Loss.

I now know that my Free Cell stats are stored in an xml file. How
might I edit that file, to edit (delete) that one lose.

While surely minor, compared to many the REAL problems discussed here,
I am most annoyed at myself. I sure would appreciate any/all advice on
how to edit that file.

dave


As I understand it, Free Cell stats are stored in:

C:\Users\your user name\Appdata\Local\Microsoft Games\Freecell\Freecellsettings.xml

To edit it, all you need is notepad or any other text editor.
Then, find the appropriate entry and modify it, then save.


First, a Sincere Thank You, to the many responders. My question is FAR
less important than most other requests on this board.

Certainly I followed up on the various suggestions. I D/L'ed installed
the XML Notepad 2007, as well as another XML editor (Altova XMLSpy
2013) I found on the net. Neither xml editor allows acces to that
file. I have verified that the File Properties are not restricted from
editing. Both editors give me two, most similar error messages:

Sorry file c:\users\ ... \games \freecell \freecellsettings.xml
cannot be opened.

Can't load binary file c:\users\ ... \games \freecell
\freecellsettings.xml

Note: Above, I have truncated the the full file directory info. For
sure I did locate the applicable Frrecell file.

I sure would aprreciate further advice, as to how I can open and edit
that Freecell file, in an xml editor.

Thanks

  #8  
Old May 15th 13, 05:13 PM posted to alt.windows7.general
Paul
external usenet poster
 
Posts: 18,275
Default How to Edit an xml file

Dave C wrote:
On Mon, 13 May 2013 15:03:55 -0400, Zaphod Beeblebrox
wrote:

On Mon, 13 May 2013 14:30:43 -0400, "Dave C" wrote in article
...
I have been playing Win 7, Free Cell for months. I always intended to
retry a given game until I won. On game 2710, I inadvertently accepted
my First Loss.

I now know that my Free Cell stats are stored in an xml file. How
might I edit that file, to edit (delete) that one lose.

While surely minor, compared to many the REAL problems discussed here,
I am most annoyed at myself. I sure would appreciate any/all advice on
how to edit that file.

dave

As I understand it, Free Cell stats are stored in:

C:\Users\your user name\Appdata\Local\Microsoft Games\Freecell\Freecellsettings.xml

To edit it, all you need is notepad or any other text editor.
Then, find the appropriate entry and modify it, then save.


First, a Sincere Thank You, to the many responders. My question is FAR
less important than most other requests on this board.

Certainly I followed up on the various suggestions. I D/L'ed installed
the XML Notepad 2007, as well as another XML editor (Altova XMLSpy
2013) I found on the net. Neither xml editor allows acces to that
file. I have verified that the File Properties are not restricted from
editing. Both editors give me two, most similar error messages:

Sorry file c:\users\ ... \games \freecell \freecellsettings.xml
cannot be opened.

Can't load binary file c:\users\ ... \games \freecell
\freecellsettings.xml

Note: Above, I have truncated the the full file directory info. For
sure I did locate the applicable Frrecell file.

I sure would aprreciate further advice, as to how I can open and edit
that Freecell file, in an xml editor.

Thanks


Arrgh!

OK, I dug out the Windows 7 laptop, played a game of Freecell
(don't know how, quit and accepted a loss).

OK, brought the freecellsettings.xml back to my WinXP machine
for analysis.

Loaded it in a hex editor. It isn't an XML file that I can see. It
is a two part file, consisting of a binary PNG at the front,
followed by unicode text. Didn't anyone scroll to the end
of the file ? Unicode text in Windows, uses two bytes per character.

Snip the file, leaving hex 89 followed by the letters PNG.
That's the beginning of a PNG file.

This is what is contained in the PNG file I got as a result.
This is magnified by a factor of four, for those with poor eyesight.
It's actually 256x192. Now, why it was important to record this, I'll
never know.

http://imageshack.us/a/img541/4653/test3o.png

There is a PNG spec here, if anyone is interested.

http://www.w3.org/TR/PNG/

I left the text at the end of it (which is past the IEND segment
of the PNG), as it doesn't hurt anything. In other words, with a
hex editor, you snip until you find 137 80 78 71 13 10 26 10 decimal.
137 decimal is 89 hex. Capital P is 80 decimal. (search for "man ascii"
in Google.) So splat PNG, four characters, is the header of a PNG file.
Depending on your image editor, you don't need to precisely snip off
the end, to see the PNG. The image loader will ignore input past
the IEND thing.

We need to remove the PNG file, then analyse the rest of it. The rest
is in unicode. And Notepad should handle it. The end of the PNG is near
IEND, followed by four other characters.

OK, long story short, while keeping your eye on the IEND thing
(which is near the end of the PNG), look for

hex 0xFF, hex 0xFE, then unicode looking like .R.o.o.t.

You want to keep the 0xFF and 0xFE preamble. Snip everything before
that. Save that as test.xml say. Load in Wordpad. You will see

Root
Stats
Version0/Version
GamesPlayed1/GamesPlayed
GamesWon0/GamesWon
MaxWinStreakLength0/MaxWinStreakLength
MaxLoseStreakLength1/MaxLoseStreakLength
CurrStreakLength1/CurrStreakLength
WonlastGamefalse/WonlastGame
/Stats
Options
Version2/Version
PlaySoundstrue/PlaySounds
PlayAnimationstrue/PlayAnimations
RandomAppearancefalse/RandomAppearance
AutoLoadfalse/AutoLoad
TurnOffTipsfalse/TurnOffTips
AutoSaveGameOnExitfalse/AutoSaveGameOnExit
FirstPlayfalse/FirstPlay
CurrDeckSkin2/CurrDeckSkin
CurrBackground0/CurrBackground
/Options
/Root

This is actually unicode, so every character is represented by two bytes.

The only question that remains, is whether the garbage between the
end of the PNG IEND and the beginning of the 0xFF 0xFE unicode
preamble, is a checksum or not.

Hacking the rest of it, is left as a joyous exercise for the
reader.

So it's not "quantum cryptography", it's just obfuscation.
Cut the file in two, edit the text trailer, reassemble.
If it is protected by a checksum, there are some bytes between
IENDxxxx and 0xFF 0xFE that I cannot account for. Make a backup
of the file, before loading your hacked one.

At the very end of the file, I see 0x00 0x0a 0x00 0x00 0x00,
and you probably can't create that with a text editor. When
reassembling the file and bolting it back together, check
that the postamble is correct. I don't know why there is a
Unicode zero down there. A text editor shows that character
as a square. If saving out the file happens to remove it,
you can put that back with the hex editor.

Have fun,

Paul
  #9  
Old May 15th 13, 07:56 PM posted to alt.windows7.general
Gene E. Bloch[_2_]
external usenet poster
 
Posts: 7,485
Default How to Edit an xml file

On Wed, 15 May 2013 12:13:03 -0400, Paul wrote:

At the very end of the file, I see 0x00 0x0a 0x00 0x00 0x00,
and you probably can't create that with a text editor. When
reassembling the file and bolting it back together, check
that the postamble is correct. I don't know why there is a
Unicode zero down there. A text editor shows that character
as a square. If saving out the file happens to remove it,
you can put that back with the hex editor.


I use this hex editor:

http://mh-nexus.de/en/

And that was pretty good detective work, Paul!

--
Gene E. Bloch (Stumbling Bloch)
  #10  
Old May 18th 13, 02:34 AM posted to alt.windows7.general
Char Jackson
external usenet poster
 
Posts: 10,449
Default How to Edit an xml file

On Wed, 15 May 2013 11:56:50 -0700, "Gene E. Bloch"
wrote:

On Wed, 15 May 2013 12:13:03 -0400, Paul wrote:

At the very end of the file, I see 0x00 0x0a 0x00 0x00 0x00,
and you probably can't create that with a text editor. When
reassembling the file and bolting it back together, check
that the postamble is correct. I don't know why there is a
Unicode zero down there. A text editor shows that character
as a square. If saving out the file happens to remove it,
you can put that back with the hex editor.


I use this hex editor:

http://mh-nexus.de/en/

And that was pretty good detective work, Paul!


Ahem, didn't we collectively discuss this very same topic a few months ago
in this group? I clearly remember pointing out that the actual xml resides
at the end of the file. Oh well, I guess if it's worth discovering, it's
worth discovering again. ;-)

--

Char Jackson
  #11  
Old May 14th 13, 01:28 PM posted to alt.windows7.general
SC Tom[_3_]
external usenet poster
 
Posts: 4,089
Default How to Edit an xml file

"Dave C" wrote in message
...
I have been playing Win 7, Free Cell for months. I always intended to
retry a given game until I won. On game 2710, I inadvertently accepted
my First Loss.

I now know that my Free Cell stats are stored in an xml file. How
might I edit that file, to edit (delete) that one lose.

While surely minor, compared to many the REAL problems discussed here,
I am most annoyed at myself. I sure would appreciate any/all advice on
how to edit that file.

dave


If you successfully open, edit, and save a working copy of this file, let me
know. I've tried XML Notepad 2007, FOXE, Notepad, Notepad++, Word, etc., and
have yet to see one recognizable character in any of the MS Games XML files.
I've never much thought about it before, but your post piqued my curiosity,
just to see what's in it.

Impressive streak :-) When I was working, I had a 2000+ winning streak after
an early loss (played on break and at lunchtime only wink wink nudge
nudge ), but not near what you have.
--
SC Tom


  #12  
Old May 14th 13, 02:29 PM posted to alt.windows7.general
Paul
external usenet poster
 
Posts: 18,275
Default How to Edit an xml file

SC Tom wrote:
"Dave C" wrote in message
...
I have been playing Win 7, Free Cell for months. I always intended to
retry a given game until I won. On game 2710, I inadvertently accepted
my First Loss.

I now know that my Free Cell stats are stored in an xml file. How
might I edit that file, to edit (delete) that one lose.

While surely minor, compared to many the REAL problems discussed here,
I am most annoyed at myself. I sure would appreciate any/all advice on
how to edit that file.

dave


If you successfully open, edit, and save a working copy of this file,
let me know. I've tried XML Notepad 2007, FOXE, Notepad, Notepad++,
Word, etc., and have yet to see one recognizable character in any of the
MS Games XML files. I've never much thought about it before, but your
post piqued my curiosity, just to see what's in it.

Impressive streak :-) When I was working, I had a 2000+ winning streak
after an early loss (played on break and at lunchtime only wink wink
nudge nudge ), but not near what you have.


There's a little comedy here. While it is possible to use
encryption on XML, apparently in one case, it was just
BASE64 encoding.

http://thedailywtf.com/Articles/Encrypted-XML.aspx

Paul
  #13  
Old May 14th 13, 05:58 PM posted to alt.windows7.general
SC Tom[_3_]
external usenet poster
 
Posts: 4,089
Default How to Edit an xml file



"Paul" wrote in message
...
SC Tom wrote:
"Dave C" wrote in message
...
I have been playing Win 7, Free Cell for months. I always intended to
retry a given game until I won. On game 2710, I inadvertently accepted
my First Loss.

I now know that my Free Cell stats are stored in an xml file. How
might I edit that file, to edit (delete) that one lose.

While surely minor, compared to many the REAL problems discussed here,
I am most annoyed at myself. I sure would appreciate any/all advice on
how to edit that file.

dave


If you successfully open, edit, and save a working copy of this file, let
me know. I've tried XML Notepad 2007, FOXE, Notepad, Notepad++, Word,
etc., and have yet to see one recognizable character in any of the MS
Games XML files. I've never much thought about it before, but your post
piqued my curiosity, just to see what's in it.

Impressive streak :-) When I was working, I had a 2000+ winning streak
after an early loss (played on break and at lunchtime only wink wink
nudge nudge ), but not near what you have.


There's a little comedy here. While it is possible to use
encryption on XML, apparently in one case, it was just
BASE64 encoding.

http://thedailywtf.com/Articles/Encrypted-XML.aspx

Paul


I tried an on-line decoder and got this error:

"The input is not a valid Base-64 string as it contains a non-base 64
character, more than two padding characters, or a non-white space character
among the padding characters."

Maybe that's not it :-)
--
SC Tom


  #14  
Old May 14th 13, 06:58 PM posted to alt.windows7.general
Mike Barnes[_2_]
external usenet poster
 
Posts: 537
Default How to Edit an xml file

SC Tom :
I tried an on-line decoder and got this error:

"The input is not a valid Base-64 string as it contains a non-base 64
character, more than two padding characters, or a non-white space
character among the padding characters."


Doncha just *love* that sort of error message? Would it be so hard to
say which of those three problems it is?

--
Mike Barnes
  #15  
Old May 14th 13, 07:08 PM posted to alt.windows7.general
Gene E. Bloch[_2_]
external usenet poster
 
Posts: 7,485
Default How to Edit an xml file

On Tue, 14 May 2013 18:58:19 +0100, Mike Barnes wrote:

SC Tom :
I tried an on-line decoder and got this error:

"The input is not a valid Base-64 string as it contains a non-base 64
character, more than two padding characters, or a non-white space
character among the padding characters."


Doncha just *love* that sort of error message? Would it be so hard to
say which of those three problems it is?


One could argue that it's better than *no* list of possible errors :-)

--
Gene E. Bloch (Stumbling Bloch)
 




Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off






All times are GMT +1. The time now is 11:04 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 PCbanter.
The comments are property of their posters.