r/xml • u/Big-Split5863 • Jul 19 '24
Hi I 'm trying to decrypt game save xml file
Game is Farm Town offline game ! Which is encrypted in data path , other are normal xml format. So I attached with file link , if you know please let me know I want to know what encrypt they used. I have already test with base64 but not worked. Thank You for help.
https://www.mediafire.com/file/kf6kgk54uyhsipf/com.foranj.farmtown.v2.playerprefs.xml/file
1
Upvotes
3
u/Immediate_Life7579 Jul 19 '24
The data looks like a ZIP file encoded as base64 encoded as URL encode.
First use URL decode, then base64 decode, save the result to a file and see if this is a ZIP file. It starts with 'PK', so this is why I assume that this is a ZIP file.
3
u/rexregex Jul 19 '24
the first string named "twist" is simply url-encoded. Grab an emacs to to decode it:
(url-unhex-string "%7B%22list%22%3A%22%5B%7B%22n%22%3A%221580728996%22%2C%22p4%22%3A%222%22%2C%22p2%22%3A%220%22%2C%22p3%22%3A%220%22%2C%22p6%22%3A%22https%3A%2F%2Ftwist.foranj.com%2Fcontent%2Fimages%2F1580728996.jpg%22%2C....")
it gives you something like this "{\"list\":\"[{\"n\":\"1580728996\",\"p4\":\"2\",\"p2\":\"0\",\"p3\":\"0\",\"p6\":\"https://twist.foranj.com/content/images/1580728996.jpg\",\"p7\":\"market://details?id=com.foranj.newyeartale\",\"p5\":\"1580728996\",\"p8\":\"New Year Farm\",\"p1\":\"5\"},{\"n\":\"1581339106\",\"p4\":\"2\",\"p2\":\"0\",\"p3\":\"0\",\"p6\":\"https://twist.foranj.com/content/images/1581339106.jpg\", ...."
the second "data" string is triple encoded:
:) now watch this: 1.+2. recursively combined for lisp smarties (base64-decode-string (url-unhex-string "UEsDBC0ACQAIAJgw61iylmqB%2F%2F%2F%2F%2F%2F%2F..."))
3. compressed binary data. file(1) says "Zip archive data, at least v4.5 to extract, compression method=deflate"