WARNING: Linux users papatcher is insecure.

Discussion in 'Planetary Annihilation General Discussion' started by dfanz0r, September 1, 2015.

  1. dfanz0r

    dfanz0r Active Member

    Messages:
    150
    Likes Received:
    47
    The version of papatcher.go on bitbucket seems to default to using http. So username and passwords are transmitted in plain text...

    I have a changed version that uses https. I should probably try to fork the repo, and do a commit there but.. to lazy atm.
    Here is a gist instead.. (a diff is included as well so its easier to see what I changed)
    https://gist.github.com/mdsitton/aaa0835fdf68e9a3937a

    edit:
    Btw I had confirmed this with wireshark as well.
    Last edited: September 2, 2015
    Antiglow, Quitch and DeathByDenim like this.
  2. DeathByDenim

    DeathByDenim Post Master General

    Messages:
    4,327
    Likes Received:
    2,125
    Nice find!

    And just alleviate any worries: Both Pyrus' Python patcher and my Qt5 patcher both use HTTPS, so they are fine.
  3. dfanz0r

    dfanz0r Active Member

    Messages:
    150
    Likes Received:
    47
    DeathByDenim and crizmess like this.
  4. DeathByDenim

    DeathByDenim Post Master General

    Messages:
    4,327
    Likes Received:
    2,125
    Heh, well the more the merrier, no? :)
    Links:
    Did you notice that the bundles contain Win32 files? It adds 34 MB to the downloads, but they are ignored because they have no file indexes in the manifest json. Kind of weird. I was all excited for having discovered hidden unindexed files. :)
  5. dfanz0r

    dfanz0r Active Member

    Messages:
    150
    Likes Received:
    47
    Another thing with papatcher, I dont think it ever deletes old bundles from the cache. (I ended up with a huge cache folder once)
  6. dfanz0r

    dfanz0r Active Member

    Messages:
    150
    Likes Received:
    47
    Haven't yet got around to looking in the bundles, interesting. Working on it now :p
    DeathByDenim likes this.
  7. dfanz0r

    dfanz0r Active Member

    Messages:
    150
    Likes Received:
    47
    Last edited: September 2, 2015
  8. DeathByDenim

    DeathByDenim Post Master General

    Messages:
    4,327
    Likes Received:
    2,125
    Yeah, those annoyed me too. Mine just doesn't save the bundles at all. It extracts them on the fly while downloading.

    Yeah, look for the bundles for which the first file in the manifests does not have "offset" : 0.

    Yeah, they should be. I just scan the manifest for a bundle for duplicate "offset" and "size" fields. Those should be symbolic links. (See here) (Only on Linux and Mac of course)
  9. dfanz0r

    dfanz0r Active Member

    Messages:
    150
    Likes Received:
    47
    I'd probably have an option to cache them or not.
    Alright, I have a slightly differant method in mind, because there might be stuff that isn't indexed that is elsewhere in a bundle.Who knows maybe some os x stuff is hidden around as well lol.

    So thought of something that would have reduced the need to download the extra data(Range http header). I tried to use it but uber's servers don't seem to support it.
    https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#range-request-header

    edit:
    Something else that would be nice with the range header though, a specific file could be downloaded avoiding redownloading the whole bundle.
    Last edited: September 2, 2015
  10. dfanz0r

    dfanz0r Active Member

    Messages:
    150
    Likes Received:
    47
    Something else do you know if uber has any api to get manifests for older versions, or even a way to get a list of supported version numbers? (If i put in a few build numbers old it looks like the manifests are still available, so might could brute force it, and make a list somewhere if all else fails...)
  11. DeathByDenim

    DeathByDenim Post Master General

    Messages:
    4,327
    Likes Received:
    2,125
    Yeah, I tried that too. Funny thing is, I think I remember that it did work in the past... I guess I am remembering wrong or they disabled it.

    Oh, heh, neat. I didn't realize you could do that. That would be neat. You can probably try downloading the bundle that contains the version.txt file to see if you really got the older version.
  12. dfanz0r

    dfanz0r Active Member

    Messages:
    150
    Likes Received:
    47
    I tried for some really ancient versions, and it didn't work. But for more recent versions atleast a couple patches back it would get the manifest atleast. I should probably actually verify it like you said though.

    edit:
    Seems to work
    Code:
    /version.txt
    b'85138\n' 6
    Last edited: September 2, 2015
    DeathByDenim likes this.
  13. dfanz0r

    dfanz0r Active Member

    Messages:
    150
    Likes Received:
    47
    So made a script and these are the builds that are currently available on ubers servers.

    Code:
    80178
    80462
    82257
    82293
    82369
    82834
    83074
    83391
    83747
    83763
    83796
    85138
    85423
    86422
    86765
    So I guess they seem to keep the last 15 builds?
    sevmek and DeathByDenim like this.
  14. DeathByDenim

    DeathByDenim Post Master General

    Messages:
    4,327
    Likes Received:
    2,125
    Heh, cool. Well, there's your niche for making a fourth Linux PA patcher. :)
    dfanz0r likes this.
  15. dfanz0r

    dfanz0r Active Member

    Messages:
    150
    Likes Received:
    47
  16. dfanz0r

    dfanz0r Active Member

    Messages:
    150
    Likes Received:
    47
    well palp now can actually download the game(on os x at least, away for the days, and only have my macbook pro with me atm), and the game is runable. Haven't made it actually launch pa yet though.. I also need to multithread the download, and some other stuff.
    DeathByDenim likes this.
  17. dfanz0r

    dfanz0r Active Member

    Messages:
    150
    Likes Received:
    47
    After some bugs were introduced, and then fixed. It works on linux too. Might make a thread somewhere at some point... I'd like to make a release though, but there are some things I need to clean up overall before that happens.
  18. dfanz0r

    dfanz0r Active Member

    Messages:
    150
    Likes Received:
    47
    So something interesting I found there are files where they have the same starting offset, but a different overall size.
  19. DeathByDenim

    DeathByDenim Post Master General

    Messages:
    4,327
    Likes Received:
    2,125
    Interesting. Which files are that?
    That's probably responsible for crashing my patcher just after Titans came out. (which I fixed by rewriting the routine from scratch in a more robust way)
  20. dfanz0r

    dfanz0r Active Member

    Messages:
    150
    Likes Received:
    47
    Ok so looked at the manifest for those entries. here is a number of them.
    So far it looks like some of them are of size 0, and whatever is generating the manifests just gives that file the offset of the previous entry in that bundle.
    https://gist.github.com/mdsitton/f81a536314249b8ccc95

    egit: moved json to a gist.

Share This Page